fastapi-dls/doc/Reverse Engineering Notes.md

99 lines
2.6 KiB
Markdown
Raw Normal View History

2022-12-16 15:51:00 +03:00
# Reverse Engineering Notes
2025-03-09 23:37:29 +03:00
[[_TOC_]]
2025-03-13 22:29:16 +03:00
# NLS Docker Stack
2022-12-16 15:51:00 +03:00
2025-03-09 23:37:29 +03:00
- More about Docker Images https://git.collinwebdesigns.de/nvidia/nls
2025-03-13 22:29:16 +03:00
## Appliance
2022-12-16 15:51:00 +03:00
2025-03-13 22:29:16 +03:00
### Configuration data
2022-12-16 15:51:00 +03:00
2025-03-13 22:29:16 +03:00
- Most variables and configs are stored in `/var/lib/docker/volumes/configurations/_data`.
- Config-Variables are in `etc/dls/config/service_env.conf`.
2023-01-03 16:09:35 +03:00
2025-03-13 22:29:16 +03:00
### NLS Logs
2025-03-13 22:29:16 +03:00
Logs are found in `/var/lib/docker/volumes/logs/_data`.
2022-12-16 15:51:00 +03:00
2025-03-13 22:29:16 +03:00
Most interesting logs are:
2022-12-16 15:51:00 +03:00
2025-03-13 22:29:16 +03:00
- `fileInstallation.log`
- `serviceInstance.log`
2022-12-16 15:51:00 +03:00
2025-03-13 22:29:16 +03:00
### File manipulation and copy
2022-12-16 15:51:00 +03:00
2025-03-13 22:29:16 +03:00
- Files can be copied with `docker cp <container-id>:/venv/... /opt/localfile/...`.
- Files can be directly edited via Docker-Volume mounts
- see `df -h` (one is nls, the other postgres container)
```
overlay 16G 11G 5.6G 66% /var/lib/docker/overlay2/<hash>/merged
overlay 16G 11G 5.6G 66% /var/lib/docker/overlay2/<hash>/merged
```
- then you can edit files with e.g. `nano venv/lib/python3.12/site-packages/...`
2022-12-16 15:51:00 +03:00
2025-03-13 22:29:16 +03:00
### Other tools / files
Other tools / files which may can helpful, but not known for what they are used.
2022-12-16 15:51:00 +03:00
- `/etc/dls/config/decryptor/decryptor`
2025-03-13 22:29:16 +03:00
- `/etc/dls/config/site_key_uri.bin`
- `/etc/dls/config/dls_db_password.bin`
2022-12-16 15:51:00 +03:00
2025-03-13 22:29:16 +03:00
## Database
2022-12-20 07:39:17 +03:00
2025-03-13 22:29:16 +03:00
- It's enough to manipulate database licenses. There must not be changed any line of code to bypass licensing
validations.
2022-12-16 15:51:00 +03:00
2025-03-13 22:29:16 +03:00
Valid users are `dls_writer` and `postgres`.
2022-12-16 15:51:00 +03:00
2025-03-13 22:29:16 +03:00
```shell
docker exec -it <dls:pgsql> psql -h localhost -U postgres
2022-12-16 15:51:00 +03:00
```
2025-03-13 22:29:16 +03:00
If you want external access to database, you have to add `ports: [ 5432:5432 ]` to postgres section in
`docker-compose.yml`.
Then you can *exec* into container with `psql` and add a new superuser:
2022-12-16 15:51:00 +03:00
2025-03-13 22:29:16 +03:00
```sql
CREATE
USER admin WITH LOGIN SUPERUSER PASSWORD 'admin';
2022-12-16 15:51:00 +03:00
```
2025-03-13 22:29:16 +03:00
# Logging / Stack Trace
2022-12-16 15:51:00 +03:00
2025-03-13 22:29:16 +03:00
- https://docs.nvidia.com/license-system/latest/nvidia-license-system-user-guide/index.html#troubleshooting-dls-instance
2022-12-16 15:51:00 +03:00
2025-03-13 22:29:16 +03:00
# Nginx
2022-12-16 15:51:00 +03:00
2025-03-13 22:29:16 +03:00
- NGINX uses `/opt/certs/cert.pem` and `/opt/certs/key.pem`
2025-03-13 22:29:16 +03:00
# Usefully commands on Client
2025-03-13 22:29:16 +03:00
## Check licensing status
2022-12-16 15:51:00 +03:00
2025-03-13 22:29:16 +03:00
- `nvidia-smi -q | grep "License"`
2022-12-16 15:51:00 +03:00
2025-03-13 22:29:16 +03:00
**Output**
2022-12-16 15:51:00 +03:00
```
2025-03-13 22:29:16 +03:00
vGPU Software Licensed Product
License Status : Licensed (Expiry: 2023-1-14 12:59:52 GMT)
2022-12-16 15:51:00 +03:00
```
2025-03-13 22:29:16 +03:00
## Track licensing progress
- NVIDIA Grid Log: `journalctl -u nvidia-gridd -f`
2022-12-16 15:51:00 +03:00
```
2025-03-13 22:29:16 +03:00
systemd: Started NVIDIA Grid Daemon.
nvidia-gridd: Configuration parameter ( ServerAddress ) not set
nvidia-gridd: vGPU Software package (0)
nvidia-gridd: Ignore service provider and node-locked licensing
nvidia-gridd: NLS initialized
nvidia-gridd: Acquiring license. (Info: license.nvidia.space; NVIDIA RTX Virtual Workstation)
nvidia-gridd: License acquired successfully. (Info: license.nvidia.space, NVIDIA RTX Virtual Workstation; Expiry: 2023-1-29 22:3:0 GMT)
2022-12-16 15:51:00 +03:00
```