Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add local docker compose debugging #1564

Merged
merged 6 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 66 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,61 @@
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Worker",
"name": "Attach debugpy Worker",
"type": "debugpy",
"request": "attach",
"connect": {
"host": "localhost",
"port":10000
},
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "/home/turbinia"
}
]
},
{
"name": "Attach debugpy Server",
"type": "debugpy",
"request": "attach",
"connect": {
"host": "localhost",
"port":20000
},
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "/home/turbinia"
}
]
},
{
"name": "Attach debugpy API Server",
"type": "debugpy",
"request": "attach",
"connect": {
"host": "localhost",
"port":30000
},
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "/home/turbinia"
}
]
},
{
"name": "Turbinia API Client",
"type": "debugpy",
"request": "launch",
"cwd": "${workspaceFolder}",
"program": "turbinia/api/cli/turbinia_client/turbiniacli_tool.py",
"args": "${input:apiClientCommand}",
"console": "integratedTerminal",
},
{
"name": "Attach k8s Worker",
"type": "cloudcode.kubernetes",
"request": "attach",
"language": "Python",
Expand All @@ -14,7 +68,7 @@
"remoteRoot": "/home/turbinia"
},
{
"name": "Attach to Server",
"name": "Attach k8s Server",
"type": "cloudcode.kubernetes",
"request": "attach",
"language": "Python",
Expand All @@ -26,7 +80,7 @@
"remoteRoot": "/home/turbinia"
},
{
"name": "Attach to API Server",
"name": "Attach k8s API Server",
"type": "cloudcode.kubernetes",
"request": "attach",
"language": "Python",
Expand All @@ -37,5 +91,13 @@
"localRoot": "${workspaceFolder}",
"remoteRoot": "/home/turbinia"
}
]
],
"inputs": [
{
"id": "apiClientCommand",
"type": "promptString",
"description": "API Client Command",
"default": "config list"
}
]
}
3 changes: 3 additions & 0 deletions docker/api_server/Dockerfile.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ build
__pycache__
.cache
turbinia.egg-info
conf/
redis-data/
evidence/
7 changes: 7 additions & 0 deletions docker/local/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ services:
- LC_ALL=C.UTF-8
- LANG=C.UTF-8
- TURBINIA_EXTRA_ARGS=${TURBINIA_EXTRA_ARGS}
ports:
- 127.0.0.1:20000:20000

turbinia-api-server:
#image: "turbinia-api-server-dev" # Use this for local development and comment out below line
Expand All @@ -41,6 +43,9 @@ services:
- TURBINIA_EXTRA_ARGS=${TURBINIA_EXTRA_ARGS}
expose:
- "8000"
ports:
- 127.0.0.1:30000:30000
- 127.0.0.1:8000:8000

turbinia-worker:
#image: "turbinia-worker-dev" # Use this for local development and comment out below line
Expand All @@ -56,6 +61,8 @@ services:
- LC_ALL=C.UTF-8
- LANG=C.UTF-8
- TURBINIA_EXTRA_ARGS=${TURBINIA_EXTRA_ARGS}
ports:
- 127.0.0.1:10000:10000

# Uncomment below in case you want to run a second worker on the same host.
# turbinia-worker2:
Expand Down
6 changes: 6 additions & 0 deletions docker/local/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
mkdir redis-data
mkdir evidence
mkdir conf
chmod 777 conf evidence redis-data
sed -f docker/local/local-config.sed turbinia/config/turbinia_config_tmpl.py > conf/turbinia.conf
3 changes: 3 additions & 0 deletions docker/server/Dockerfile.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ charts
__pycache__
.cache
turbinia.egg-info
conf/
redis-data/
evidence/
3 changes: 3 additions & 0 deletions docker/worker/Dockerfile.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ charts
__pycache__
.cache
turbinia.egg-info
conf/
redis-data/
evidence/
Loading