Commit 4912005
authored
ci: consolidate docker service startup into start-services action (#16277)
# Overview
CI jobs intermittently fail because `pnpm docker:start` uses `--profile
all`, pulling every docker image regardless of which the job actually
needs. When Docker Hub has transient auth timeouts on unneeded images
(e.g. `mongodb/mongodb-community-search` in a postgres-only job), the
entire `docker compose up` fails.
**Example failed run:**
[int-postgres-custom-schema](https://github.com/payloadcms/payload/actions/runs/24411041892/job/71308895281?pr=16275#step:5:1144)
— `mongot` image pull timed out with `context deadline exceeded`,
failing a job that doesn't need MongoDB at all.
## Key Changes
- **Renamed `start-database` action to `start-services`**
- The action now starts storage services (LocalStack, Azurite, fake-gcs,
vercel-blob) unconditionally via `--profile storage`, then starts the
requested database conditionally (existing behavior unchanged).
- **Removed separate "Start LocalStack" steps from CI workflows**
- `tests-int` no longer calls `pnpm docker:start` before the action —
storage is handled by `start-services`.
- `tests-e2e` no longer has a conditional "Start LocalStack" step —
storage comes with `start-services` for all E2E jobs.
- **Added retry wrapper for docker compose pulls**
- Each `docker compose` step now separates `pull` (with 3 attempts, 10s
backoff) from `up`. Transient Docker Hub timeouts on needed images are
retried instead of failing the job immediately.
## Design Decisions
Each CI job previously had two service startup phases: a blanket `pnpm
docker:start` (`--profile all`) and then the `start-database` action
with a targeted profile. The `start-database` action already used the
correct profiles for databases, so the `--profile all` step was
redundant and pulled unnecessary images. Merging storage into the action
removes the redundancy and reduces the pull surface to only what each
job needs.
`docker compose pull` has no built-in retry. The daemon's
`max-download-attempts` only retries individual layer downloads, not
auth token requests (which is what timed out here). A shell retry loop
around `pull` is the standard workaround.
The `pnpm docker:start` script in `package.json` still uses `--profile
all` for local development convenience.
## Overall Flow
```mermaid
sequenceDiagram
participant CI as CI Job
participant SS as start-services action
participant DC as docker compose
CI->>SS: uses: start-services (database: postgres)
SS->>DC: --profile storage pull (up to 3 attempts)
SS->>DC: --profile storage up -d --wait
Note over DC: LocalStack, Azurite, fake-gcs, vercel-blob
SS->>DC: --profile postgres pull (up to 3 attempts)
SS->>DC: --profile postgres up -d --wait
Note over DC: PostgreSQL + replica
SS-->>CI: POSTGRES_URL output
```
Previously, CI called `pnpm docker:start` (`--profile all`) before
`start-database`, pulling all images including mongodb/mongot even for
postgres jobs. Now only the needed profiles are pulled, with retry for
transient failures.1 parent 56325ef commit 4912005
3 files changed
Lines changed: 35 additions & 17 deletions
Lines changed: 27 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
23 | 33 | | |
24 | 34 | | |
25 | 35 | | |
26 | 36 | | |
27 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
28 | 43 | | |
29 | 44 | | |
30 | 45 | | |
| |||
33 | 48 | | |
34 | 49 | | |
35 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
36 | 56 | | |
37 | 57 | | |
38 | 58 | | |
| |||
41 | 61 | | |
42 | 62 | | |
43 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
44 | 69 | | |
45 | 70 | | |
46 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | 185 | | |
189 | 186 | | |
190 | 187 | | |
191 | 188 | | |
192 | | - | |
| 189 | + | |
193 | 190 | | |
194 | | - | |
| 191 | + | |
195 | 192 | | |
196 | 193 | | |
197 | 194 | | |
| |||
284 | 281 | | |
285 | 282 | | |
286 | 283 | | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
| 284 | + | |
292 | 285 | | |
293 | | - | |
| 286 | + | |
294 | 287 | | |
295 | 288 | | |
296 | 289 | | |
| |||
404 | 397 | | |
405 | 398 | | |
406 | 399 | | |
407 | | - | |
| 400 | + | |
408 | 401 | | |
409 | 402 | | |
410 | | - | |
| 403 | + | |
411 | 404 | | |
412 | 405 | | |
413 | 406 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
0 commit comments