Compare commits

..

No commits in common. "f5557a5ccd4711e341c8b5b17de72cfb7647ab94" and "4325560ec4552ebd778f981698dd22d9670fd43a" have entirely different histories.

2 changed files with 26 additions and 29 deletions

View File

@ -336,12 +336,10 @@ Generate client token, (see [installation](#installation)).
### Others
There are many other internal api endpoints for handling authentication and lease process.
There are some more internal api endpoints for handling authentication and lease process.
# Troubleshoot
**Please make sure that fastapi-dls and your guests are on the same timezone!**
## Linux
Logs are available with `journalctl -u nvidia-gridd -f`.
@ -450,7 +448,10 @@ Dec 20 17:53:34 ubuntu-grid-server nvidia-gridd[10354]: License acquired success
</details>
### Error on releasing leases on shutdown (can be fixed with reverse proxy)
### Error on releasing leases on shutdown (fixed in 1.3 by using reverse proxy)
**UPDATE for version `1.3`**: This issue can be fixed by using a reverse proxy (e.g. `nginx`). Please read section
below.
The driver wants to release current leases on shutting down windows. This endpoint needs to be a http endpoint and
is currently not implemented. The error message looks like and safely can be ignored (since we have no license

View File

@ -2,28 +2,13 @@ version: '3.9'
x-dls-variables: &dls-variables
DLS_URL: localhost # REQUIRED, change to your ip or hostname
DLS_PORT: 443 # must match nginx listen & exposed port
DLS_PORT: 443 # must match nginx listen port
LEASE_EXPIRE_DAYS: 90
DATABASE: sqlite:////app/database/db.sqlite
DEBUG: false
services:
dls:
image: collinwebdesigns/fastapi-dls:latest
restart: always
environment:
<<: *dls-variables
volumes:
- /opt/docker/fastapi-dls/cert:/app/cert # instance.private.pem, instance.public.pem
- db:/app/database
entrypoint: ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--app-dir", "/app", "--proxy-headers"]
healthcheck:
test: ["CMD", "curl", "--fail", "http://localhost:8000/-/health"]
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
proxy:
web:
image: nginx
ports:
# thees are ports where nginx (!) is listen to
@ -32,14 +17,14 @@ services:
volumes:
- /opt/docker/fastapi-dls/cert:/opt/cert
healthcheck:
test: ["CMD", "curl", "--insecure", "--fail", "https://localhost/-/health"]
test: [ "CMD", "curl", "--insecure", "--fail", "https://localhost/-/health" ]
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
command: |
bash -c "bash -s <<\"EOF\"
cat > /etc/nginx/nginx.conf <<\"EON\"
bash -c 'bash -s <<"EOF"
cat > /etc/nginx/nginx.conf <<"EON"
daemon off;
user root;
worker_processes auto;
@ -54,7 +39,7 @@ services:
include /etc/nginx/mime.types;
upstream dls-backend {
server dls:8000; # must match dls listen port
server dls:443;
}
server {
@ -75,17 +60,18 @@ services:
ssl_prefer_server_ciphers on;
location / {
proxy_ssl_verify off;
proxy_set_header Host $$http_host;
proxy_set_header X-Real-IP $$remote_addr;
proxy_set_header X-Forwarded-For $$proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $$scheme;
proxy_pass http://dls-backend$$request_uri;
proxy_pass https://dls-backend$$request_uri;
}
location = /-/health {
access_log off;
add_header 'Content-Type' 'application/json';
return 200 '{\"status\":\"up\",\"service\":\"nginx\"}';
return 200; # '{\"status\":\"up\",\"service\":\"nginx\"}';
}
}
@ -98,11 +84,12 @@ services:
server_name _;
location /leasing/v1/lessor/shutdown {
proxy_ssl_verify off;
proxy_set_header Host $$http_host;
proxy_set_header X-Real-IP $$remote_addr;
proxy_set_header X-Forwarded-For $$proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $$scheme;
proxy_pass http://dls-backend/leasing/v1/lessor/shutdown;
proxy_pass https://dls-backend/leasing/v1/lessor/shutdown;
}
location / {
@ -112,7 +99,16 @@ services:
}
EON
nginx
EOF"
EOF'
dls:
image: collinwebdesigns/fastapi-dls:latest
restart: always
environment:
<<: *dls-variables
volumes:
- /opt/docker/fastapi-dls/cert:/app/cert
- db:/app/database
volumes:
db: