Skip to content

Commit

Permalink
Added vs code config to remote debug utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
Elia Palme committed Apr 23, 2024
1 parent 20f2e6b commit f8d2a70
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 8 deletions.
27 changes: 22 additions & 5 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,11 @@
},
"args": [
"run",
"--no-debugger",
"--no-reload",
"--port",
"5003"
],
"jinja": true
}
},
{
"name": "Python Debugger: Status",
"type": "debugpy",
Expand All @@ -61,12 +59,31 @@
},
"args": [
"run",
"--no-debugger",
"--no-reload",
"--port",
"5001"
],
"jinja": true
},
{
"name": "Utilities [Docker Compose]",
"type": "debugpy",
"request": "attach",
"logToFile": true,
"connect": {
"host": "localhost",
"port": 5678
},
"pathMappings": [
{
"localRoot": "${workspaceFolder}/src/utilities/utilities.py",
"remoteRoot": "/utilities.py"
},
{
"localRoot": "${workspaceFolder}/src/common/cscs_api_common.py",
"remoteRoot": "/cscs_api_common.py"
}

]
}
]
}
7 changes: 7 additions & 0 deletions deploy/demo/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,18 @@ services:
network: host
env_file:
- ./common/common.env
command:
[
"sh",
"-c",
"pip install debugpy && python3 -Xfrozen_modules=off -m debugpy --listen 0.0.0.0:5678 -m gunicorn --bind :$${F7T_UTILITIES_PORT} $${F7T_GUNICORN_LOG} $${F7T_GUNICORN_SSL} $${F7T_GUNICORN_WORKER} utilities:app",
]
networks:
firecrest-internal:
ipv4_address: 192.168.220.7
ports:
- 5004:5004
- 5678:5678
volumes:
- ./logs/firecrest:/var/log:delegated
- ../test-build/environment/keys/user-key:/user-key:ro
Expand Down
7 changes: 4 additions & 3 deletions deploy/docker/utilities/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ LABEL org.opencontainers.image.source=https://github.com/eth-cscs/firecrest
ADD deploy/docker/utilities/requirements.txt deps/requirements.txt
RUN pip3 install -r deps/requirements.txt

ADD src/utilities/utilities.py utilities.py
ADD src/common/cscs_api_common.py cscs_api_common.py
ADD src/utilities/utilities.py ./utilities.py
ADD src/common/cscs_api_common.py ./cscs_api_common.py

RUN mkdir /var/log/profs

Expand All @@ -26,4 +26,5 @@ ENV F7T_GUNICORN_SSL --ciphers TLS_AES_256_GCM_SHA384,TLS_CHACHA20_POLY1305_SHA2
--ssl-version TLSv1_2 --keyfile $F7T_SSL_KEY --certfile $F7T_SSL_CRT
ENV F7T_GUNICORN_WORKER --workers=1 --threads=1

ENTRYPOINT /usr/local/bin/gunicorn ${F7T_GUNICORN_SSL} ${F7T_GUNICORN_WORKER} --bind :${F7T_UTILITIES_PORT} ${F7T_GUNICORN_LOG} utilities:app
CMD ["sh", "-c", "/usr/local/bin/gunicorn --bind :$F7T_UTILITIES_PORT $F7T_GUNICORN_LOG $F7T_GUNICORN_SSL $F7T_GUNICORN_WORKER utilities:app"]

0 comments on commit f8d2a70

Please sign in to comment.