Skip to content
Merged
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
4 changes: 4 additions & 0 deletions .github/workflows/acr-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,8 @@ jobs:
--format '{{ index .Config.Labels "org.opencontainers.image.revision" }}' \
"$IMAGE")
test "$actual_source_revision" = "$SOURCE_REVISION"
docker run --rm --entrypoint /usr/local/bin/polymarket-raw-ops "$IMAGE" \
--version | grep -Fqx "polymarket-raw-ops $SOURCE_REVISION"

- name: Verify Polymarket market recorder image
if: matrix.repository == 'polymarket-market-recorder'
Expand Down Expand Up @@ -425,6 +427,8 @@ jobs:
chmod 0755 artifact/binance-usdm-reference-artifact-verifier
artifact/binance-lob-archiver --version \
| grep -Fqx 'binance-lob-archiver ${{ needs.selector.outputs.source_sha }}'
artifact/polymarket-raw-ops --version \
| grep -Fqx 'polymarket-raw-ops ${{ needs.selector.outputs.source_sha }}'
(
cd artifact
sha256sum binance-lob-archiver | tee binance-lob-archiver.sha256
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -434,12 +434,15 @@ jobs:
run: |
image=polymarket-evidence-compiler:${{ github.sha }}
docker build \
--build-arg "SOURCE_REVISION=${{ github.sha }}" \
--file rust_hft/deployment/docker/Dockerfile.polymarket-evidence-compiler \
--tag "$image" \
--label "org.opencontainers.image.revision=${{ github.sha }}" \
rust_hft
docker run --rm --entrypoint /usr/local/bin/polymarket-raw-ops "$image" \
publish-polymarket-evidence --help >/dev/null
docker run --rm --entrypoint /usr/local/bin/polymarket-raw-ops "$image" \
--version | grep -Fqx "polymarket-raw-ops ${{ github.sha }}"
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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
FROM rust:1.91-bullseye AS builder

WORKDIR /work
ARG SOURCE_REVISION
RUN apt-get update && apt-get install -y --no-install-recommends \
clang \
cmake \
Expand All @@ -13,7 +14,8 @@ COPY . .
RUN --mount=type=cache,target=/usr/local/cargo/registry,sharing=locked \
--mount=type=cache,target=/usr/local/cargo/git,sharing=locked \
--mount=type=cache,target=/work/target,sharing=locked \
cargo --config 'build.rustc-wrapper=""' build \
printf '%s\n' "$SOURCE_REVISION" | grep -Eq '^[0-9a-f]{40}$' \
&& MONDAY_SOURCE_REVISION="$SOURCE_REVISION" cargo --config 'build.rustc-wrapper=""' build \
--release \
--locked \
--no-default-features \
Expand Down
13 changes: 13 additions & 0 deletions rust_hft/tools/collector/src/bin/polymarket-raw-ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,15 @@ use std::fs;
use std::path::PathBuf;
use std::time::Duration;

const BUILD_SOURCE_REVISION: &str = match option_env!("MONDAY_SOURCE_REVISION") {
Some(revision) => revision,
None => "unbound-source-revision",
Comment thread
proerror77 marked this conversation as resolved.
};

#[derive(Debug, Parser)]
#[command(
name = "polymarket-raw-ops",
version = BUILD_SOURCE_REVISION,
about = "Fail-closed Polymarket reference collection and raw tape archival"
)]
struct Cli {
Expand Down Expand Up @@ -350,6 +356,13 @@ async fn main() -> Result<()> {
#[cfg(test)]
mod tests {
use super::*;
use clap::CommandFactory;

#[test]
fn cli_version_is_bound_to_the_build_source_revision() {
let expected = option_env!("MONDAY_SOURCE_REVISION").unwrap_or("unbound-source-revision");
assert_eq!(Cli::command().get_version(), Some(expected));
}

#[test]
fn collect_reference_cli_uses_the_library_discovery_capacity_default() {
Expand Down
Loading