CI: install GNU tar in the CI image so actions/cache works #190

Merged
thatguygriff merged 1 commits from fix/187-ci-image-gnu-tar into main 2026-08-25 01:23:13 +00:00
Owner

Caught while staging step 2 of #187, before it could fail on main.

actions/cache does not use a tar library — it shells out to tar --posix -P …. Alpine's busybox tar rejects both flags (unrecognized option: posix), so the Cache Composer packages step fails in any job running inside these images. See actions/cache#352 and actions/toolkit#634.

The coreutils package already in the image does not cover it — on Alpine, tar is its own package.

Changes

  • apk add tar — GNU tar.
  • apk add zstd — what actions/cache reaches for over gzip when it is present.
  • tar --version | grep -q 'GNU tar' added to the image smoke test, so a future base-image change cannot quietly drop it back to busybox.
  • docs/ci.md updated to say why tar is on the list, and corrected the image size to 67MB (measured from the published manifest — I had estimated ~120MB).

Why this is separate from the switch-over

ci-images.yml only pushes from main; on a pull request it builds without pushing. If this fix rode along with the ci.yml switch, that PR's jobs would still pull the currently published tar-less images and fail. Merging this first republishes all four tags via the existing paths trigger — no manual dispatch needed — and then step 2 has something that works to run against.

Verification so far

Run 560 published all four tags after REGISTRY_TOKEN was added. Checked independently of the workflow:

  • Anonymous pull works — /v2/token issues a token with no credentials and the manifest returns 200, so the consuming jobs need no credentials: block.
  • Platform is linux/arm64 only, as intended.
  • 66.6MB compressed across 13 layers.

Tests

No PHP source touched, so composer test / lint / cs are unaffected — the tree is identical to the one that passed at 966 tests on #188. The real check is this PR's ci-images.yml run, which rebuilds all four images with the new smoke test.

No CHANGELOG.md entry: CI tooling only.

Caught while staging step 2 of #187, before it could fail on `main`. `actions/cache` does not use a tar library — it shells out to `tar --posix -P …`. Alpine's busybox tar rejects both flags (`unrecognized option: posix`), so the `Cache Composer packages` step fails in any job running inside these images. See [actions/cache#352](https://github.com/actions/cache/issues/352) and [actions/toolkit#634](https://github.com/actions/toolkit/issues/634). The `coreutils` package already in the image does not cover it — on Alpine, `tar` is its own package. ## Changes - `apk add tar` — GNU tar. - `apk add zstd` — what `actions/cache` reaches for over gzip when it is present. - `tar --version | grep -q 'GNU tar'` added to the image smoke test, so a future base-image change cannot quietly drop it back to busybox. - `docs/ci.md` updated to say why tar is on the list, and corrected the image size to 67MB (measured from the published manifest — I had estimated ~120MB). ## Why this is separate from the switch-over `ci-images.yml` only pushes from `main`; on a pull request it builds without pushing. If this fix rode along with the `ci.yml` switch, that PR's jobs would still pull the currently published tar-less images and fail. Merging this first republishes all four tags via the existing `paths` trigger — no manual dispatch needed — and then step 2 has something that works to run against. ## Verification so far Run 560 published all four tags after `REGISTRY_TOKEN` was added. Checked independently of the workflow: - Anonymous pull works — `/v2/token` issues a token with no credentials and the manifest returns 200, so the consuming jobs need no `credentials:` block. - Platform is `linux/arm64` only, as intended. - 66.6MB compressed across 13 layers. ## Tests No PHP source touched, so `composer test` / `lint` / `cs` are unaffected — the tree is identical to the one that passed at 966 tests on #188. The real check is this PR's `ci-images.yml` run, which rebuilds all four images with the new smoke test. No `CHANGELOG.md` entry: CI tooling only.
thatguygriff added 1 commit 2026-08-25 01:16:01 +00:00
Install GNU tar in the CI image so actions/cache works
CI Images / Build CI image (PHP 8.1) (pull_request) Successful in 48s
CI / Tests (PHP 8.1) (pull_request) Successful in 55s
CI Images / Build CI image (PHP 8.2) (pull_request) Successful in 1m46s
CI Images / Build CI image (PHP 8.3) (pull_request) Successful in 1m48s
CI Images / Build CI image (PHP 8.5) (pull_request) Successful in 2m26s
CI / No Debug Code (pull_request) Successful in 3s
CI / Tests (PHP 8.2) (pull_request) Successful in 53s
CI / Tests (PHP 8.3) (pull_request) Successful in 2m50s
CI / Tests (PHP 8.5) (pull_request) Successful in 2m58s
CI / Coding Standards & Static Analysis (pull_request) Failing after 17m18s
CI / Build Plugin Zip (pull_request) Skipped
28f586d207
actions/cache shells out to `tar --posix -P`. Alpine's busybox tar rejects
both flags, so the cache step would fail in every job that runs inside these
images — which is all of them once ci.yml switches over.

coreutils does not cover this: tar is its own Alpine package. Add it, add
zstd (which actions/cache prefers over gzip when present), and assert GNU
tar in the image's smoke test so a future base-image change cannot quietly
drop it again.

Part of #187

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01D9acV1mHktGAb1uyvNmrR2
thatguygriff merged commit 4bc8e80837 into main 2026-08-25 01:23:13 +00:00
thatguygriff deleted branch fix/187-ci-image-gnu-tar 2026-08-25 01:23:13 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Unsupervised/unsupervised-scheduler#190