ocurrent / current-bench

Experimental benchmarking infrastructure using OCurrent pipelines
Apache License 2.0
33 stars 17 forks source link

Docker build arguments #336

Closed art-w closed 2 years ago

art-w commented 2 years ago

(This builds on top of https://github.com/ocurrent/current-bench/pull/335 to avoid a merge conflict later)

As noted in https://github.com/ocurrent/current-bench/issues/333 we need to customize the docker build to allow different settings in sandmark nightly. In the environment/*.conf, one can add the optional "build_args" setting:

{
  "repositories": [
    {
      "name": "local/local",
      "worker": "autumn",
      "build_args": ["FOO=42"]
    },

The arguments will be available to the custom bench.Dockerfile. For example, one can simply re-export the build argument as an environment variable:

FROM ocaml/opam
COPY . .
ARG FOO
ENV FOO $FOO

which will make it available at runtime to the make bench command:

bench:
    echo "FOO is ${FOO}"

This should play well with the cron-like scheduling to support the long awaited feature of Quick and Slow benchmarks https://github.com/ocurrent/current-bench/issues/23 : The default make bench would run the quick benchmarks on every modifications (as usual), and a separate worker would run the slow benchmarks on a daily/weekly schedule (by setting an appropriate build argument so that the benchmarking command becomes MODE=slow make bench).