forked from o1-labs/o1js
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
mike dupont
committed
Sep 28, 2024
1 parent
6d6fce3
commit e893e96
Showing
3 changed files
with
179 additions
and
53 deletions.
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,176 @@ | ||
name: run Perf Test and collect data | ||
env: | ||
default_image: "ghcr.io/meta-introspector/o1js/o1js-perf-recording:latest" | ||
container_name: "unit-tests" | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
image_url: | ||
description: 'Docker url to execute' | ||
default: "ghcr.io/meta-introspector/o1js/o1js-perf-recording:latest" | ||
push: | ||
branches: | ||
# add your branch here to auto trigger on push | ||
#- "feature/just_test" | ||
#- "feature/rebase" | ||
- "feature/unit-test-clean" | ||
# pull_request: | ||
# branches: [ "collect-perf" ] | ||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
tests: | ||
# - "/app/src/lib/util/base58.unit-test.ts" | ||
# - "/app/src/lib/ml/consistency.unit-test.ts" | ||
# - "/app/src/lib/mina/account-update.unit-test.ts" | ||
# - "/app/src/lib/mina/hash-input.unit-test.ts" | ||
# - "/app/src/lib/mina/mina.unit-test.ts" | ||
# - "/app/src/lib/mina/actions/offchain-contract.unit-test.ts" | ||
# - "/app/src/lib/mina/actions/batch-reducer.unit-test.ts" | ||
# - "/app/src/lib/mina/actions/batch-reducer-program.unit-test.ts" | ||
# - "/app/src/lib/mina/test/dynamic-call.unit-test.ts" | ||
# - "/app/src/lib/mina/token/forest-iterator.unit-test.ts" | ||
# - "/app/src/lib/mina/token/token-contract.unit-test.ts" | ||
# - "/app/src/lib/mina/fetch.unit-test.ts" | ||
# - "/app/src/lib/mina/account-update-layout.unit-test.ts" | ||
# - "/app/src/lib/proof-system/proof-system.unit-test.ts" | ||
# - "/app/src/lib/proof-system/sideloaded.unit-test.ts" | ||
# - "/app/src/lib/provable/test/bitwise.unit-test.ts" | ||
# - "/app/src/lib/provable/test/base64.unit-test.ts" | ||
# - "/app/src/lib/provable/test/field.unit-test.ts" | ||
# - "/app/src/lib/provable/test/nullifier.unit-test.ts" | ||
# - "/app/src/lib/provable/test/provable.unit-test.ts" | ||
# - "/app/src/lib/provable/test/sha256.unit-test.ts" | ||
# - "/app/src/lib/provable/test/string.unit-test.ts" | ||
# - "/app/src/lib/provable/test/range-check.unit-test.ts" | ||
# - "/app/src/lib/provable/test/foreign-field.unit-test.ts" | ||
# - "/app/src/lib/provable/test/group.unit-test.ts" | ||
# - "/app/src/lib/provable/test/custom-gates-recursion.unit-test.ts" | ||
# - "/app/src/lib/provable/test/foreign-curve.unit-test.ts" | ||
# - "/app/src/lib/provable/test/foreign-field-gadgets.unit-test.ts" | ||
# - "/app/src/lib/provable/test/elliptic-curve.unit-test.ts" | ||
# - "/app/src/lib/provable/test/lookup.unit-test.ts" | ||
# - "/app/src/lib/provable/test/ecdsa.unit-test.ts" | ||
# - "/app/src/lib/provable/test/arithmetic.unit-test.ts" | ||
# - "/app/src/lib/provable/test/primitives.unit-test.ts" | ||
# - "/app/src/lib/provable/test/keccak.unit-test.ts" | ||
# - "/app/src/lib/provable/test/struct.unit-test.ts" | ||
# - "/app/src/lib/provable/test/merkle-tree.unit-test.ts" | ||
# - "/app/src/lib/testing/testing.unit-test.ts" | ||
# - "/app/src/mina-signer/tests/verify-in-snark.unit-test.ts" | ||
# - "/app/src/mina-signer/tests/zkapp.unit-test.ts" | ||
# - "/app/src/mina-signer/src/sign-legacy.unit-test.ts" | ||
# - "/app/src/mina-signer/src/transaction-hash.unit-test.ts" | ||
# - "/app/src/mina-signer/src/signature.unit-test.ts" | ||
# - "/app/src/mina-signer/src/sign-zkapp-command.unit-test.ts" | ||
# - "/app/src/bindings/lib/binable.unit-test.ts" | ||
# - "/app/src/bindings/crypto/bigint.unit-test.ts" | ||
# - "/app/src/bindings/crypto/finite-field.unit-test.ts" | ||
# - "/app/src/bindings/crypto/glv.unit-test.ts" | ||
# - "/app/src/bindings/crypto/poseidon.unit-test.ts" | ||
# - "/app/src/bindings/crypto/bindings/bindings.unit-test.ts" | ||
# - "/app/src/bindings/crypto/elliptic-curve.unit-test.ts" | ||
|
||
- "/app/dist/node/lib/util/base58.unit-test.js" | ||
- "/app/dist/node/lib/ml/consistency.unit-test.js" | ||
- "/app/dist/node/lib/mina/account-update.unit-test.js" | ||
- "/app/dist/node/lib/mina/hash-input.unit-test.js" | ||
- "/app/dist/node/lib/mina/mina.unit-test.js" | ||
- "/app/dist/node/lib/mina/actions/offchain-contract.unit-test.js" | ||
- "/app/dist/node/lib/mina/actions/batch-reducer.unit-test.js" | ||
- "/app/dist/node/lib/mina/actions/batch-reducer-program.unit-test.js" | ||
- "/app/dist/node/lib/mina/test/dynamic-call.unit-test.js" | ||
- "/app/dist/node/lib/mina/token/forest-iterator.unit-test.js" | ||
- "/app/dist/node/lib/mina/token/token-contract.unit-test.js" | ||
- "/app/dist/node/lib/mina/fetch.unit-test.js" | ||
- "/app/dist/node/lib/mina/account-update-layout.unit-test.js" | ||
- "/app/dist/node/lib/proof-system/proof-system.unit-test.js" | ||
- "/app/dist/node/lib/proof-system/sideloaded.unit-test.js" | ||
- "/app/dist/node/lib/provable/test/bitwise.unit-test.js" | ||
- "/app/dist/node/lib/provable/test/base64.unit-test.js" | ||
- "/app/dist/node/lib/provable/test/field.unit-test.js" | ||
- "/app/dist/node/lib/provable/test/nullifier.unit-test.js" | ||
- "/app/dist/node/lib/provable/test/provable.unit-test.js" | ||
- "/app/dist/node/lib/provable/test/sha256.unit-test.js" | ||
- "/app/dist/node/lib/provable/test/string.unit-test.js" | ||
- "/app/dist/node/lib/provable/test/range-check.unit-test.js" | ||
- "/app/dist/node/lib/provable/test/foreign-field.unit-test.js" | ||
- "/app/dist/node/lib/provable/test/group.unit-test.js" | ||
- "/app/dist/node/lib/provable/test/custom-gates-recursion.unit-test.js" | ||
- "/app/dist/node/lib/provable/test/foreign-curve.unit-test.js" | ||
- "/app/dist/node/lib/provable/test/foreign-field-gadgets.unit-test.js" | ||
- "/app/dist/node/lib/provable/test/elliptic-curve.unit-test.js" | ||
- "/app/dist/node/lib/provable/test/lookup.unit-test.js" | ||
- "/app/dist/node/lib/provable/test/ecdsa.unit-test.js" | ||
- "/app/dist/node/lib/provable/test/arithmetic.unit-test.js" | ||
- "/app/dist/node/lib/provable/test/primitives.unit-test.js" | ||
- "/app/dist/node/lib/provable/test/keccak.unit-test.js" | ||
- "/app/dist/node/lib/provable/test/struct.unit-test.js" | ||
- "/app/dist/node/lib/provable/test/merkle-tree.unit-test.js" | ||
- "/app/dist/node/lib/testing/testing.unit-test.js" | ||
- "/app/dist/node/mina-signer/tests/verify-in-snark.unit-test.js" | ||
- "/app/dist/node/mina-signer/tests/zkapp.unit-test.js" | ||
- "/app/dist/node/mina-signer/src/sign-legacy.unit-test.js" | ||
- "/app/dist/node/mina-signer/src/transaction-hash.unit-test.js" | ||
- "/app/dist/node/mina-signer/src/signature.unit-test.js" | ||
- "/app/dist/node/mina-signer/src/sign-zkapp-command.unit-test.js" | ||
- "/app/dist/node/bindings/lib/binable.unit-test.js" | ||
- "/app/dist/node/bindings/crypto/bigint.unit-test.js" | ||
- "/app/dist/node/bindings/crypto/finite-field.unit-test.js" | ||
- "/app/dist/node/bindings/crypto/glv.unit-test.js" | ||
- "/app/dist/node/bindings/crypto/poseidon.unit-test.js" | ||
- "/app/dist/node/bindings/crypto/bindings/bindings.unit-test.js" | ||
- "/app/dist/node/bindings/crypto/elliptic-curve.unit-test.js" | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Sets NAME | ||
env: | ||
name: "${{matrix.tests}}" | ||
run: | | ||
TEST_NAME1=`echo $name | sed -e 's!/!-!g' ` | ||
echo "TEST_NAME=test${TEST_NAME1}" >> $GITHUB_ENV | ||
- uses: meta-introspector/checkout@v4 | ||
#with: | ||
# submodules: recursive | ||
|
||
- name: Login to GHCR | ||
uses: meta-introspector/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
#- name: pull the image | ||
# run: docker pull ${{ inputs.image_url || env.default_image }} | ||
|
||
- name: build base image | ||
run: docker compose build mina-local-network | ||
|
||
- name: run the Docker build locally using pulled image | ||
run: TESTS=${{matrix.tests}} docker compose build ${{ env.container_name }} | ||
env: | ||
DOCKER_IMAGE_URL: ${{ inputs.image_url || env.default_image}} | ||
|
||
- name: run the Docker tests | ||
run: TESTS=${{matrix.tests}} docker compose up ${{ env.container_name }} | ||
env: | ||
DOCKER_IMAGE_URL: ${{ inputs.image_url || env.default_image}} | ||
|
||
- name: docker cp results | ||
run: docker compose cp ${{ env.container_name }}:/tmp/perf.data.tar.gz perf.data.tar.gz | ||
|
||
- name: Archive results | ||
uses: meta-introspector/upload-artifact@v4 | ||
with: | ||
name: ${{ env.TEST_NAME }}.perf.data.tar.gz | ||
path: perf.data.tar.gz | ||
|
||
- name: delete the results | ||
run: rm -rf /tmp/perf* | ||
|
||
- name: delete the container | ||
run: | | ||
docker compose down |
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ ENV PATH="$PNPM_HOME:$PATH" | |
RUN corepack enable | ||
RUN apt update | ||
RUN apt install -y git bzip2 | ||
|
||
run apt-get install -y linux-perf # move to top | ||
WORKDIR /app | ||
|
||
ADD pnpm-lock.yaml pnpm-lock.yaml | ||
|
@@ -31,6 +31,7 @@ COPY dune-project /app/dune-project | |
RUN corepack enable | ||
RUN corepack prepare pnpm@latest-9 --activate | ||
RUN pnpm install | ||
RUN npm install -g [email protected] | ||
# "dev": "npx tsc -p tsconfig.test.json && node src/build/copy-to-dist.js", | ||
RUN npx tsc -p tsconfig.test.json | ||
|
||
|
@@ -42,26 +43,9 @@ RUN pnpm install -g clinic | |
|
||
RUN pnpm run build | ||
|
||
#RUN apt update | ||
#RUN apt install -y strace | ||
run apt-get install -y linux-perf # move to top | ||
|
||
# why is this needed? | ||
RUN ln -s /app/dist /app/src/mina-signer/dist | ||
|
||
# '/app/dist/node/bindings/compiled/_node_bindings/plonk_wasm.cjs' imported from /app/dist/node/bindings/js/node/node-backend.js | ||
# found here | ||
#./src/bindings/compiled/node_bindings/plonk_wasm.cjs | ||
#./src/bindings/compiled/_node_bindings/plonk_wasm.cjs | ||
#./dist/node/bindings/compiled/_node_bindings/plonk_wasm.cjs | ||
|
||
#run apt-get update | ||
|
||
|
||
#CMD [ "pnpm", "run", "test" ] | ||
#RUN pnpm run test || echo skip errors | ||
|
||
#COPY . /app | ||
WORKDIR /app | ||
|
||
FROM base AS prod-deps | ||
|
@@ -90,38 +74,3 @@ EXPOSE 8000 | |
CMD [ "pnpm", "start" ] | ||
|
||
|
||
|
||
# # Use an official Ubuntu image as a base | ||
# #FROM ubuntu:latest | ||
# FROM o1labs/mina-local-network:compatible-latest-devnet | ||
|
||
# # Set the working directory to /app | ||
# WORKDIR /app | ||
|
||
# # Install required dependencies | ||
# RUN apt update && apt install -y \ | ||
# git \ | ||
# curl \ | ||
# npm \ | ||
# nodejs | ||
|
||
# # Install Node.js version 18 | ||
# RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - | ||
# RUN apt-get install -y nodejs | ||
|
||
# # Clone the repository and checkout the specific branch | ||
# RUN git clone https://github.com/meta-introspector/o1js.git . | ||
# RUN git checkout 7647eb9 | ||
|
||
# # Install npm dependencies | ||
# RUN npm ci | ||
|
||
# # Build o1js | ||
# RUN npm run build | ||
|
||
# # Expose the port for the web server | ||
# EXPOSE 8080 | ||
|
||
# # Run the command to start the web server when the container launches | ||
# CMD ["npm", "run", "start"] | ||
|
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