Skip to content

Commit b6347d2

Browse files
author
mike dupont
committed
using simple loops to extend the time
1 parent 8fc12c8 commit b6347d2

12 files changed

+650
-5248
lines changed

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ on:
1313
# add your branch here to auto trigger on push
1414
#- "feature/just_test"
1515
#- "feature/rebase"
16-
- "feature/unit-tests"
17-
pull_request:
18-
branches: [ "collect-perf" ]
16+
- "feature/unit-test-clean"
17+
# pull_request:
18+
# branches: [ "collect-perf" ]
1919
jobs:
2020
build:
2121
strategy:

Dockerfile.local

+8-101
Original file line numberDiff line numberDiff line change
@@ -4,125 +4,32 @@ ENV PATH="$PNPM_HOME:$PATH"
44
RUN corepack enable
55
RUN apt update
66
RUN apt install -y git bzip2
7-
7+
run apt-get install -y linux-perf
88
WORKDIR /app
99

1010
ADD pnpm-lock.yaml pnpm-lock.yaml
1111
ADD package.json package.json
12-
#ADD package-lock.json package-lock.json
13-
ADD tsconfig.examples.json tsconfig.examples.json
12+
ADD package-lock.json package-lock.json
13+
#ADD tsconfig.examples.json tsconfig.examples.json
1414
ADD tsconfig.json tsconfig.json
15-
ADD tsconfig.mina-signer.json tsconfig.mina-signer.json
16-
ADD tsconfig.mina-signer-web.json tsconfig.mina-signer-web.json
17-
ADD tsconfig.node.json tsconfig.node.json
15+
#ADD tsconfig.mina-signer.json tsconfig.mina-signer.json
16+
#ADD tsconfig.mina-signer-web.json tsconfig.mina-signer-web.json
17+
#ADD tsconfig.node.json tsconfig.node.json
1818
ADD tsconfig.test.json tsconfig.test.json
19-
ADD tsconfig.web.json tsconfig.web.json
19+
#ADD tsconfig.web.json tsconfig.web.json
2020
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
2121
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
2222

23-
## now the source is copied
24-
#COPY src /app/src
25-
#COPY tests /app/tests
26-
#COPY benchmark /app/benchmark
27-
#COPY jest /app/jest
28-
#COPY dune-project /app/dune-project
29-
3023
#RUN pnpm ci
3124
RUN corepack enable
3225
RUN corepack prepare pnpm@latest-9 --activate
3326
RUN pnpm install
34-
# "dev": "npx tsc -p tsconfig.test.json && node src/build/copy-to-dist.js",
35-
RUN find
36-
RUN npx tsc -p tsconfig.test.json
37-
38-
#RUN pnpm install "https://github.com/meta-introspector/jest.git"
39-
#RUN pnpm install "https://github.com/meta-introspector/ts-jest.git"
40-
#RUN pnpm install "https://github.com/meta-introspector/node-clinic-doctor"
41-
#RUN pnpm install "https://github.com/meta-introspector/node-clinic"
4227
RUN pnpm install -g clinic
43-
44-
RUN pnpm run build
45-
46-
#RUN apt update
47-
#RUN apt install -y strace
48-
run apt-get install -y linux-perf # move to top
49-
50-
# why is this needed?
51-
RUN ln -s /app/dist /app/src/mina-signer/dist
52-
53-
# '/app/dist/node/bindings/compiled/_node_bindings/plonk_wasm.cjs' imported from /app/dist/node/bindings/js/node/node-backend.js
54-
# found here
55-
#./src/bindings/compiled/node_bindings/plonk_wasm.cjs
56-
#./src/bindings/compiled/_node_bindings/plonk_wasm.cjs
57-
#./dist/node/bindings/compiled/_node_bindings/plonk_wasm.cjs
58-
59-
#run apt-get update
60-
61-
62-
#CMD [ "pnpm", "run", "test" ]
63-
#RUN pnpm run test || echo skip errors
64-
65-
#COPY . /app
66-
WORKDIR /app
67-
6828
FROM base AS prod-deps
6929
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
70-
7130
FROM base AS build
7231
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
73-
RUN pnpm run build
74-
75-
FROM base
76-
#COPY --from=prod-deps /app/node_modules /app/node_modules
77-
#COPY --from=build /app/dist /app/dist
78-
79-
#COPY run-jest-tests.sh /app/run-jest-tests.sh
80-
#COPY jest.config.js /app/jest.config.js
81-
#COPY run-integration-tests.sh /app/run-integration-tests.sh
82-
#COPY run-unit-tests.sh /app/run-unit-tests.sh
83-
#COPY run-all-tests.sh /app/run-all-tests.sh
84-
#COPY run /app/run
85-
#COPY run-debug /app/run-debug
86-
#COPY run-minimal-mina-tests.sh /app/run-minimal-mina-tests.sh
87-
#COPY run-ci-benchmarks.sh /app/run-ci-benchmarks.sh
88-
89-
32+
COPY --from=prod-deps /app/node_modules /app/node_modules
9033
EXPOSE 8000
9134
CMD [ "pnpm", "start" ]
9235

93-
94-
95-
# # Use an official Ubuntu image as a base
96-
# #FROM ubuntu:latest
97-
# FROM o1labs/mina-local-network:compatible-latest-devnet
98-
99-
# # Set the working directory to /app
100-
# WORKDIR /app
101-
102-
# # Install required dependencies
103-
# RUN apt update && apt install -y \
104-
# git \
105-
# curl \
106-
# npm \
107-
# nodejs
108-
109-
# # Install Node.js version 18
110-
# RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
111-
# RUN apt-get install -y nodejs
112-
113-
# # Clone the repository and checkout the specific branch
114-
# RUN git clone https://github.com/meta-introspector/o1js.git .
115-
# RUN git checkout 7647eb9
116-
117-
# # Install npm dependencies
118-
# RUN npm ci
119-
120-
# # Build o1js
121-
# RUN npm run build
122-
123-
# # Expose the port for the web server
124-
# EXPOSE 8080
125-
126-
# # Run the command to start the web server when the container launches
127-
# CMD ["npm", "run", "start"]
128-

README-dev.md

+6
Original file line numberDiff line numberDiff line change
@@ -438,4 +438,10 @@ We want to be able to :
438438
Run with current source code mounted to create a build and execution environment that is defined in docker
439439
but not needing to copy the source code in.
440440

441+
So we first want to run locally with only the package list installed but no real source code
442+
`docker build --progress plain -f Dockerfile.local` We can think of this as a foundational part.
443+
444+
445+
Later when this is all running we want to
441446
Run with a copy of the source code so it is reproducible.
447+

docker-compose.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ services:
7272
target: "/opt/introspector/test/"
7373
- type: bind
7474
source: "."
75-
target: "/app"
75+
target: "/app/"
7676
- type: bind
7777
source: "./output/perf/"
7878
target: "/tmp/perf/"
7979
cap_add:
8080
- SYS_PTRACE
8181
- SYS_ADMIN
8282
# run the test from the mounted source
83-
command: "bash -x /opt/introspector/test/run-all-unit-tests.sh"
83+
command: "bash -x /opt/introspector/test/run-all-unit-tests-local.sh"
8484

8585

8686
reporting:

jest.config.js

-13
This file was deleted.

local_build.sh

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
npx tsc -p tsconfig.test.json
2+
pnpm run build

package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
"jest": "^28.1.3",
8989
"jstat": "^1.9.6",
9090
"minimist": "^1.2.7",
91+
"node-test-runner-utils": "^1.0.11",
9192
"pkg-pr-new": "^0.0.9",
9293
"prettier": "^2.8.4",
9394
"replace-in-file": "^6.3.5",
@@ -96,7 +97,7 @@
9697
"typedoc": "^0.25.8",
9798
"typedoc-plugin-markdown": "^4.0.0-next.53",
9899
"typedoc-plugin-merge-modules": "^5.1.0",
99-
"typescript": "^5.4.5"
100+
"typescript": "^5.5.4"
100101
},
101102
"dependencies": {
102103
"blakejs": "1.2.1",
@@ -105,5 +106,6 @@
105106
"js-sha256": "^0.9.0",
106107
"reflect-metadata": "^0.1.13",
107108
"tslib": "^2.3.0"
108-
}
109+
},
110+
"packageManager": "pnpm@9.11.0+sha512.0a203ffaed5a3f63242cd064c8fb5892366c103e328079318f78062f24ea8c9d50bc6a47aa3567cabefd824d170e78fa2745ed1f16b132e16436146b7688f19b"
109111
}

0 commit comments

Comments
 (0)