Skip to content

Commit

Permalink
fixup! feat: add deb package
Browse files Browse the repository at this point in the history
  • Loading branch information
mpolitzer committed Aug 15, 2023
1 parent 3d03153 commit f377f1c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
40 changes: 20 additions & 20 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ env:
LINUX_VERSION: 5.15.63-ctsi-2-v0.17.0
ROOTFS_VERSION: v0.18.0
TEST_VERSION: v0.29.0
CARTESI_TESTS_PATH: /opt/cartesi/share/cartesi-machine/tests
CARTESI_IMAGES_PATH: /opt/cartesi/share/cartesi-machine/images
CARTESI_UARCH_PATH: /opt/cartesi/share/cartesi-machine/uarch/uarch-ram.bin
CARTESI_TESTS_PATH: /usr/share/cartesi-machine/tests
CARTESI_IMAGES_PATH: /usr/share/cartesi-machine/images
CARTESI_UARCH_PATH: /usr/share/cartesi-machine/uarch/uarch-ram.bin
jobs:
build:
name: Build
Expand Down Expand Up @@ -218,16 +218,16 @@ jobs:
run: mkdir -p ${{ env.CARTESI_TESTS_PATH }} && tar -xzf machine-tests-${{ env.TEST_VERSION }}.tar.gz -C ${{ env.CARTESI_TESTS_PATH }}

- name: Simple boot inside the docker image
run: docker run --rm -v ${{ env.CARTESI_IMAGES_PATH }}:${{ env.CARTESI_IMAGES_PATH }} -t ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel /opt/cartesi/bin/cartesi-machine /bin/true
run: docker run --rm -v ${{ env.CARTESI_IMAGES_PATH }}:${{ env.CARTESI_IMAGES_PATH }} -t ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel /usr/bin/cartesi-machine /bin/true

- name: Run test suite inside the docker image
run: docker run --rm -v ${{ env.CARTESI_TESTS_PATH }}:${{ env.CARTESI_TESTS_PATH }} -t ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel /opt/cartesi/bin/cartesi-machine-tests --test-path=${{ env.CARTESI_TESTS_PATH }} run
run: docker run --rm -v ${{ env.CARTESI_TESTS_PATH }}:${{ env.CARTESI_TESTS_PATH }} -t ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel /usr/bin/cartesi-machine-tests --test-path=${{ env.CARTESI_TESTS_PATH }} run

- name: Save and Load
run: |
mkdir -m 755 -p ${{ env.CARTESI_IMAGES_PATH }}/snapshots
docker run --rm -v ${{ env.CARTESI_IMAGES_PATH }}:${{ env.CARTESI_IMAGES_PATH }} -t ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel /opt/cartesi/bin/cartesi-machine --max-mcycle=0 --rollup --store=${{ env.CARTESI_IMAGES_PATH }}/snapshots/save_and_load_test
docker run --rm -v ${{ env.CARTESI_IMAGES_PATH }}:${{ env.CARTESI_IMAGES_PATH }} -t ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel /opt/cartesi/bin/cartesi-machine --load=${{ env.CARTESI_IMAGES_PATH }}/snapshots/save_and_load_test
docker run --rm -v ${{ env.CARTESI_IMAGES_PATH }}:${{ env.CARTESI_IMAGES_PATH }} -t ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel /usr/bin/cartesi-machine --max-mcycle=0 --rollup --store=${{ env.CARTESI_IMAGES_PATH }}/snapshots/save_and_load_test
docker run --rm -v ${{ env.CARTESI_IMAGES_PATH }}:${{ env.CARTESI_IMAGES_PATH }} -t ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel /usr/bin/cartesi-machine --load=${{ env.CARTESI_IMAGES_PATH }}/snapshots/save_and_load_test
sudo rm -rf ${{ env.CARTESI_IMAGES_PATH }}/snapshots
- name: Run test scripts
Expand All @@ -248,28 +248,28 @@ jobs:
- name: Run C API tests
run: |
docker run --rm -v ${{ env.CARTESI_IMAGES_PATH }}:${{ env.CARTESI_IMAGES_PATH }} -v ${{ env.CARTESI_TESTS_PATH }}:${{ env.CARTESI_TESTS_PATH }} -t -e LD_LIBRARY_PATH=/opt/cartesi/lib ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel ./src/tests/test-machine-c-api
docker run --rm -v ${{ env.CARTESI_IMAGES_PATH }}:${{ env.CARTESI_IMAGES_PATH }} -v ${{ env.CARTESI_TESTS_PATH }}:${{ env.CARTESI_TESTS_PATH }} -t ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel ./src/tests/test-machine-c-api
- name: Test microarchitecture interpreter
run: |
docker run --rm -t ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel make uarch-tests run-uarch-tests JOBS=-j$(nproc)
- name: Run rv64ui test suite on microarchitecture
run: |
docker run --rm -v ${{ env.CARTESI_TESTS_PATH }}:${{ env.CARTESI_TESTS_PATH }} -t ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel /opt/cartesi/bin/uarch-riscv-tests --test-path=${{ env.CARTESI_TESTS_PATH }} run
docker run --rm -v ${{ env.CARTESI_TESTS_PATH }}:${{ env.CARTESI_TESTS_PATH }} -t ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel /usr/bin/uarch-riscv-tests --test-path=${{ env.CARTESI_TESTS_PATH }} run
- name: Run test suite with Microarchitecture
run: |
docker run --rm -v ${{ env.CARTESI_IMAGES_PATH }}:${{ env.CARTESI_IMAGES_PATH }} -v ${{ env.CARTESI_TESTS_PATH }}:${{ env.CARTESI_TESTS_PATH }} -t ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel /opt/cartesi/bin/cartesi-machine-tests --test-path=${{ env.CARTESI_TESTS_PATH }} --uarch-ram-length=0x20000 --uarch-ram-image=${{ env.CARTESI_UARCH_PATH }} --jobs=$(nproc) run_uarch
docker run --rm -v ${{ env.CARTESI_IMAGES_PATH }}:${{ env.CARTESI_IMAGES_PATH }} -v ${{ env.CARTESI_TESTS_PATH }}:${{ env.CARTESI_TESTS_PATH }} -t ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel /usr/bin/cartesi-machine-tests --test-path=${{ env.CARTESI_TESTS_PATH }} --uarch-ram-length=0x20000 --uarch-ram-image=${{ env.CARTESI_UARCH_PATH }} --jobs=$(nproc) run_uarch
- name: Run test suite with microarchitecture and host based interpreters comparing machine hashes at every step
run: |
docker run --rm -v ${{ env.CARTESI_IMAGES_PATH }}:${{ env.CARTESI_IMAGES_PATH }} -v ${{ env.CARTESI_TESTS_PATH }}:${{ env.CARTESI_TESTS_PATH }} -t ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel /opt/cartesi/bin/cartesi-machine-tests --test="^rv64ui.*$" --test-path=${{ env.CARTESI_TESTS_PATH }} --uarch-ram-length=0x20000 --uarch-ram-image=${{ env.CARTESI_UARCH_PATH }} --jobs=$(nproc) run_host_and_uarch
docker run --rm -v ${{ env.CARTESI_IMAGES_PATH }}:${{ env.CARTESI_IMAGES_PATH }} -v ${{ env.CARTESI_TESTS_PATH }}:${{ env.CARTESI_TESTS_PATH }} -t ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel /usr/bin/cartesi-machine-tests --test="^rv64ui.*$" --test-path=${{ env.CARTESI_TESTS_PATH }} --uarch-ram-length=0x20000 --uarch-ram-image=${{ env.CARTESI_UARCH_PATH }} --jobs=$(nproc) run_host_and_uarch
- name: Create uarch json logs to be used to test the Solidity based microarchitecture interpreter
run: |
mkdir -p /opt/cartesi/share/logs/uarch-riscv-tests-json-logs
docker run --rm -v /opt/cartesi/share/logs:/opt/cartesi/share/logs -v ${{ env.CARTESI_TESTS_PATH }}:${{ env.CARTESI_TESTS_PATH }} -t ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel /opt/cartesi/bin/uarch-riscv-tests --test-path=${{ env.CARTESI_TESTS_PATH }} --output-dir=/opt/cartesi/share/logs/uarch-riscv-tests-json-logs --proofs --proofs-frequency=1 json-logs
docker run --rm -v /opt/cartesi/share/logs:/opt/cartesi/share/logs -v ${{ env.CARTESI_TESTS_PATH }}:${{ env.CARTESI_TESTS_PATH }} -t ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel /usr/bin/uarch-riscv-tests --test-path=${{ env.CARTESI_TESTS_PATH }} --output-dir=/opt/cartesi/share/logs/uarch-riscv-tests-json-logs --proofs --proofs-frequency=1 json-logs
- name: Compress uarch json logs
run: tar -czf uarch-riscv-tests-json-logs.tar.gz -C /opt/cartesi/share/logs/uarch-riscv-tests-json-logs .
Expand Down Expand Up @@ -372,16 +372,16 @@ jobs:
run: mkdir -p ${{ env.CARTESI_TESTS_PATH }} && tar -xzf machine-tests-${{ env.TEST_VERSION }}.tar.gz -C ${{ env.CARTESI_TESTS_PATH }}

- name: Simple boot inside the docker image
run: docker run --platform linux/arm64 --rm -v ${{ env.CARTESI_IMAGES_PATH }}:${{ env.CARTESI_IMAGES_PATH }} -t ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel /opt/cartesi/bin/cartesi-machine /bin/true
run: docker run --platform linux/arm64 --rm -v ${{ env.CARTESI_IMAGES_PATH }}:${{ env.CARTESI_IMAGES_PATH }} -t ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel /usr/bin/cartesi-machine /bin/true

- name: Run test suite inside the docker image
run: docker run --platform linux/arm64 --rm -v ${{ env.CARTESI_TESTS_PATH }}:${{ env.CARTESI_TESTS_PATH }} -t ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel /opt/cartesi/bin/cartesi-machine-tests --test-path=${{ env.CARTESI_TESTS_PATH }} run
run: docker run --platform linux/arm64 --rm -v ${{ env.CARTESI_TESTS_PATH }}:${{ env.CARTESI_TESTS_PATH }} -t ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel /usr/bin/cartesi-machine-tests --test-path=${{ env.CARTESI_TESTS_PATH }} run

- name: Save and Load
run: |
mkdir -m 755 -p ${{ env.CARTESI_IMAGES_PATH }}/snapshots
docker run --platform linux/arm64 --rm -v ${{ env.CARTESI_IMAGES_PATH }}:${{ env.CARTESI_IMAGES_PATH }} -t ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel /opt/cartesi/bin/cartesi-machine --max-mcycle=0 --rollup --store=${{ env.CARTESI_IMAGES_PATH }}/snapshots/save_and_load_test
docker run --platform linux/arm64 --rm -v ${{ env.CARTESI_IMAGES_PATH }}:${{ env.CARTESI_IMAGES_PATH }} -t ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel /opt/cartesi/bin/cartesi-machine --load=${{ env.CARTESI_IMAGES_PATH }}/snapshots/save_and_load_test
docker run --platform linux/arm64 --rm -v ${{ env.CARTESI_IMAGES_PATH }}:${{ env.CARTESI_IMAGES_PATH }} -t ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel /usr/bin/cartesi-machine --max-mcycle=0 --rollup --store=${{ env.CARTESI_IMAGES_PATH }}/snapshots/save_and_load_test
docker run --platform linux/arm64 --rm -v ${{ env.CARTESI_IMAGES_PATH }}:${{ env.CARTESI_IMAGES_PATH }} -t ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel /usr/bin/cartesi-machine --load=${{ env.CARTESI_IMAGES_PATH }}/snapshots/save_and_load_test
sudo rm -rf ${{ env.CARTESI_IMAGES_PATH }}/snapshots
- name: Run test scripts
Expand All @@ -402,23 +402,23 @@ jobs:
- name: Run C API tests
run: |
docker run --platform linux/arm64 --rm -v ${{ env.CARTESI_IMAGES_PATH }}:${{ env.CARTESI_IMAGES_PATH }} -v ${{ env.CARTESI_TESTS_PATH }}:${{ env.CARTESI_TESTS_PATH }} -t -e LD_LIBRARY_PATH=/opt/cartesi/lib ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel ./src/tests/test-machine-c-api
docker run --platform linux/arm64 --rm -v ${{ env.CARTESI_IMAGES_PATH }}:${{ env.CARTESI_IMAGES_PATH }} -v ${{ env.CARTESI_TESTS_PATH }}:${{ env.CARTESI_TESTS_PATH }} -t ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel ./src/tests/test-machine-c-api
- name: Test microarchitecture interpreter
run: |
docker run --platform linux/arm64 --rm -t ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel make uarch-tests JOBS=-j$(nproc)
- name: Run rv64ui test suite on microarchitecture
run: |
docker run --platform linux/arm64 --rm -v ${{ env.CARTESI_TESTS_PATH }}:${{ env.CARTESI_TESTS_PATH }} -t ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel /opt/cartesi/bin/uarch-riscv-tests --test-path=${{ env.CARTESI_TESTS_PATH }} run
docker run --platform linux/arm64 --rm -v ${{ env.CARTESI_TESTS_PATH }}:${{ env.CARTESI_TESTS_PATH }} -t ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel /usr/bin/uarch-riscv-tests --test-path=${{ env.CARTESI_TESTS_PATH }} run
- name: Run test suite with Microarchitecture
run: |
docker run --platform linux/arm64 --rm -v ${{ env.CARTESI_IMAGES_PATH }}:${{ env.CARTESI_IMAGES_PATH }} -v ${{ env.CARTESI_TESTS_PATH }}:${{ env.CARTESI_TESTS_PATH }} -t ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel /opt/cartesi/bin/cartesi-machine-tests --test-path=${{ env.CARTESI_TESTS_PATH }} --uarch-ram-length=0x20000 --uarch-ram-image=${{ env.CARTESI_UARCH_PATH }} --jobs=$(nproc) run_uarch
docker run --platform linux/arm64 --rm -v ${{ env.CARTESI_IMAGES_PATH }}:${{ env.CARTESI_IMAGES_PATH }} -v ${{ env.CARTESI_TESTS_PATH }}:${{ env.CARTESI_TESTS_PATH }} -t ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel /usr/bin/cartesi-machine-tests --test-path=${{ env.CARTESI_TESTS_PATH }} --uarch-ram-length=0x20000 --uarch-ram-image=${{ env.CARTESI_UARCH_PATH }} --jobs=$(nproc) run_uarch
- name: Run test suite with microarchitecture and host based interpreters comparing machine hashes at every step
run: |
docker run --platform linux/arm64 --rm -v ${{ env.CARTESI_IMAGES_PATH }}:${{ env.CARTESI_IMAGES_PATH }} -v ${{ env.CARTESI_TESTS_PATH }}:${{ env.CARTESI_TESTS_PATH }} -t ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel /opt/cartesi/bin/cartesi-machine-tests --test="^rv64ui%-v%-add.bin$" --test-path=${{ env.CARTESI_TESTS_PATH }} --concurrency=update_merkle_tree:1 --uarch-ram-length=0x20000 --uarch-ram-image=${{ env.CARTESI_UARCH_PATH }} --jobs=$(nproc) run_host_and_uarch
docker run --platform linux/arm64 --rm -v ${{ env.CARTESI_IMAGES_PATH }}:${{ env.CARTESI_IMAGES_PATH }} -v ${{ env.CARTESI_TESTS_PATH }}:${{ env.CARTESI_TESTS_PATH }} -t ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator:devel /usr/bin/cartesi-machine-tests --test="^rv64ui%-v%-add.bin$" --test-path=${{ env.CARTESI_TESTS_PATH }} --concurrency=update_merkle_tree:1 --uarch-ram-length=0x20000 --uarch-ram-image=${{ env.CARTESI_UARCH_PATH }} --jobs=$(nproc) run_host_and_uarch
static-analysis:
name: Static Analysis
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ RUN apt-get update && DEBIAN_FRONTEND="noninteractive" apt install -y \
./cartesi-machine-v${MACHINE_EMULATOR_VERSION}_${TARGETARCH}.deb \
&& rm -rf /var/lib/apt/lists/*

ENV CARTESI_TESTS_PATH="/opt/cartesi/share/cartesi-machine/tests"
ENV CARTESI_IMAGES_PATH="/opt/cartesi/share/cartesi-machine/images"
ENV CARTESI_TESTS_PATH="/usr/share/cartesi-machine/tests"
ENV CARTESI_IMAGES_PATH="/usr/share/cartesi-machine/images"

FROM --platform=$TARGETPLATFORM debian:bookworm-20230725-slim
ARG MACHINE_EMULATOR_VERSION=0.0.0
Expand Down

0 comments on commit f377f1c

Please sign in to comment.