Skip to content

Commit

Permalink
chore(go): add devel mode for some Go containers
Browse files Browse the repository at this point in the history
  • Loading branch information
NefixEstrada authored and mgamboav committed Jul 9, 2024
1 parent db9cc30 commit 05f7313
Show file tree
Hide file tree
Showing 4 changed files with 140 additions and 7 deletions.
50 changes: 50 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug isard-authentication",
"type": "go",
"debugAdapter": "dlv-dap",
"request": "attach",
"mode": "remote",
"host": "172.31.255.11",
"port": 4000,
"substitutePath": [
{
"from": "${workspaceFolder}",
"to": "/authentication"
}
]
},
{
"name": "Debug isard-orchestrator",
"type": "go",
"debugAdapter": "dlv-dap",
"request": "attach",
"mode": "remote",
"host": "172.31.255.30",
"port": 4000,
"substitutePath": [
{
"from": "${workspaceFolder}",
"to": "/orchestrator"
}
]
},
{
"name": "Debug isard-sessions",
"type": "go",
"debugAdapter": "dlv-dap",
"request": "attach",
"mode": "remote",
"host": "172.31.255.99",
"port": 4000,
"substitutePath": [
{
"from": "${workspaceFolder}",
"to": "/sessions"
}
]
},
]
}
36 changes: 36 additions & 0 deletions docker-compose-parts/authentication.devel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
version: "3.5"
services:
isard-authentication:
image: ${GOLANG_BUILD_IMAGE}
command:
- ash
- -c
- >-
apk add --no-cache \
ca-certificates \
openssl \
curl &&
go install github.com/githubnemo/CompileDaemon@latest &&
go install github.com/go-delve/delve/cmd/dlv@latest &&
set +a &&
cat /authentication/authentication/build/package/run.sh | head -n-1 | ash &&
set -a &&
CompileDaemon \
-log-prefix=false \
-graceful-kill=true \
-directory=/authentication \
-build="go build -o /bin/authentication ./authentication/cmd/authentication/main.go" \
-command="dlv exec --headless=true --listen=:4000 --api-version=2 --accept-multiclient --continue /bin/authentication"
volumes:
- ${BUILD_ROOT_PATH}/go.mod:/authentication/go.mod
- ${BUILD_ROOT_PATH}/go.sum:/authentication/go.sum
- ${BUILD_ROOT_PATH}/pkg:/authentication/pkg
- ${BUILD_ROOT_PATH}/authentication:/authentication/authentication
- /tmp/isardvdi-go-devel/cache:/root/.cache/go-build
- /tmp/isardvdi-go-devel/pkg:/go/pkg
security_opt:
- "seccomp:unconfined"
cap_add:
- SYS_PTRACE
28 changes: 28 additions & 0 deletions docker-compose-parts/infrastructure.devel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: "3.5"
services:
isard-orchestrator:
image: ${GOLANG_BUILD_IMAGE}
command:
- ash
- -c
- >-
go install github.com/githubnemo/CompileDaemon@latest &&
go install github.com/go-delve/delve/cmd/dlv@latest &&
CompileDaemon \
-log-prefix=false \
-graceful-kill=true \
-directory=/orchestrator \
-build="go build -o /bin/orchestrator ./orchestrator/cmd/orchestrator/main.go" \
-command="dlv exec --headless=true --listen=:4000 --api-version=2 --accept-multiclient --continue /bin/orchestrator"
volumes:
- ${BUILD_ROOT_PATH}/go.mod:/orchestrator/go.mod
- ${BUILD_ROOT_PATH}/go.sum:/orchestrator/go.sum
- ${BUILD_ROOT_PATH}/pkg:/orchestrator/pkg
- ${BUILD_ROOT_PATH}/orchestrator:/orchestrator/orchestrator
- /tmp/isardvdi-go-devel/cache:/root/.cache/go-build
- /tmp/isardvdi-go-devel/pkg:/go/pkg
security_opt:
- "seccomp:unconfined"
cap_add:
- SYS_PTRACE
33 changes: 26 additions & 7 deletions docker-compose-parts/sessions.devel.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
version: '3.5'
version: "3.5"
services:
isard-sessions:
build:
context: ${BUILD_ROOT_PATH}
dockerfile: sessions/build/package/Dockerfile
args:
- "GOLANG_BUILD_IMAGE=${GOLANG_BUILD_IMAGE}"
- "GOLANG_RUN_IMAGE=${GOLANG_RUN_IMAGE}"
image: ${GOLANG_BUILD_IMAGE}
command:
- ash
- -c
- >-
go install github.com/githubnemo/CompileDaemon@latest &&
go install github.com/go-delve/delve/cmd/dlv@latest &&
CompileDaemon \
-log-prefix=false \
-graceful-kill=true \
-directory=/sessions \
-build="go build -o /bin/sessions ./sessions/cmd/sessions/main.go" \
-command="dlv exec --headless=true --listen=:4000 --api-version=2 --accept-multiclient --continue /bin/sessions"
volumes:
- ${BUILD_ROOT_PATH}/go.mod:/sessions/go.mod
- ${BUILD_ROOT_PATH}/go.sum:/sessions/go.sum
- ${BUILD_ROOT_PATH}/pkg:/sessions/pkg
- ${BUILD_ROOT_PATH}/sessions:/sessions/sessions
- /tmp/isardvdi-go-devel/cache:/root/.cache/go-build
- /tmp/isardvdi-go-devel/pkg:/go/pkg
security_opt:
- "seccomp:unconfined"
cap_add:
- SYS_PTRACE

0 comments on commit 05f7313

Please sign in to comment.