forked from scroll-tech/zkevm-circuits
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add testool GPU dockers. (scroll-tech#997)
- Loading branch information
1 parent
2e06a0f
commit 3d1953d
Showing
5 changed files
with
82 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
docker/ | ||
target/ |
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,33 @@ | ||
FROM scrolltech/cuda-go-rust-builder:cuda-11.7.1-go-1.19-rust-nightly-2022-12-10 as builder | ||
|
||
ARG TESTOOL_FEATURE=inner-prove | ||
ENV LD_LIBRARY_PATH /usr/local/cuda/lib64:$LD_LIBRARY_PATH | ||
WORKDIR /src | ||
ADD . /src | ||
RUN mkdir /.cargo && echo 'paths = ["/src/halo2-gpu/halo2_proofs"]' > /.cargo/config | ||
RUN cargo build --features $TESTOOL_FEATURE --release | ||
Run cd ./target/release && find -name libzktrie.so | xargs -I {} cp {} ./ | ||
RUN apt update && apt install -y curl | ||
RUN mkdir test_assets | ||
RUN curl -o ./test_assets/layer1.config https://circuit-release.s3.us-west-2.amazonaws.com/release-v0.9.5/layer1.config | ||
RUN curl -o ./test_assets/layer2.config https://circuit-release.s3.us-west-2.amazonaws.com/release-v0.9.5/layer2.config | ||
|
||
FROM nvidia/cuda:11.7.1-runtime-ubuntu22.04 | ||
|
||
ENV LD_LIBRARY_PATH /usr/local/cuda/lib64:$LD_LIBRARY_PATH | ||
ENV SCROLL_PROVER_ASSETS_DIR /opt/test_assets | ||
ENV SCROLL_PROVER_PARAMS_DIR /opt/test_params | ||
ENV RUST_MIN_STACK 100000000 | ||
ENV RUST_BACKTRACE 1 | ||
ENV RUST_LOG info | ||
WORKDIR /opt | ||
RUN apt update && apt install -y git | ||
RUN mkdir -p /opt/configs /opt/report /opt/tests | ||
COPY --from=builder /src/target/release/libzktrie.so /usr/local/lib/ | ||
COPY --from=builder /src/target/release/testool /bin/ | ||
COPY --from=builder /src/test_assets/ /opt/test_assets/ | ||
COPY --from=builder /src/testool/tests/ /opt/tests/ | ||
COPY --from=builder /src/testool/Config.toml /opt/ | ||
COPY --from=builder /src/testool/codehash.txt /opt/ | ||
COPY --from=builder /src/testool/test_ids.txt /opt/ | ||
COPY --from=builder /src/testool/run_in_docker.sh /opt/run_testool.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,13 @@ | ||
version: '3' | ||
services: | ||
testool: | ||
image: {DOCKER_IMAGE} | ||
runtime: nvidia | ||
container_name: testool-gpu | ||
environment: | ||
- TESTOOL_IDS_LEN=${TESTOOL_IDS_LEN} | ||
volumes: | ||
- {PARAMS_DIR}:/opt/test_params | ||
- {EXPORT_DIR}:/opt/export | ||
- {REPORT_DIR}:/opt/report | ||
command: ./run_testool.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,27 @@ | ||
#!/bin/bash | ||
|
||
index="" | ||
if [ -e "export" ]; then | ||
i=$(expr $(cat export | awk -F '=' '{print $2}') + 0) | ||
|
||
offset=0 | ||
env_offset="TESTOOL_IDS_EXPORT_OFFSET" | ||
if [ -n "${!env_offset}" ]; then | ||
offset=$((env_offset)) | ||
fi | ||
echo $offset | ||
|
||
index="index-"$((offset + i)) | ||
fi | ||
echo $index | ||
|
||
start="" | ||
env_start="TEST_IDS_START" | ||
if [ -n "${!env_start}" ]; then | ||
start="start-"$((env_start)) | ||
fi | ||
echo $start | ||
|
||
mkdir -p /opt/report/$index$start | ||
|
||
testool --suite nightly --circuits sc --test-ids test_ids.txt --report > /opt/report/$index$start/run_test_ids.log 2>&1 |