-
Notifications
You must be signed in to change notification settings - Fork 108
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
E2E o1VM testing with cached artifacts. #2700
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
36c5603
Dockerfile and script to publish the image to the DockerHub.
shimkiv d2c97af
Scripts preparation.
shimkiv ac2dcc2
Revert Rust changes and update scripts once again.
shimkiv c94b0ae
Revert Rust changes and update scripts once again.
shimkiv 92f3daa
Readme update.
shimkiv c4282f4
CI changes.
shimkiv 5e021a2
Don't cancel o1vm CI.
shimkiv 5cea15d
Make o1vm the work dir.
shimkiv 7915f39
rpcs.sh
shimkiv 735c57f
Env config.
shimkiv 984d9a8
Override existing envars with the help of export?
shimkiv fa1f41b
Set full path for datadir.
shimkiv 42e01c5
Debug.
shimkiv b758314
Full backtrace.
shimkiv 58eb06b
Install Go, Foundry and build the OP program.
shimkiv b7dccca
o1vm CI fix.
shimkiv 524c24c
Some fixes.
shimkiv b99e320
Forgotten o1vm CI changes.
shimkiv 0f95ee2
CI adjustments before merging master back (with fixes).
shimkiv dd09438
Merge remote-tracking branch 'origin/master' into test/o1vm-e2e
shimkiv ad4bdf1
Run o1vm CI for o1vm changes only.
shimkiv 1b4c945
Addressing some review comments.
shimkiv a339d26
Addressing review comments.
shimkiv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
name: o1vm CI | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
paths: | ||
[ | ||
"o1vm/**", | ||
"folding/**", | ||
"groupmap/**", | ||
"kimchi/**", | ||
"msm/**", | ||
"curves/**", | ||
"poseidon/**", | ||
"poly-commitment/", | ||
"internal-tracing/**", | ||
"srs/**", | ||
"utils/**", | ||
] | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
[ | ||
"o1vm/**", | ||
"folding/**", | ||
"groupmap/**", | ||
"kimchi/**", | ||
"msm/**", | ||
"curves/**", | ||
"poseidon/**", | ||
"poly-commitment/", | ||
"internal-tracing/**", | ||
"srs/**", | ||
"utils/**", | ||
] | ||
|
||
env: | ||
# https://doc.rust-lang.org/cargo/reference/profiles.html#release | ||
# Disable for the time being since it fails with the "attempt to multiply with overflow" error. | ||
# Known issue yeat to be fixed. | ||
# RUSTFLAGS: -Coverflow-checks=y -Cdebug-assertions=y | ||
# https://doc.rust-lang.org/cargo/reference/profiles.html#incremental | ||
CARGO_INCREMENTAL: 1 | ||
# https://nexte.st/book/pre-built-binaries.html#using-nextest-in-github-actions | ||
CARGO_TERM_COLOR: always | ||
# 30 MB of stack for Keccak tests | ||
RUST_MIN_STACK: 31457280 | ||
|
||
jobs: | ||
run_o1vm_with_cached_data: | ||
name: Run o1vm with cached data | ||
# We run only one of the matrix options on the toffee `hetzner-1` self-hosted GitHub runner. | ||
# Only in this configuration we enable tests with the code coverage data gathering. | ||
runs-on: ["ubuntu-latest"] | ||
strategy: | ||
matrix: | ||
rust_toolchain_version: ["1.74"] | ||
# FIXME: currently not available for 5.0.0. | ||
# It might be related to boxroot dependency, and we would need to bump | ||
# up the ocaml-rs dependency | ||
ocaml_version: ["4.14"] | ||
services: | ||
o1vm-e2e-testing-cache: | ||
image: o1labs/proof-systems:o1vm-e2e-testing-cache | ||
volumes: | ||
- /tmp:/tmp/cache | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Use shared Rust toolchain setting up steps | ||
uses: ./.github/actions/toolchain-shared | ||
with: | ||
rust_toolchain_version: ${{ matrix.rust_toolchain_version }} | ||
|
||
- name: Apply the Rust smart cacheing | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Use shared OCaml setting up steps | ||
uses: ./.github/actions/ocaml-shared | ||
with: | ||
ocaml_version: ${{ matrix.ocaml_version }} | ||
|
||
- name: Install the Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.13" | ||
check-latest: true | ||
|
||
- name: Install the Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: "1.21.0" | ||
|
||
- name: Install the Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
|
||
- name: Build the OP program | ||
run: | | ||
cd o1vm | ||
make -C ./ethereum-optimism/op-program op-program | ||
cd .. | ||
|
||
- name: Start the local HTTP server | ||
run: | | ||
python -m http.server 8765 & | ||
|
||
# | ||
# Tests | ||
# | ||
|
||
- name: Execute o1vm in E2E flavor using cached data | ||
run: | | ||
eval $(opam env) | ||
cd o1vm | ||
unzip -q -o /tmp/o1vm-e2e-testing-cache.zip -d ./ | ||
RUN_WITH_CACHED_DATA="y" FILENAME="env-for-latest-l2-block.sh" O1VM_FLAVOR="pickles" STOP_AT="=3000000" ./run-code.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM alpine | ||
|
||
# Add necessary utilities | ||
RUN apk add --no-cache shadow unzip zip | ||
|
||
# Copy the files from the host to the Docker image | ||
# Assuming the files and folder are located | ||
# in the same directory as the current Dockerfile on the host | ||
COPY o1vm-e2e-testing-cache.zip /tmp/cache-source/o1vm-e2e-testing-cache.zip | ||
|
||
# Command to copy the files to mounted volume | ||
CMD ["/bin/sh", "-c", "cp -r /tmp/cache-source/* /tmp/cache/"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
START=$(date +%s) | ||
|
||
echo "" | ||
echo "Cleaning up the E2E testing cache file system..." | ||
echo "" | ||
rm -rf op-program-db-for-latest-l2-block \ | ||
env-for-latest-l2-block.sh \ | ||
snapshot-state-3000000.json \ | ||
state.json \ | ||
meta.json \ | ||
out.json \ | ||
cpu.pprof | ||
|
||
RUNTIME=$(($(date +%s) - START)) | ||
echo "" | ||
echo "Execution time: ${RUNTIME} s" | ||
echo "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
START=$(date +%s) | ||
|
||
echo "" | ||
echo "Fetching the E2E testing cache..." | ||
echo "" | ||
docker run --rm -it --name o1vm-e2e-testing-cache --pull=always -v ./:/tmp/cache o1labs/proof-systems:o1vm-e2e-testing-cache | ||
unzip -q -o o1vm-e2e-testing-cache.zip -d ./ | ||
rm -rf o1vm-e2e-testing-cache.zip | ||
|
||
RUNTIME=$(($(date +%s) - START)) | ||
echo "" | ||
echo "Execution time: ${RUNTIME} s" | ||
echo "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
START=$(date +%s) | ||
# ARCH="amd64" | ||
DOCKER_FILE_NAME="Dockerfile-e2e-testing-cache" | ||
DOCKER_HUB_USER_NAME="o1labs" | ||
DOCKER_HUB_REPO_NAME="proof-systems" | ||
DOCKER_HUB_IMAGE_TAG="o1vm-e2e-testing-cache" | ||
DOCKER_IMAGE_FULL_NAME="${DOCKER_HUB_USER_NAME}/${DOCKER_HUB_REPO_NAME}:${DOCKER_HUB_IMAGE_TAG}" | ||
|
||
echo "" | ||
echo "Preparing the file system..." | ||
echo "" | ||
zip -r -q o1vm-e2e-testing-cache.zip op-program-db-for-latest-l2-block \ | ||
env-for-latest-l2-block.sh \ | ||
dannywillems marked this conversation as resolved.
Show resolved
Hide resolved
|
||
snapshot-state-3000000.json \ | ||
state.json \ | ||
meta.json \ | ||
out.json \ | ||
cpu.pprof | ||
|
||
echo "" | ||
echo "Building the '${DOCKER_IMAGE_FULL_NAME}' Docker image..." | ||
echo "" | ||
docker rmi -f ${DOCKER_IMAGE_FULL_NAME} || true | ||
docker rmi -f ${DOCKER_HUB_IMAGE_TAG} || true | ||
# docker build --platform linux/${ARCH} -t ${DOCKER_HUB_IMAGE_TAG} -f ${DOCKER_FILE_NAME} . | ||
docker build -t ${DOCKER_HUB_IMAGE_TAG} -f ${DOCKER_FILE_NAME} . | ||
|
||
echo "" | ||
echo "Publishing the '${DOCKER_IMAGE_FULL_NAME}' Docker image..." | ||
echo "" | ||
docker tag ${DOCKER_HUB_IMAGE_TAG} ${DOCKER_IMAGE_FULL_NAME} | ||
docker push ${DOCKER_IMAGE_FULL_NAME} | ||
echo "" | ||
|
||
echo "" | ||
echo "Cleaning up the file system..." | ||
echo "" | ||
rm -rf o1vm-e2e-testing-cache.zip | ||
|
||
RUNTIME=$(($(date +%s) - START)) | ||
echo "" | ||
echo "Execution time: ${RUNTIME} s" | ||
echo "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for history: this is the line that seems to require changing the CI settings. LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The target OS is calculated dynamically and is not in use by
strategy.matrix.os
so I removed it yet it messed the naming anyway. Weird.