Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 76 additions & 6 deletions .github/workflows/canary.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
name: Weekly canary

# Proactive platform/ecosystem drift detection — the class of breakage premerge CI (ubuntu +
# CPython 3.14 only) can't see. Two angles:
# CPython 3.14 only) can't see:
#
# 1. resolve-crossplatform (ubuntu, no mac/windows hardware needed): wheels-only dependency
# resolution for Intel macOS, Apple-silicon macOS, and Windows — against BOTH the repo's
# pyproject.toml (would the next release install?) and the latest published PyPI release
# (did an upstream dep pull its wheels out from under an already-shipped version?). This is
# exactly the check that would have caught cryptography 49 dropping its x86_64-macOS wheel.
# 2. install-smoke (real runners): install the published package with uv and import/run it on
# macos-latest (arm64), macos-15-intel (x86_64), and windows-latest.
# macos-latest (arm64), macos-15-intel (x86_64), and windows-latest, then install and start
# the newest release's .mcpb the way Claude Desktop launches it. The bundle installs from its
# own uv.lock on the user's machine, so it breaks differently from a fresh uvx resolve: a
# locked file pulled from PyPI, a locked version with no wheel for that platform or for a newer
# CPython, or a change in the host's uv.
# 3. image-smoke: pull and start both published images, :latest and :no-scout, and check each
# reports the newest release.
#
# On failure the notify job files (or comments on) a deduplicated issue labeled
# ci-failure + wf:canary — one open issue per stream, so four red Mondays make one thread.
#
# PRs into main also run the repo-pyproject resolution leg — the only part that exercises the
# PR's own changes — so a dependency edit that breaks a platform is caught before merge, not the
# following Monday. The published-package legs (PyPI-release resolution, install smokes) and the
# following Monday. The published-package legs (PyPI-release resolution, install and image smokes) and the
# issue filing stay schedule/dispatch-only: on a PR they would re-test the already-shipped
# release and could block a merge on breakage the PR didn't cause.

Expand Down Expand Up @@ -96,8 +102,9 @@ jobs:
if: github.event_name != 'pull_request'
name: Install smoke (${{ matrix.os }})
runs-on: ${{ matrix.os }}
# 20, not 15: macos-15-intel now source-builds cryptography (brew install + Rust compile).
timeout-minutes: 20
# 30: macos-15-intel source-builds cryptography (brew install + Rust compile), and may do so twice
# when the .mcpb's locked version differs from the one uvx resolves.
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -133,12 +140,75 @@ jobs:
# Requires the published package to have the --version flag (shipped in v1.9.3).
run: uvx --python 3.14 docker-mcp-server --version

- name: Download and verify the newest release's .mcpb
# Runs even when the uvx smoke failed, so a failure report says whether the bundle broke too.
if: ${{ !cancelled() }}
shell: bash
env:
GH_TOKEN: ${{ github.token }}
# No tag: gh downloads from the newest release, the one Claude Desktop users install.
run: |
set -euo pipefail
gh release download --repo "$GITHUB_REPOSITORY" --pattern 'docker-mcp-server-*.mcpb*' --dir mcpb
cd mcpb
# Whichever of sha256sum and shasum the runner has.
if command -v sha256sum >/dev/null; then sha256sum -c ./*.sha256; else shasum -a 256 -c ./*.sha256; fi

- name: Bundle smoke (.mcpb started as Claude Desktop starts it)
if: ${{ !cancelled() }}
shell: bash
# manifest.json's mcp_config runs `uv run --directory <bundle> mcpb_run.py`; this is that
# command, plus --version so it exits before any daemon contact. The version printed must
# be the bundle's own, or the resolve picked up something other than the bundle's source.
run: |
set -euo pipefail
bundle="$(ls mcpb/*.mcpb)"
expected="$(basename "$bundle" .mcpb)"; expected="${expected#docker-mcp-server-}"
uv run --no-project --python 3.14 python -m zipfile -e "$bundle" bundle
actual="$(uv run --directory bundle mcpb_run.py --version)"
# Windows' Python may end the line with a carriage return that $(...) keeps.
actual="${actual%$'\r'}"
echo "bundle $expected reports $actual"
if [ "$actual" != "$expected" ]; then
echo "::error::the $expected .mcpb started but reported version $actual"
exit 1
fi

image-smoke:
# Pulls and starts the published images, so it never exercises PR content.
if: github.event_name != 'pull_request'
name: Image smoke (${{ matrix.tag }})
runs-on: ubuntu-latest
# One image pull and a start that exits at once.
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
tag: [latest, no-scout]
steps:
- name: Pull and start the image
env:
TAG: ${{ matrix.tag }}
# Both moving tags must start and report the newest PyPI release: a tag left on an older
# build, or an image that no longer starts, is what this catches.
run: |
set -euo pipefail
latest="$(curl -fsSL --max-time 30 --retry 3 https://pypi.org/pypi/docker-mcp-server/json | jq -r .info.version)"
image="ghcr.io/l337-org/docker-mcp-server:$TAG"
docker pull --quiet "$image"
actual="$(docker run --rm "$image" --version)"
echo "$image reports $actual; newest PyPI release is $latest"
if [ "$actual" != "$latest" ]; then
echo "::error::$image reports version $actual, not the newest release $latest"
exit 1
fi

notify:
name: File failure issue
runs-on: ubuntu-latest
# Files or updates a single issue.
timeout-minutes: 10
needs: [resolve-crossplatform, install-smoke]
needs: [resolve-crossplatform, install-smoke, image-smoke]
# PR failures are visible on the PR itself; the issue stream is for unattended runs.
if: failure() && github.event_name != 'pull_request'
permissions:
Expand Down
8 changes: 7 additions & 1 deletion architecture/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,13 @@ macOS / ARM macOS / Windows against both the repo `pyproject.toml` and the lates
release (the check that would have caught cryptography 49 dropping its x86_64-macOS wheel), plus
real install smokes of the published package on `macos-latest`, `macos-15-intel` (Intel runner
label retires Aug 2027), and `windows-latest` - `import docker_mcp` and `uvx docker-mcp-server
--version`. **PRs into main also run the repo-pyproject resolution leg** (the only part that
--version` - followed on the same runners by the newest release's `.mcpb`, checked against its
`.sha256` and started with the command `manifest.json` gives Claude Desktop (`uv run --directory
<bundle> mcpb_run.py`, plus `--version`). The bundle installs from its own `uv.lock`, so it breaks
differently from a fresh `uvx` resolve: a locked file pulled from PyPI, a locked version with no
wheel for that platform or a newer CPython, or a change in the host's `uv`. An image smoke pulls
`:latest` and `:no-scout` from GHCR and runs each with `--version`, which must report the newest
PyPI release. **PRs into main also run the repo-pyproject resolution leg** (the only part that
exercises PR content), so a dependency change that breaks a platform is caught before merge; the
published-package legs and issue filing stay schedule/dispatch-only. Failures on unattended runs
file a deduplicated `ci-failure` + `wf:canary` issue via `.github/actions/file-failure-issue`,
Expand Down
Loading