Skip to content
Draft
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
64 changes: 64 additions & 0 deletions .github/workflows/docker-build-lite-celo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build Celo / OP Succinct Lite Docker Images

on:
pull_request:
branches:
- develop
push:
branches:
- develop
workflow_dispatch:

env:
REGISTRY_URL: us-west1-docker.pkg.dev/devopsre/dev-images/${{ github.event.repository.name }}

jobs:
build:
name: Build OP Succinct Lite Docker Images
runs-on:
- self-hosted
- org
- 8-cpu

permissions:
contents: read
id-token: write
security-events: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.sha }} # Check out the PR head, rather than the merge commit.

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Docker meta for proposer
id: meta-proposer
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_URL }}/proposer
tags: |
type=semver,pattern={{version}}
type=edge
type=sha
type=raw,value=latest

- name: Login at GCP Artifact Registry
uses: celo-org/reusable-workflows/.github/actions/auth-gcp-artifact-registry@v2.0
with:
workload-id-provider: "projects/1094498259535/locations/global/workloadIdentityPools/gh-op-succinct-dev/providers/github-by-repos"
service-account: "op-succinct-gh-dev@devopsre.iam.gserviceaccount.com"
docker-gcp-registries: us-west1-docker.pkg.dev

- name: Build and push proposer
uses: docker/build-push-action@v6
with:
context: .
file: fault-proof/Dockerfile.proposer.celo
push: true
tags: ${{ steps.meta-proposer.outputs.tags }}
labels: ${{ steps.meta-proposer.outputs.labels }}
platforms: linux/amd64
cache-from: type=registry,ref=${{ env.REGISTRY_URL }}/proposer-buildcache:buildcache
cache-to: type=registry,mode=max,ref=${{ env.REGISTRY_URL }}/proposer-buildcache:buildcache
5 changes: 4 additions & 1 deletion fault-proof/Dockerfile.challenger.celo
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ WORKDIR /app
COPY . .

# Build the binary
RUN cargo build --release --bin challenger --features eigenda
RUN --mount=type=cache,target=/root/.cargo/registry \
--mount=type=cache,target=/root/.cargo/git \
--mount=type=cache,target=/app/target \
cargo build --release --bin challenger --features eigenda

# Runtime stage
FROM rust:1.89.0-trixie
Expand Down
12 changes: 10 additions & 2 deletions fault-proof/Dockerfile.proposer.celo
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

FROM rust:1.89.0-trixie AS base

RUN echo $CARGO_HOME

WORKDIR /app

# Install required dependencies
Expand All @@ -19,14 +21,20 @@ RUN curl -L https://sp1.succinct.xyz | bash && \
~/.sp1/bin/sp1up && \
~/.sp1/bin/cargo-prove prove --version

COPY rust-toolchain.toml .
RUN rustup show

FROM base AS builder

WORKDIR /app
COPY . .

# Build the binary
RUN cargo build --release --bin proposer --features eigenda
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
--mount=type=cache,target=/app/target \
cargo build --release --bin proposer --features eigenda && \
cp target/release/proposer /app/proposer # We need to copy the binary out of the cache so that it can be referenced by the next stage.

# Runtime stage
FROM rust:1.89.0-trixie
Expand All @@ -35,7 +43,7 @@ WORKDIR /app
COPY resources/ ./resources/

# Copy the built proposer binary
COPY --from=builder /app/target/release/proposer /usr/local/bin/
COPY --from=builder /app/proposer /usr/local/bin/

# Set the command
CMD ["proposer"]
76 changes: 76 additions & 0 deletions scripts/utils/Dockerfile.game-monitor
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# syntax=docker/dockerfile:1.4

# Base stage: Install Rust and dependencies
FROM ubuntu:24.04 AS rust-base

WORKDIR /app

# Install required dependencies
RUN apt-get update && apt-get install -y \
curl \
clang \
build-essential \
git \
pkg-config \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*

# Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH=/root/.cargo/bin:$PATH
RUN rustup install stable && rustup default stable

# Install SP1
RUN curl -L https://sp1.succinct.xyz | bash && \
~/.sp1/bin/sp1up -v v5.2.2 && \
~/.sp1/bin/cargo-prove prove --version

# Copy toolchain file
COPY rust-toolchain.toml .
# This installs the nightly version from the file
RUN rustup show

# Build stage
FROM rust-base AS builder

# Copy the entire workspace
COPY . .

# Build the cost-estimator
RUN --mount=type=cache,target=/root/.cargo/registry \
--mount=type=cache,target=/root/.cargo/git \
--mount=type=cache,target=/app/target \
cargo build --release --bin cost-estimator --features eigenda
# Build the game-monitor
# RUN --mount=type=cache,target=/root/.cargo/registry \
# --mount=type=cache,target=/root/.cargo/git \
# --mount=type=cache,target=/app/target \
# cargo build --release --bin game-monitor

# Runtime stage (minimal image)
FROM ubuntu:24.04

WORKDIR /app

# Install only necessary runtime dependencies
RUN apt-get update && apt-get install -y \
curl \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*

# Install Rust (needed by calls to cargo_metadata::MetadataCommand)
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH=/root/.cargo/bin:$PATH
RUN rustup install stable && rustup default stable

# Copy toolchain file
COPY rust-toolchain.toml .
# This installs the nightly version from the file
RUN rustup show

# Copy the built binaries
COPY --from=builder /app/target/release/cost-estimator /usr/local/bin/
COPY --from=builder /app/target/release/game-monitor /usr/local/bin/

# Copy the entire workspace so we can run cargo_metadata::MetadataCommand to get the workspace root.
COPY . .
Loading