feat(ci): publish a Polymarket-only evidence compiler image - #180
Conversation
📝 WalkthroughWalkthroughAdds a multi-stage Polymarket evidence compiler image, CI validation, ACR target selection, OCI revision labeling, digest verification, and control-plane checks excluding the Binance archiver binary. ChangesEvidence compiler image
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related issues
Possibly related PRs
Sequence Diagram(s)sequenceDiagram
participant GitHubActions
participant EvidenceCompilerDockerfile
participant ACR
participant ControlPlaneChecks
GitHubActions->>EvidenceCompilerDockerfile: build image with github.sha revision label
EvidenceCompilerDockerfile-->>GitHubActions: runtime image
GitHubActions->>ACR: publish image
ACR-->>GitHubActions: image digest
GitHubActions->>ACR: pull image by digest
ACR-->>GitHubActions: revision metadata
GitHubActions->>ControlPlaneChecks: validate bindings and excluded binary
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| contents: read | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)
351-368: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winEnable GitHub Actions caching to accelerate Rust compilation.
Currently, the manual
docker buildcommand compiles the Rust dependencies from scratch on every run because the ephemeral runner loses the local builder cache. Since this is a compute-heavy task, consider adoptingdocker/build-push-actionwithtype=ghacache mounts to drastically speed up subsequent CI runs.By setting
load: true, the built image remains locally available for the subsequent inspection steps.♻️ Proposed refactor to enable GHA caching
- - name: Build and inspect Polymarket evidence compiler image - run: | - image=polymarket-evidence-compiler:${{ github.sha }} - docker build \ - --file rust_hft/deployment/docker/Dockerfile.polymarket-evidence-compiler \ - --tag "$image" \ - --label "org.opencontainers.image.revision=${{ github.sha }}" \ - rust_hft + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v4 + + - name: Build Polymarket evidence compiler image + uses: docker/build-push-action@v7 + with: + context: rust_hft + file: rust_hft/deployment/docker/Dockerfile.polymarket-evidence-compiler + load: true + tags: polymarket-evidence-compiler:${{ github.sha }} + labels: | + org.opencontainers.image.revision=${{ github.sha }} + cache-from: type=gha,scope=polymarket-evidence-compiler + cache-to: type=gha,mode=max,scope=polymarket-evidence-compiler + + - name: Inspect Polymarket evidence compiler image + run: | + image=polymarket-evidence-compiler:${{ github.sha }} docker run --rm --entrypoint /usr/local/bin/polymarket-raw-ops "$image" \ publish-polymarket-evidence --help >/dev/null docker run --rm --entrypoint /usr/local/bin/aliyun "$image" version >/dev/null docker run --rm --entrypoint /bin/sh "$image" -ec \ 'test ! -e /usr/local/bin/binance-lob-archiver' actual_source_revision=$(docker image inspect \ --format '{{ index .Config.Labels "org.opencontainers.image.revision" }}' \ "$image") test "$actual_source_revision" = "${{ github.sha }}"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/ci.yml around lines 351 - 368, Replace the manual docker build in the “Build and inspect Polymarket evidence compiler image” step with docker/build-push-action, preserving the existing Dockerfile, image tag, revision label, and rust_hft context. Configure GitHub Actions cache import/export with type=gha and set load=true so the subsequent docker run and docker image inspect commands continue using the locally loaded image.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.github/workflows/ci.yml:
- Around line 351-368: Replace the manual docker build in the “Build and inspect
Polymarket evidence compiler image” step with docker/build-push-action,
preserving the existing Dockerfile, image tag, revision label, and rust_hft
context. Configure GitHub Actions cache import/export with type=gha and set
load=true so the subsequent docker run and docker image inspect commands
continue using the locally loaded image.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 1530ad75-a1e4-4db5-a285-875f645e7859
📒 Files selected for processing (4)
.github/workflows/acr-publish.yml.github/workflows/ci.ymldeployment/aliyun/test-polymarket-raw-ops-control-plane.shrust_hft/deployment/docker/Dockerfile.polymarket-evidence-compiler
Change contract
Publish a
polymarket-evidence-compilerOCI target whose runtime contains onlypolymarket-raw-opsand the OSS client. Bind its immutable digest to the GitHub source revision with an OCI label and a digest-pull verification.Acceptance evidence
deployment/aliyun/test-polymarket-raw-ops-control-plane.shfirst failed before the target existed, then passes.shellcheck deployment/aliyun/test-polymarket-raw-ops-control-plane.shpasses.git diff --checkpass.polymarket-raw-opsandaliyun, rejects a bundledbinance-lob-archiver, and checks the OCI source-revision label.Out of scope
No collector deployment/cutover, raw OSS mutation, evidence normalization, cohort/snapshot/evaluator work, or Binance LOB behavior change.
Dependency / merge order
Implements #179 from PRD #178. Must merge before issue #173 creates its one-shot Polymarket evidence compile Job. No stacked base PR.
Rollout / rollback impact
The target publishes an unused immutable image only. #173 will explicitly pin a digest after this PR merges. Rollback is to select no new image; production collectors remain untouched.
Summary by CodeRabbit
New Features
CI/CD