Skip to content

Commit 28a3ab6

Browse files
authored
fix(swarm): configs and docs for gantry (#1077)
1 parent d8e1d73 commit 28a3ab6

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed
Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
## Usage
22

3-
This stack defines all the services for the housekeeping apps. See comments in the stack file for details. Note that for credentials we use the host docker `config.json` file. This requires the update service to be running on the same host (typically the manager node).
3+
This stack defines all the services for the housekeeping apps. See comments in the stack file for details.
44

5-
Also note that these credentials need to be updated if they expire. This file is located at `~/.docker/config.json`.
5+
### Gantry Auto-Update Service
6+
7+
**Authentication Requirements:**
8+
- Uses host Docker credentials from `/home/freecodecamp/.docker/config.json`
9+
- Requires `--with-registry-auth` (set via `GANTRY_UPDATE_OPTIONS`) to propagate credentials to worker nodes
10+
- Credentials must be valid and updated if expired
11+
12+
**Directory Requirements:**
13+
- Mount `/home/freecodecamp/.docker:/root/.docker` as **writable** (buildx needs write access)
14+
- Ensure `/home/freecodecamp/.docker/buildx/` directory exists on manager node
15+
16+
**Deployment:**
17+
```bash
18+
# Ensure correct ownership and permissions
19+
sudo chown -R freecodecamp:freecodecamp /home/freecodecamp/.docker
20+
sudo chmod -R u+w /home/freecodecamp/.docker
21+
22+
# Deploy stack
23+
docker stack deploy -c docker/swarm/stacks/oncall/stack-oncall.yml oncall
24+
```
25+
26+
**Note:** The update service runs on the manager node via cronjob scheduling (managed by `svc-cronjob`).

docker/swarm/stacks/oncall/stack-oncall.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,17 @@ services:
2020
- "GANTRY_SLEEP_SECONDS=0"
2121
- "GANTRY_LOG_LEVEL=INFO"
2222
- "GANTRY_SERVICES_FILTERS=label=org.freecodecamp.autoupdate"
23+
- "GANTRY_SERVICES_EXCLUDED_FILTERS=name=stg-news"
2324
- "GANTRY_UPDATE_NUM_WORKERS=3"
2425
- "GANTRY_MANIFEST_NUM_WORKERS=5"
2526
- "GANTRY_MANIFEST_CMD=buildx"
2627
- "GANTRY_CLEANUP_IMAGES=true"
2728
- "GANTRY_ROLLBACK_ON_FAILURE=true"
2829
- "GANTRY_UPDATE_TIMEOUT_SECONDS=300"
30+
- "GANTRY_UPDATE_OPTIONS=--with-registry-auth"
2931
volumes:
3032
- "/var/run/docker.sock:/var/run/docker.sock"
31-
- "/home/freecodecamp/.docker/config.json:/root/.docker/config.json:ro"
33+
- "/home/freecodecamp/.docker:/root/.docker"
3234
deploy:
3335
mode: replicated
3436
replicas: 0

0 commit comments

Comments
 (0)