Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(build): FPVM targets #845

Closed
wants to merge 3 commits into from
Closed
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
2 changes: 1 addition & 1 deletion .github/workflows/cross_docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
packages: write
strategy:
matrix:
target: ["cannon", "asterisc"]
target: ["mips32", "riscv64g"]
env:
IMAGE_NAME: ${{ github.repository }}/${{ matrix.target }}-builder
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/kona_fpp_docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
packages: write
strategy:
matrix:
fpvm: ["asterisc"]
fpvm: ["riscv64g"]
env:
IMAGE_NAME: ${{ github.repository }}/kona-fpp-${{ matrix.fpvm }}
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/rust_ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
timeout-minutes: 20
strategy:
matrix:
target: ["native", "cannon", "asterisc"]
target: ["native", "mips32", "riscv64g"]
name: lint-${{ matrix.target }}
steps:
- name: Checkout sources
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
timeout-minutes: 20
strategy:
matrix:
target: ["native", "cannon", "asterisc"]
target: ["native", "mips32", "riscv64g"]
name: build-${{ matrix.target }}
continue-on-error: true
steps:
Expand Down
6 changes: 3 additions & 3 deletions bin/client/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ run-client-asterisc block_number l1_rpc l1_beacon_rpc l2_rpc rollup_node_rpc ver
OP_NODE_ADDRESS="{{rollup_node_rpc}}"

HOST_BIN_PATH="./target/release/kona-host"
CLIENT_BIN_PATH="./target/riscv64gc-unknown-none-elf/release-client-lto/kona"
CLIENT_BIN_PATH="./target/riscv64g-unknown-none-elf/release-client-lto/kona"
STATE_PATH="./state.bin.gz"

CLAIMED_L2_BLOCK_NUMBER={{block_number}}
Expand All @@ -34,7 +34,7 @@ run-client-asterisc block_number l1_rpc l1_beacon_rpc l2_rpc rollup_node_rpc ver
cd $(git rev-parse --show-toplevel)

echo "Building client program for RISC-V target..."
just build-asterisc --bin kona --profile release-client-lto
just build-riscv64g --bin kona --profile release-client-lto

echo "Loading client program into Asterisc state format..."
asterisc load-elf --path=$CLIENT_BIN_PATH
Expand Down Expand Up @@ -147,7 +147,7 @@ run-client-asterisc-offline block_number l2_claim l2_output_root l2_head l1_head
cd $(git rev-parse --show-toplevel)

echo "Building client program for RISC-V target..."
just build-asterisc --bin kona --profile release-client-lto
just build-riscv64g --bin kona --profile release-client-lto

echo "Loading client program into Asterisc state format..."
asterisc load-elf --path=$CLIENT_BIN_PATH
Expand Down
14 changes: 7 additions & 7 deletions build/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ set fallback := true
default:
@just --list

all: cannon asterisc
all: mips32 riscv64g

# Build the `cannon` program builder image
cannon:
docker build -t cannon-pipeline:latest -f cannon/cannon.dockerfile ./cannon
# Build the `mips32` program builder image
mips32:
docker build -t mips32-pipeline:latest -f mips32/mips32.dockerfile ./mips32

# Build the `asterisc` program builder image
asterisc:
docker build -t asterisc-pipeline:latest -f asterisc/asterisc.dockerfile ./asterisc
# Build the `riscv64g` program builder image
riscv64g:
docker build -t riscv64g-pipeline:latest -f riscv64g/riscv64g.dockerfile ./riscv64g
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ 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 --exclude kona-derive-alloy && \
cargo build -Zbuild-std=core,alloc --workspace --bin kona --locked --profile release-client-lto --exclude kona-host && \
mv ./target/riscv64gc-unknown-none-elf/release-client-lto/kona /kona-client-elf

################################################################
Expand Down
24 changes: 12 additions & 12 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ clean-actions:
rm -rf monorepo/

# Lint the workspace for all available targets
lint-all: lint-native lint-cannon lint-asterisc lint-docs
lint-all: lint-native lint-mips32 lint-riscv64g lint-docs

# Runs `cargo hack check` against the workspace
hack:
Expand All @@ -67,22 +67,22 @@ lint-native: fmt-native-check lint-docs
cargo +nightly clippy --workspace --all --all-features --all-targets -- -D warnings

# Lint the workspace (mips arch). Currently, only the `kona-std-fpvm` crate is linted for the `cannon` target, as it is the only crate with architecture-specific code.
lint-cannon:
lint-mips32:
docker run \
--rm \
--platform linux/amd64 \
-v `pwd`/:/workdir \
-w="/workdir" \
ghcr.io/anton-rs/kona/cannon-builder:main cargo +nightly clippy -p kona-std-fpvm --all-features --target /mips-unknown-none.json -Zbuild-std=core,alloc -- -D warnings
ghcr.io/anton-rs/kona/mips32-builder:main cargo +nightly clippy -p kona-std-fpvm --all-features --target /mips-unknown-none.json -Zbuild-std=core,alloc -- -D warnings

# Lint the workspace (risc-v arch). Currently, only the `kona-std-fpvm` crate is linted for the `asterisc` target, as it is the only crate with architecture-specific code.
lint-asterisc:
lint-riscv64g:
docker run \
--rm \
--platform linux/amd64 \
-v `pwd`/:/workdir \
-w="/workdir" \
ghcr.io/anton-rs/kona/asterisc-builder:main cargo +nightly clippy -p kona-std-fpvm --all-features --target riscv64gc-unknown-linux-gnu -Zbuild-std=core,alloc -- -D warnings
ghcr.io/anton-rs/kona/riscv64g-builder:main cargo +nightly clippy -p kona-std-fpvm --all-features --target riscv64gc-unknown-linux-gnu -Zbuild-std=core,alloc -- -D warnings

# Lint the Rust documentation
lint-docs:
Expand All @@ -93,34 +93,34 @@ test-docs:
cargo test --doc --all --locked

# Build the workspace for all available targets
build: build-native build-cannon build-asterisc
build: build-native build-mips32 build-riscv64g

# Build for the native target
build-native *args='':
cargo build --workspace $@

# Build for the `cannon` target. Any crates that require the stdlib are excluded from the build for this target.
build-cannon *args='':
build-mips32 *args='':
docker run \
--rm \
--platform linux/amd64 \
-v `pwd`/:/workdir \
-w="/workdir" \
ghcr.io/anton-rs/kona/cannon-builder:main cargo build --workspace -Zbuild-std=core,alloc $@ --exclude kona-host
ghcr.io/anton-rs/kona/mips32-builder:main cargo build --workspace -Zbuild-std=core,alloc $@ --exclude kona-host

# Build for the `asterisc` target. Any crates that require the stdlib are excluded from the build for this target.
build-asterisc *args='':
build-riscv64g *args='':
docker run \
--rm \
--platform linux/amd64 \
-v `pwd`/:/workdir \
-w="/workdir" \
ghcr.io/anton-rs/kona/asterisc-builder:main cargo build --workspace -Zbuild-std=core,alloc $@ --exclude kona-host
ghcr.io/anton-rs/kona/riscv64g-builder:main cargo build --workspace -Zbuild-std=core,alloc $@ --exclude kona-host

# Build the `kona-client` prestate artifacts for the latest release.
build-client-prestate-asterisc-artifacts kona_tag asterisc_tag out='./prestate-artifacts-asterisc':
#!/bin/bash
PATH_TO_REPRO_BUILDER=./build/asterisc/asterisc-repro.dockerfile
PATH_TO_REPRO_BUILDER=./build/riscv64g/riscv64g-repro.dockerfile
OUTPUT_DIR={{out}}

echo "Building kona-client prestate artifacts for the asterisc target. 🐚 Kona Tag: {{kona_tag}} | 🎇 Asterisc Tag: {{asterisc_tag}}"
Expand All @@ -136,7 +136,7 @@ build-client-prestate-asterisc-artifacts kona_tag asterisc_tag out='./prestate-a
# 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
PATH_TO_REPRO_BUILDER=./build/riscv64g/riscv64g-repro.dockerfile
OUTPUT_DIR={{out}}

echo "Building kona-client prestate artifacts for the asterisc target. 🐚 Kona Tag: {{kona_tag}} | 🎇 Asterisc Tag: {{asterisc_tag}}"
Expand Down
Loading