From e3e7535604aa28172d7e3020dab5d17f17b85d63 Mon Sep 17 00:00:00 2001 From: clabby Date: Tue, 22 Oct 2024 13:15:26 -0400 Subject: [PATCH] feat(docker): Update asterisc reproducible build image --- build/asterisc/asterisc-repro.dockerfile | 10 +++++----- justfile | 19 ++++++++++++++++++- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/build/asterisc/asterisc-repro.dockerfile b/build/asterisc/asterisc-repro.dockerfile index 19527d7c0..fcca28554 100644 --- a/build/asterisc/asterisc-repro.dockerfile +++ b/build/asterisc/asterisc-repro.dockerfile @@ -24,7 +24,7 @@ RUN git clone https://github.com/ethereum-optimism/asterisc && \ git checkout $ASTERISC_TAG && \ make && \ cp rvgo/bin/asterisc /asterisc-bin - + ################################################################ # Build kona-client @ `CLIENT_TAG` # ################################################################ @@ -46,14 +46,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends git # Build kona-client on the selected tag RUN git checkout $CLIENT_TAG && \ - cargo build -Zbuild-std=core,alloc --workspace --bin kona --locked --profile release-client-lto --exclude kona-host && \ + cargo build -Zbuild-std=core,alloc --workspace --bin kona --locked --profile release-client-lto --exclude kona-host --exclude kona-derive-alloy && \ mv ./target/riscv64gc-unknown-none-elf/release-client-lto/kona /kona-client-elf ################################################################ # Build kona-host @ `CLIENT_TAG` # ################################################################ -FROM ubuntu:22.04 AS host-build +FROM ubuntu:22.04 AS host-build SHELL ["/bin/bash", "-c"] ARG CLIENT_TAG @@ -76,7 +76,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ pkg-config # Install rust -ENV RUST_VERSION=1.80.0 +ENV RUST_VERSION=1.81.0 RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain ${RUST_VERSION} --component rust-src ENV PATH="/root/.cargo/bin:${PATH}" @@ -123,7 +123,7 @@ RUN $ASTERISC_BIN_PATH run \ # Export Artifacts # ################################################################ -FROM scratch AS export-stage +FROM ubuntu:22.04 AS export-stage COPY --from=prestate-build /asterisc . COPY --from=prestate-build /kona-client-elf . diff --git a/justfile b/justfile index fc04c49df..3f2fce054 100644 --- a/justfile +++ b/justfile @@ -119,7 +119,7 @@ build-asterisc *args='': ghcr.io/anton-rs/kona/asterisc-builder:main cargo build --workspace -Zbuild-std=core,alloc $@ --exclude kona-host --exclude kona-derive-alloy # Build the `kona-client` prestate artifacts for the latest release. -build-client-prestate-asterisc kona_tag asterisc_tag out='./prestate-artifacts-asterisc': +build-client-prestate-asterisc-artifacts kona_tag asterisc_tag out='./prestate-artifacts-asterisc': #!/bin/bash PATH_TO_REPRO_BUILDER=./build/asterisc/asterisc-repro.dockerfile OUTPUT_DIR={{out}} @@ -132,6 +132,23 @@ build-client-prestate-asterisc kona_tag asterisc_tag out='./prestate-artifacts-a --build-arg ASTERISC_TAG={{asterisc_tag}} \ --platform linux/amd64 \ . + +# Build the `kona-client` prestate artifacts for the latest release, with an image containing the resulting +# binaries. +build-client-prestate-asterisc-image kona_tag asterisc_tag out='./prestate-artifacts-asterisc': + #!/bin/bash + PATH_TO_REPRO_BUILDER=./build/asterisc/asterisc-repro.dockerfile + OUTPUT_DIR={{out}} + + echo "Building kona-client prestate artifacts for the asterisc target. 🐚 Kona Tag: {{kona_tag}} | 🎇 Asterisc Tag: {{asterisc_tag}}" + docker build \ + -f $PATH_TO_REPRO_BUILDER \ + -t kona-fpp-asterisc:latest \ + --build-arg CLIENT_TAG={{kona_tag}} \ + --build-arg ASTERISC_TAG={{asterisc_tag}} \ + --platform linux/amd64 \ + . + # Clones and checks out the monorepo at the commit present in `.monorepo` monorepo: [ ! -d monorepo ] && git clone https://github.com/ethereum-optimism/monorepo