Commit c36de049 authored by refcell's avatar refcell Committed by GitHub

chore(ops): Support kona + asterisc in the op-challenger (#13198)

* chore(ops): add support for the op-challenger to run kona + asterisc

* fix: update docker bake

* fixes
parent 4ce84f1b
...@@ -6,6 +6,10 @@ variable "REPOSITORY" { ...@@ -6,6 +6,10 @@ variable "REPOSITORY" {
default = "oplabs-tools-artifacts/images" default = "oplabs-tools-artifacts/images"
} }
variable "KONA_VERSION" {
default = "kona-client-v0.1.0-beta.4"
}
variable "GIT_COMMIT" { variable "GIT_COMMIT" {
default = "dev" default = "dev"
} }
...@@ -119,6 +123,7 @@ target "op-challenger" { ...@@ -119,6 +123,7 @@ target "op-challenger" {
GIT_COMMIT = "${GIT_COMMIT}" GIT_COMMIT = "${GIT_COMMIT}"
GIT_DATE = "${GIT_DATE}" GIT_DATE = "${GIT_DATE}"
OP_CHALLENGER_VERSION = "${OP_CHALLENGER_VERSION}" OP_CHALLENGER_VERSION = "${OP_CHALLENGER_VERSION}"
KONA_VERSION="${KONA_VERSION}"
} }
target = "op-challenger-target" target = "op-challenger-target"
platforms = split(",", PLATFORMS) platforms = split(",", PLATFORMS)
...@@ -207,7 +212,7 @@ target "proofs-tools" { ...@@ -207,7 +212,7 @@ target "proofs-tools" {
context = "." context = "."
args = { args = {
CHALLENGER_VERSION="b46bffed42db3442d7484f089278d59f51503049" CHALLENGER_VERSION="b46bffed42db3442d7484f089278d59f51503049"
KONA_VERSION="kona-client-v0.1.0-beta.4" KONA_VERSION="${KONA_VERSION}"
} }
target="proofs-tools" target="proofs-tools"
platforms = split(",", PLATFORMS) platforms = split(",", PLATFORMS)
......
...@@ -9,6 +9,13 @@ ...@@ -9,6 +9,13 @@
# It will default to the target platform. # It will default to the target platform.
ARG TARGET_BASE_IMAGE=alpine:3.20 ARG TARGET_BASE_IMAGE=alpine:3.20
# The ubuntu target base image is used for the op-challenger build with kona and asterisc.
ARG UBUNTU_TARGET_BASE_IMAGE=ubuntu:22.04
# The version of kona to use.
# The only build that uses this is `op-challenger-target`.
ARG KONA_VERSION=none
# We may be cross-building for another platform. Specify which platform we need as builder. # We may be cross-building for another platform. Specify which platform we need as builder.
FROM --platform=$BUILDPLATFORM golang:1.22.7-alpine3.20 AS builder FROM --platform=$BUILDPLATFORM golang:1.22.7-alpine3.20 AS builder
...@@ -136,14 +143,23 @@ FROM --platform=$TARGETPLATFORM $TARGET_BASE_IMAGE AS op-node-target ...@@ -136,14 +143,23 @@ FROM --platform=$TARGETPLATFORM $TARGET_BASE_IMAGE AS op-node-target
COPY --from=op-node-builder /app/op-node/bin/op-node /usr/local/bin/ COPY --from=op-node-builder /app/op-node/bin/op-node /usr/local/bin/
CMD ["op-node"] CMD ["op-node"]
FROM --platform=$TARGETPLATFORM $TARGET_BASE_IMAGE AS op-challenger-target # Make the kona docker image published by upstream available as a source to copy kona and asterisc from.
FROM --platform=$BUILDPLATFORM ghcr.io/anton-rs/kona/kona-fpp-asterisc:$KONA_VERSION AS kona
# Also produce an op-challenger loaded with kona and asterisc using ubuntu
FROM --platform=$TARGETPLATFORM $UBUNTU_TARGET_BASE_IMAGE AS op-challenger-target
RUN apt-get update && apt-get install -y --no-install-recommends musl openssl ca-certificates
COPY --from=op-challenger-builder /app/op-challenger/bin/op-challenger /usr/local/bin/ COPY --from=op-challenger-builder /app/op-challenger/bin/op-challenger /usr/local/bin/
# Make the bundled op-program the default cannon server # Copy in op-program and cannon
COPY --from=op-program-builder /app/op-program/bin/op-program /usr/local/bin/ COPY --from=op-program-builder /app/op-program/bin/op-program /usr/local/bin/
ENV OP_CHALLENGER_CANNON_SERVER /usr/local/bin/op-program ENV OP_CHALLENGER_CANNON_SERVER /usr/local/bin/op-program
# Make the bundled cannon the default cannon executable
COPY --from=cannon-builder /app/cannon/bin/cannon /usr/local/bin/ COPY --from=cannon-builder /app/cannon/bin/cannon /usr/local/bin/
ENV OP_CHALLENGER_CANNON_BIN /usr/local/bin/cannon ENV OP_CHALLENGER_CANNON_BIN /usr/local/bin/cannon
# Copy in kona and asterisc
COPY --from=kona /kona-host /usr/local/bin/
ENV OP_CHALLENGER_ASTERISC_KONA_SERVER=/usr/local/bin/kona-host
COPY --from=kona /asterisc /usr/local/bin/
ENV OP_CHALLENGER_ASTERISC_BIN=/usr/local/bin/asterisc
CMD ["op-challenger"] CMD ["op-challenger"]
FROM --platform=$TARGETPLATFORM $TARGET_BASE_IMAGE AS op-dispute-mon-target FROM --platform=$TARGETPLATFORM $TARGET_BASE_IMAGE AS op-dispute-mon-target
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment