Skip to content

Commit

Permalink
broken but pinged Pascal - unclear how wacky we're getting here
Browse files Browse the repository at this point in the history
  • Loading branch information
GondekNP committed Aug 6, 2024
1 parent 8f397cb commit 9f8c7b1
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 20 deletions.
16 changes: 14 additions & 2 deletions .devcontainer/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ services:
- DEVCONTAINER_SERVICE=${DEVCONTAINER_SERVICE}
- ENV=LOCAL
ports:
- 8081:8080
- 8081:8080 # FastAPI
- 8678:8678 # Debugpy
volumes:
- type: bind
source: ${LOCAL_ENV_HOME}/.aws
Expand All @@ -18,6 +19,11 @@ services:
target: /root/.config/gcloud
env_file:
- .env
logging:
driver: "local"
options:
max-size: "10m"
max-file: "3"

burn_backend:
build:
Expand All @@ -27,7 +33,8 @@ services:
- DEVCONTAINER_SERVICE=${DEVCONTAINER_SERVICE}
- ENV=LOCAL
ports:
- 5051:5050
- 5051:5050 # FastAPI
- 5678:5678 # Debugpy
volumes:
- type: bind
source: ${LOCAL_ENV_HOME}/.aws
Expand All @@ -37,3 +44,8 @@ services:
target: /root/.config/gcloud
env_file:
- .env
logging:
driver: "local"
options:
max-size: "10m"
max-file: "3"
34 changes: 17 additions & 17 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@
"python": "/opt/conda/envs/burn-severity-prod/bin/python",
"console": "integratedTerminal"
},
{
"name": "Python: Attach to Docker Burn Backend",
"type": "debugpy",
"request": "attach",
"connect": {
"host": "localhost",
"port": 5678
},
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "/workspace"
}
]
},
{
"name": "Python: TiTiler FastAPI",
"type": "debugpy",
Expand All @@ -33,33 +48,18 @@
"python": "/opt/conda/envs/titiler-prod/bin/python",
"console": "integratedTerminal"
},
{
"name": "Python: Attach to Docker Burn Backend",
"type": "debugpy",
"request": "attach",
"connect": {
"host": "localhost",
"port": 5678
},
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "/workspace/src/burn_backend"
}
]
},
{
"name": "Python: Attach to Docker TiTiler",
"type": "debugpy",
"request": "attach",
"connect": {
"host": "localhost",
"port": 5678
"port": 8678
},
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "/workspace/src/titiler"
"remoteRoot": "/workspace"
}
]
}
Expand Down
1 change: 1 addition & 0 deletions src/burn_backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

## APP SETUP ##
app = FastAPI(docs_url="/documentation")
print(os.getenv("ENV"))

## CORS / LOCAL DEV ##
if os.getenv("ENV") == "LOCAL":
Expand Down
4 changes: 3 additions & 1 deletion src/titiler/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
from src.titiler.routers.pages import home, map, upload, directory

## LOCAL DEV ##
print(os.getenv("ENV"))

if os.getenv("ENV") == "LOCAL":
# Set up debugpy
import debugpy

debugpy.listen(("0.0.0.0", 5678))
debugpy.listen(("0.0.0.0", 8678))
print("Waiting for debugger attach...")
debugpy.wait_for_client()
print("Debugger attached")
Expand Down

0 comments on commit 9f8c7b1

Please sign in to comment.