|
1 |
| -FROM ocaml/opam:debian-ocaml-5.3 |
| 1 | +FROM ocaml/opam:debian-ocaml-5.2 |
2 | 2 | WORKDIR /bench-dir
|
3 |
| -RUN sudo apt-get update && \ |
4 |
| - sudo apt-get install -qq -yy --no-install-recommends pkg-config libgmp-dev \ |
5 |
| - wget |
| 3 | + |
| 4 | +RUN sudo apt-get update \ |
| 5 | + && sudo apt-get install -qq -yy --no-install-recommends \ |
| 6 | + pkg-config libgmp-dev jq time |
| 7 | + |
6 | 8 | RUN sudo ln -sf /usr/bin/opam-2.3 /usr/bin/opam
|
7 |
| -RUN opam remote add origin https://github.com/ocaml/opam-repository.git && \ |
8 |
| - opam update |
9 |
| -RUN wget -q https://nodejs.org/download/v8-canary/v24.0.0-v8-canary2025030537242e55ac/node-v24.0.0-v8-canary2025030537242e55ac-linux-x64.tar.xz && \ |
10 |
| - tar xf node-v24.0.0-v8-canary2025030537242e55ac-linux-x64.tar.xz |
11 |
| -ENV PATH="/bench-dir/node-v24.0.0-v8-canary2025030537242e55ac-linux-x64/bin:$PATH" |
12 |
| -RUN wget -q https://github.com/WebAssembly/binaryen/releases/download/version_122/binaryen-version_122-x86_64-linux.tar.gz && \ |
13 |
| - tar xf binaryen-version_122-x86_64-linux.tar.gz |
14 |
| -ENV PATH="/bench-dir/binaryen-version_122/bin:$PATH" |
| 9 | +RUN opam remote add origin https://github.com/ocaml/opam-repository.git \ |
| 10 | + && opam update |
| 11 | + |
| 12 | +# Install node |
| 13 | +ENV NODE_VERSION=v24.0.0-v8-canary2025030537242e55ac |
| 14 | +ENV NODE=node-$NODE_VERSION-linux-x64 |
| 15 | +RUN curl -q https://nodejs.org/download/v8-canary/$NODE_VERSION/$NODE.tar.xz \ |
| 16 | + | tar xJf - |
| 17 | +ENV PATH="/bench-dir/$NODE/bin:$PATH" |
| 18 | + |
| 19 | +# Install binaryen |
| 20 | +ENV BINARYEN_VERSION=version_122 |
| 21 | +ENV BINARYEN=binaryen-$BINARYEN_VERSION |
| 22 | +RUN curl -Lq https://github.com/WebAssembly/binaryen/releases/download/$BINARYEN_VERSION/$BINARYEN-x86_64-linux.tar.gz \ |
| 23 | + | tar zxf - |
| 24 | +ENV PATH="/bench-dir/$BINARYEN/bin:$PATH" |
15 | 25 | RUN opam install --fake binaryen-bin
|
| 26 | + |
| 27 | +# Jane Street opam packages |
| 28 | +RUN mkdir janestreet \ |
| 29 | + && cd janestreet \ |
| 30 | + && git clone --depth 20 https://github.com/janestreet/opam-repository \ |
| 31 | + && cd opam-repository \ |
| 32 | + && git checkout 41c89c7824533f6b63cc5b6d75e6ddb1441d1520 \ |
| 33 | + && opam remote add js . |
| 34 | + |
| 35 | +# Install dependencies |
16 | 36 | COPY --chown=opam:opam ./*.opam ./
|
17 | 37 | RUN opam pin -yn --with-version=dev .
|
18 | 38 | RUN opam install -y --deps-only js_of_ocaml-compiler
|
| 39 | + |
| 40 | +# Install js_of_ocaml / wasm_of_ocaml |
19 | 41 | COPY --chown=opam:opam . ./
|
20 | 42 | RUN opam install -y wasm_of_ocaml-compiler
|
| 43 | + |
| 44 | +# Compile partial render table benchmark |
| 45 | +RUN opam install opam-format stringext uucp cstruct |
| 46 | +RUN opam exec -- dune exec tools/ci_setup.exe janestreet . |
| 47 | +RUN opam install ppxlib.0.35.0 # temporary workaround |
| 48 | +RUN cd janestreet/lib/bonsai_web_components && git config pull.rebase true && git pull |
| 49 | +RUN eval $(opam env) \ |
| 50 | + && dune build --root janestreet --profile release lib/bonsai_web_components/partial_render_table/bench/bin/main.bc.wasm.js lib/bonsai_web_components/partial_render_table/bench/bin/main.bc.js |
| 51 | +RUN cp -r janestreet/_build/default/lib/bonsai_web_components/partial_render_table/bench/bin/main.bc.* ./benchmarks/benchmark-partial-render-table |
| 52 | + |
| 53 | +# CAMLBOY |
| 54 | +RUN opam install brr \ |
| 55 | + && git clone --depth 1 https://github.com/ocaml-wasm/CAMLBOY -b node \ |
| 56 | + && cd CAMLBOY \ |
| 57 | + && opam exec -- dune build --root . --profile release ./bin/web |
| 58 | + |
21 | 59 | WORKDIR ./benchmarks
|
0 commit comments