Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ In this order, since each step builds on the previous one:
`requirements.txt`, build and push your image from `tools/Dockerfile`, and
set `docker_image` in `competition.yaml`. `codabench-benchopt-gpu` is the
CUDA variant, for a self-hosted GPU worker.
Once the challenge runs, add a package to `extra-deps.txt` and build
`tools/Dockerfile.extra`: it installs the package on top of the running
image without upgrading what is already there, so scored submissions keep
their stack.
6. **Pages, dates and quotas** in `pages/` and `competition.yaml`. The
Participate page summarizes the notebook.

Expand Down
2 changes: 2 additions & 0 deletions extra-deps.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Dependencies added during the challenge. tools/Dockerfile.extra installs
# them on top of the running image without moving the packages it holds.
5 changes: 5 additions & 0 deletions pages/participate.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ platform **trains your code**, once per fold, then evaluates it. Copy
`benchmark/solvers/random-forest.py`, a working baseline, to
`my_submission/submission.py`.

The platform installs nothing at submission time: `submission.py` can only
import the packages of `requirements.txt`, and a solver's benchopt
`requirements` are ignored. To use another package, open a pull request on
the challenge repository that adds it to `extra-deps.txt`.

## Run it locally, same code as the server

`local_config.yml` sets the dataset, the solvers, the seed and the 5 folds
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
benchopt>=1.10
pandas
scikit-learn
# Dependencies added once the challenge runs (installed on top of its image).
-r extra-deps.txt
2 changes: 1 addition & 1 deletion tools/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
ARG BASE=ghcr.io/x-datascience-datacamp/codabench-benchopt
FROM ${BASE}

COPY requirements.txt /tmp/requirements.txt
COPY requirements.txt extra-deps.txt /tmp/
RUN pip install --no-cache-dir -r /tmp/requirements.txt
14 changes: 14 additions & 0 deletions tools/Dockerfile.extra
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Adds extra-deps.txt to the running image without a full rebuild: the
# installed packages are frozen as constraints, so pip cannot upgrade them and
# fails instead of moving the stack under scored submissions. Build from the
# repo root, with IMAGE the running image pinned by digest so rebuilds do not
# stack on each other, and push under the docker_image tag:
#
# docker build -f tools/Dockerfile.extra -t <dockerhub-user>/<competition>:v1 \
# --build-arg IMAGE=<dockerhub-user>/<competition>@sha256:<digest> .
ARG IMAGE
FROM ${IMAGE}

COPY extra-deps.txt /tmp/extra-deps.txt
RUN pip list --format=freeze > /tmp/frozen.txt && \
pip install --no-cache-dir -r /tmp/extra-deps.txt -c /tmp/frozen.txt
Loading