Skip to content

Stop racing ourselves on the docker release artifacts#826

Merged
phinze merged 1 commit into
mainfrom
phinze/fix-docker-release-race
May 27, 2026
Merged

Stop racing ourselves on the docker release artifacts#826
phinze merged 1 commit into
mainfrom
phinze/fix-docker-release-race

Conversation

@phinze
Copy link
Copy Markdown
Contributor

@phinze phinze commented May 27, 2026

The release pipeline had this weird self-own where the docker build job would race against the upload-to-miren job that was, at that exact moment, publishing the artifacts the docker build was trying to download. Both jobs gate on [init, test, package] and run in parallel, and the upload pushes a .tar.gz and its .sha256 sidecar through a parallel worker pool. The small .sha256 finishes first, so for a 30-60 second window api.miren.cloud is serving the new hash next to the still-old tarball. The docker build's miren download release -g would predictably pull both and blow up on a checksum mismatch. Failure was at https://github.com/mirendev/runtime/actions/runs/26537880941.

The fun part: the docker job already has the tarball locally. The workflow extracts release-base-linux-${arch}.tar.gz into docker/artifacts/${TARGETARCH}/ before invoking buildx, and that's the exact same content the Dockerfile was turning around and re-downloading from miren.cloud. Pre-existing TODO in the Dockerfile even acknowledged the redundancy. So this just swaps the RUN miren download release -g for a COPY docker/artifacts/${TARGETARCH}/ /var/lib/miren/release/ and calls it a day.

Worth being honest about what this doesn't fix: the api.miren.cloud inconsistency is still real for end users running miren download release -g against mutable channels (main, latest) while a release is mid-publish. The window is narrow and a retry clears it, but the bug exists. Filed as MIR-1170 with a proposal for an OCI-style content-addressed asset layout that would close it for all consumers.

The docker build was running `miren download release -g`, which fetches
the base release tarball and its .sha256 sidecar from api.miren.cloud.
Trouble is, build-and-push-docker runs in parallel with upload-to-miren,
which is publishing those same files for the release we are currently
building. The small .sha256 lands on the server before the big .tar.gz
finishes, so the docker job downloads the new hash paired with the
still-old tarball and dies with a checksum mismatch. Every release
playing this game with itself.

We already have the tarball locally in the docker job (extracted into
docker/artifacts/${TARGETARCH}/), so swap the network download for a
plain COPY into /var/lib/miren/release/. No more dependency on the
publish job intermediate state.

This does not fix the underlying api.miren.cloud inconsistency window;
users running `miren download release -g` mid-release can still hit
it. Filed as MIR-1170 with a proposal for OCI-style content-addressed
asset layout that would close it for all consumers.
@phinze phinze requested a review from a team as a code owner May 27, 2026 21:55
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 27, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6c99854c-8e35-4e30-a570-dea0d07b8481

📥 Commits

Reviewing files that changed from the base of the PR and between 056803e and 20e8c3c.

📒 Files selected for processing (1)
  • docker/Dockerfile.miren

📝 Walkthrough

Walkthrough

The pull request modifies docker/Dockerfile.miren to change how the server runtime release components are included in the Docker image. Instead of downloading components at build time via miren download release -g, the build now copies pre-built artifacts from docker/artifacts/${TARGETARCH}/ into /var/lib/miren/release/. This eliminates build-time dependencies on external publishing jobs by using pre-staged architecture-specific artifacts.


Comment @coderabbitai help to get the list of available commands and usage tips.

@phinze phinze merged commit b61e06a into main May 27, 2026
17 checks passed
@phinze phinze deleted the phinze/fix-docker-release-race branch May 27, 2026 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants