Skip to content

Commit 6ecb4b9

Browse files
author
mike dupont
committed
Just test
now to test on github Update run-docker-tests.yml update documentation fix syntax install clinic Update run-docker-tests.yml adding verbose on push as well on push as well
1 parent 28eadc7 commit 6ecb4b9

11 files changed

+114
-170
lines changed

.github/workflows/build-and-test-docker-image.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
push:
66
branches: [ "collect-perf" ]
77
pull_request:
8-
#branches: [ "main" ]
8+
branches: [ "collect-perf" ]
99

1010
jobs:
1111

.github/workflows/process-perf-results.yml

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ jobs:
4444
env:
4545
WORKSPACE_DIR2: $GITHUB_WORKSPACE
4646
WORKSPACE_DIR: $GITHUB_WORKSPACE
47+
4748
- name: Archive results
4849
uses: meta-introspector/upload-artifact@v4
4950
with:

.github/workflows/process_perf_new.yml

+9-11
Original file line numberDiff line numberDiff line change
@@ -91,23 +91,21 @@ jobs:
9191
do unzip $x;
9292
done
9393
#unzip data/results.tgz.zip
94-
for x in *.tar.gz; do
95-
tar -xzf $x
96-
done
97-
for x in *.tgz; do
98-
tar -xzf $x
99-
done
94+
#for x in *.tar.gz; do
95+
tar -xvzf perf.data.tar.gz
96+
#done
97+
#for x in *.tgz; do
98+
# tar -xzf $x
99+
#done
100100
find .
101-
pushd app/perf-reporting/output/results/
102-
tree -H . -o index.html
103-
# cp index.txt app/perf-reporting/output/results/index.html
104-
101+
pushd tmp/perf
102+
tree -H . -o index.html
105103
- name: Setup Pages
106104
uses: meta-introspector/configure-pages@v5
107105
- name: Upload Artifact
108106
uses: meta-introspector/upload-pages-artifact@v5
109107
with:
110-
path: 'app/perf-reporting/output/results'
108+
path: 'tmp/perf'
111109
- name: Deploy to GitHub Pages
112110
id: deployment
113111
uses: meta-introspector/deploy-pages@v4.1

.github/workflows/run-docker-tests.yml

+13-5
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
name: run Perf Test and collect data
2-
2+
env:
3+
default_image: "ghcr.io/meta-introspector/o1js/o1js-perf-recording:latest"
34
on:
45
workflow_dispatch:
6+
inputs:
7+
image_url:
8+
description: 'Docker url to execute'
9+
#default: "ghcr.io/meta-introspector/o1js/o1js-perf-recording:5ce0221662cecbca9a3de05601af94a15b154a3bcf8bafcb0cfa1f5b9f407bdc"
10+
default: "ghcr.io/meta-introspector/o1js/o1js-perf-recording:latest"
511
push:
6-
branches: [ "collect-perf" ]
12+
branches: [ "feature/just_test" ]
713
pull_request:
814
branches: [ "collect-perf" ]
915
jobs:
1016
build:
1117
runs-on: ubuntu-latest
1218
steps:
1319
- uses: meta-introspector/checkout@v4
14-
with:
15-
submodules: recursive
20+
#with:
21+
# submodules: recursive
1622

1723
- name: Login to GHCR
1824
uses: meta-introspector/login-action@v1
@@ -22,10 +28,12 @@ jobs:
2228
password: ${{ secrets.GITHUB_TOKEN }}
2329

2430
- name: pull the image
25-
run: docker pull ghcr.io/meta-introspector/o1js/o1js-perf-recording:latest
31+
run: docker pull ${{ inputs.image_url || env.default_image }}
2632

2733
- name: run the Docker tests
2834
run: docker compose up mina-local-network
35+
env:
36+
DOCKER_IMAGE_URL: ${{ inputs.image_url || env.default_image}}
2937

3038
- name: docker cp results
3139
run: docker compose cp mina-local-network:/tmp/perf.data.tar.gz perf.data.tar.gz

Dockerfile

+17-17
Original file line numberDiff line numberDiff line change
@@ -32,30 +32,19 @@ RUN corepack enable
3232
RUN corepack prepare pnpm@latest-9 --activate
3333
RUN pnpm install
3434
# "dev": "npx tsc -p tsconfig.test.json && node src/build/copy-to-dist.js",
35-
RUN npx tsc --help || echo 2
36-
RUN npx tsc --all || echo 2
37-
RUN npx tsc --version
3835
RUN npx tsc -p tsconfig.test.json
3936

4037
#RUN pnpm install "https://github.com/meta-introspector/jest.git"
4138
#RUN pnpm install "https://github.com/meta-introspector/ts-jest.git"
42-
RUN pnpm install "https://github.com/meta-introspector/node-clinic-doctor"
43-
RUN pnpm install "https://github.com/meta-introspector/node-clinic"
39+
#RUN pnpm install "https://github.com/meta-introspector/node-clinic-doctor"
40+
#RUN pnpm install "https://github.com/meta-introspector/node-clinic"
41+
RUN pnpm install -g clinic
4442

4543
RUN pnpm run build
4644

4745
#RUN apt update
4846
#RUN apt install -y strace
4947
run apt-get install -y linux-perf # move to top
50-
COPY run-jest-tests.sh /app/run-jest-tests.sh
51-
COPY jest.config.js /app/jest.config.js
52-
COPY run-integration-tests.sh /app/run-integration-tests.sh
53-
COPY run-unit-tests.sh /app/run-unit-tests.sh
54-
COPY run-all-tests.sh /app/run-all-tests.sh
55-
COPY run /app/run
56-
COPY run-debug /app/run-debug
57-
COPY run-minimal-mina-tests.sh /app/run-minimal-mina-tests.sh
58-
COPY run-ci-benchmarks.sh /app/run-ci-benchmarks.sh
5948

6049
# why is this needed?
6150
RUN ln -s /app/dist /app/src/mina-signer/dist
@@ -69,11 +58,10 @@ RUN ln -s /app/dist /app/src/mina-signer/dist
6958
#run apt-get update
7059

7160

72-
CMD [ "pnpm", "run", "test" ]
73-
61+
#CMD [ "pnpm", "run", "test" ]
7462
#RUN pnpm run test || echo skip errors
7563

76-
COPY . /app
64+
#COPY . /app
7765
WORKDIR /app
7866

7967
FROM base AS prod-deps
@@ -86,6 +74,18 @@ RUN pnpm run build
8674
FROM base
8775
COPY --from=prod-deps /app/node_modules /app/node_modules
8876
COPY --from=build /app/dist /app/dist
77+
78+
COPY run-jest-tests.sh /app/run-jest-tests.sh
79+
COPY jest.config.js /app/jest.config.js
80+
COPY run-integration-tests.sh /app/run-integration-tests.sh
81+
COPY run-unit-tests.sh /app/run-unit-tests.sh
82+
COPY run-all-tests.sh /app/run-all-tests.sh
83+
COPY run /app/run
84+
COPY run-debug /app/run-debug
85+
COPY run-minimal-mina-tests.sh /app/run-minimal-mina-tests.sh
86+
COPY run-ci-benchmarks.sh /app/run-ci-benchmarks.sh
87+
88+
8989
EXPOSE 8000
9090
CMD [ "pnpm", "start" ]
9191

Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
test:
22
docker compose build mina-local-network
3+
<<<<<<< HEAD
34
docker compose up mina-local-network
5+
=======
6+
docker compose up mina-local-network
7+
>>>>>>> db5a825c8 (Just test)

README-dev.md

+19-24
Original file line numberDiff line numberDiff line change
@@ -395,38 +395,33 @@ cpu-clock:ppp stats:
395395

396396
# Summary
397397

398-
This set of tools is for batch processing perf data.
398+
This set of tools is for batch collecting and processing performance and coverage data customized for o1js mina.
399399

400+
We have different github actions to create docker images.
400401

401-
# latest update
402+
The long term goal is to be able to collect this performance information in the browser later, but for new we can run them locally, in github actions or on other platforms, planning on gitlab and any other cloud resources that are available. We will try other build platform first via docker images and then later on actual different hardware.
402403

403-
`gh api https://api.github.com/repos/meta-introspector/o1js/actions/artifacts/1961929543/zip > data/perf.data.zip`
404-
it contains
405-
perf.data.tar.gz
404+
To run a local test via docker just type in `make` to use the [Makefile](./Makefile) to run tests via docker.
406405

407-
This contains
408-
`tmp/perf/group.test.ts.perf.data.tar.bz2`
409-
that is mounted in
410-
`/app/perf-reporting/output/`
406+
### Creating docker images
411407

408+
[Build and publish](.github/workflows/build-and-publish-docker-image.yml)
412409

413-
it says in the logs
414-
```
415-
wherever you need to run 'perf report' on.
416-
mina-local-network-1 | + cp src/lib/provable/test/provable.test.ts.perf.data src/lib/provable/test/provable.test.ts.perf.data.tar.bz2 src/lib/provable/test/provable.test.ts.reportout.txt /tmp/perf/
417-
mina-local-network-1 | + for testname in $TESTS
418-
mina-local-network-1 | + perf record -o src/lib/provable/test/primitives.test.ts.perf.data -F 999 --call-graph dwarf node --perf-basic-prof ./node_modules/.bin/../jest/bin/jest.js src/lib/provable/test/primitives.test.ts
419-
mina-local-network-1 | + perf archive src/lib/provable/test/primitives.test.ts.perf.data
420-
mina-local-network-1 | Now please run:
421-
mina-local-network-1 |
422-
mina-local-network-1 | $ tar xvf src/lib/provable/test/primitives.test.ts.perf.data.tar.bz2 -C ~/.debug
410+
### Using docker images to run jobs
423411

424-
```
412+
Then we take the resulting url of the docker image produces and pass it into
413+
the job defined here ["run Perf Test and collect data" .github/workflows/run-docker-tests.yml](.github/workflows/run-docker-tests.yml)
414+
to use the docker image
425415

416+
### Useful Commands to download archives locally
426417

427-
# next step
418+
We can download an artifact from github using gh ai to basically authenticate a curl for us.
428419

429-
`perf record -g -F 999 --call-graph dwarf node --perf-basic-prof ./node_modules/.bin/../jest/bin/jest.js src/lib/mina/token.test.ts`
430-
`perf report --stdio > report2.txt`
420+
This is an example of downloading an artifact directly, you can find examples in the github build logs for the jobs
421+
`gh api https://api.github.com/repos/meta-introspector/o1js/actions/artifacts/1961929543/zip > data/perf.data.zip`
422+
423+
In This version it contains perf.data.tar.gz, we have evolved the artifact contents so it will change to slightly different names in future versions. This documentation needs to be edited again to reflect that.
424+
425+
# next step
431426

432-
`clinic doctor -- node --perf-basic-prof ./node_modules/.bin/../jest/bin/jest.js src/lib/mina/token.test.ts`
427+
See run-all-tests.sh for how we record and report on tests using clinic and perf and other tools as we add them.

docker-compose.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ version: '3'
33
services:
44
mina-local-network:
55
restart: no
6-
image: o1js-build
6+
#image: o1js-build
7+
image: ghcr.io/meta-introspector/o1js/o1js-perf-recording:latest
78
build: .
89
privileged: true
910
environment:

perf-reporting/Dockerfile

-49
This file was deleted.

perf-reporting/Dockerfile.github

-10
This file was deleted.

0 commit comments

Comments
 (0)