Skip to content

feat(ci): publish a Polymarket-only evidence compiler image - #180

Merged
proerror77 merged 1 commit into
mainfrom
codex/polymarket-evidence-compiler
Jul 20, 2026
Merged

feat(ci): publish a Polymarket-only evidence compiler image#180
proerror77 merged 1 commit into
mainfrom
codex/polymarket-evidence-compiler

Conversation

@proerror77

@proerror77 proerror77 commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Change contract

Publish a polymarket-evidence-compiler OCI target whose runtime contains only polymarket-raw-ops and 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.sh first failed before the target existed, then passes.
  • shellcheck deployment/aliyun/test-polymarket-raw-ops-control-plane.sh passes.
  • YAML parsing and git diff --check pass.
  • New cloud CI builds the image, confirms polymarket-raw-ops and aliyun, rejects a bundled binance-lob-archiver, and checks the OCI source-revision label.
  • Matt code review: Standards 0 findings; Spec 0 findings after source-binding amendment.

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

    • Added a dedicated Docker image for compiling Polymarket evidence.
    • Included the Aliyun CLI with architecture-aware installation and checksum verification.
    • Configured the image to run securely as a non-root user with a minimal runtime environment.
  • CI/CD

    • Added automated image builds, publishing, entrypoint checks, and revision-label verification.
    • Added validation to ensure the image excludes unrelated binaries and remains correctly bound to the source revision.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds 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.

Changes

Evidence compiler image

Layer / File(s) Summary
Image definition and runtime assembly
rust_hft/deployment/docker/Dockerfile.polymarket-evidence-compiler
Builds polymarket-raw-ops, verifies the architecture-specific Aliyun CLI, and creates a non-root Debian runtime using tini.
CI image validation
.github/workflows/ci.yml
Builds the image, runs command checks, verifies the Binance binary is absent, and checks the OCI revision label.
ACR publication and contract checks
.github/workflows/acr-publish.yml, deployment/aliyun/test-polymarket-raw-ops-control-plane.sh
Adds the publish target, SHA-based OCI metadata, digest verification, Dockerfile binding checks, and Binance binary exclusion checks.

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
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: publishing a Polymarket-only evidence compiler image in CI.
Description check ✅ Passed The description covers the required contract, out-of-scope, dependencies, validation, and rollout sections, and omits scope exception appropriately.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/polymarket-evidence-compiler

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.

❤️ Share

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

Comment thread .github/workflows/ci.yml
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)

351-368: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Enable GitHub Actions caching to accelerate Rust compilation.

Currently, the manual docker build command 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 adopting docker/build-push-action with type=gha cache 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

📥 Commits

Reviewing files that changed from the base of the PR and between 0c47f21 and fb415a3.

📒 Files selected for processing (4)
  • .github/workflows/acr-publish.yml
  • .github/workflows/ci.yml
  • deployment/aliyun/test-polymarket-raw-ops-control-plane.sh
  • rust_hft/deployment/docker/Dockerfile.polymarket-evidence-compiler

@proerror77
proerror77 merged commit d47527a into main Jul 20, 2026
26 checks passed
@proerror77
proerror77 deleted the codex/polymarket-evidence-compiler branch July 20, 2026 15:16
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