Skip to content

Commit

Permalink
feat(docker): Update asterisc reproducible build image
Browse files Browse the repository at this point in the history
  • Loading branch information
clabby committed Oct 22, 2024
1 parent 4e07ad2 commit e3e7535
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
10 changes: 5 additions & 5 deletions build/asterisc/asterisc-repro.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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` #
################################################################
Expand All @@ -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
Expand All @@ -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}"

Expand Down Expand Up @@ -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 .
Expand Down
19 changes: 18 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand All @@ -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
Expand Down

0 comments on commit e3e7535

Please sign in to comment.