Skip to content

Commit fda56ab

Browse files
authored
Merge pull request #2235 from codalab/update-doc
Improve documentation
2 parents 046d57b + 44022dd commit fda56ab

File tree

11 files changed

+231
-38
lines changed

11 files changed

+231
-38
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
!!! note "After upgrading from Codabench <1.20, you will need to rebuild containers, run Django migrations and upgrade compute workers."
2+
3+
1. Rebuild containers
4+
5+
```sh
6+
docker compose build
7+
docker compose up -d
8+
```
9+
10+
2. Run migrations and collect static
11+
12+
```sh
13+
docker compose exec django ./manage.py makemigrations
14+
docker compose exec django ./manage.py migrate
15+
docker compose exec django ./manage.py collectstatic --noinput
16+
```
17+
18+
3. Upgrade compute workers
19+
20+
For every compute worker associated to the instance (default queue) or to a custom queue, you need to update the worker:
21+
22+
```sh
23+
<ssh into worker>
24+
docker compose down
25+
docker compose up -d --pull always
26+
```
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
!!! note "After upgrading from Codabench <1.23.0, you will need to perform manual interventions."
2+
3+
4+
## Django
5+
The Django version upgrade will require all the containers to be rebuilt:
6+
```sh
7+
docker compose build --no-cache
8+
docker compose up -d
9+
```
10+
11+
Afterward, you will need to run some migrations:
12+
```sh
13+
docker compose exec django python manage.py migrate
14+
```
15+
If it asks you to do a makemigration instead, you will have to run the following command:
16+
```sh
17+
docker compose exec django python manage.py makemigrations --merge
18+
```
19+
You might need to modify `/app/src/apps/datasets/migrations/0014_merge_20251212_0942.py` to remove the `datagroup` changes
20+
```python
21+
# Generated by Django 4.2.23 on 2025-09-08 12:32
22+
23+
from django.db import migrations, models
24+
import utils.data
25+
import utils.storage
26+
27+
class Migration(migrations.Migration):
28+
29+
dependencies = [
30+
("datasets", "0010_auto_20250218_1100"),
31+
]
32+
33+
operations = [
34+
migrations.AlterField(
35+
model_name="data",
36+
name="data_file",
37+
field=models.FileField(
38+
blank=True,
39+
null=True,
40+
storage=utils.storage.PrivateStorageClass(),
41+
upload_to=utils.data.PathWrapper("dataset"),
42+
),
43+
),
44+
migrations.AlterField(
45+
model_name="data",
46+
name="id",
47+
field=models.BigAutoField(
48+
auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
49+
),
50+
),
51+
]
52+
```
53+
Notice that there are only two migrations in this file instead of 3. Simply delete the last one (it tries to change `datagroups` even after `datagroups` was deleted, which is why it fails)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
!!! note "After upgrading from Codabench <1.22.0, you will need to rebuild containers, run Django migrations and upgrade compute workers."
2+
3+
4+
## Main Instance
5+
Some of the changes will require a migration and `collectstatic` commands to be run:
6+
```sh
7+
docker compose build && docker compose up -d
8+
docker compose exec django python manage.py migrate
9+
docker compose exec django python manage.py collectstatic --no-input
10+
```
11+
12+
13+
There is a new environment variable for the contact email:
14+
```
15+
CONTACT_EMAIL=info@codabench.org
16+
```
17+
Make sure to add it to your `.env` file before launching the containers
18+
19+
## Compute Workers
20+
Major compute workers changes will require updating the Compute Worker images for both Docker and Podman. Podman workers will also need Podman 5.4 minimum to work on the host
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
!!! note "After upgrading from Codabench <1.19, you will need to perform a Django migration ([#1838](https://github.com/codalab/codabench/pull/1838), [#1851](https://github.com/codalab/codabench/pull/1851))"
2+
3+
```bash
4+
docker compose exec django ./manage.py migrate
5+
```
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
!!! note "After upgrading from Codabench <1.21.1, you will need to migrate MinIO, rebuild containers, run Django migrations and upgrade compute workers."
2+
3+
4+
### 1. MinIO migration (depending on setup)
5+
If you are running MinIO locally (defined by `.env` and `docker-compose.yml`), you may require to follow the following MinIO upgrade instructions, to duplicate and mirror your buckets and convert them to the new format:
6+
https://docs.min.io/community/minio-object-store/operations/deployments/baremetal-migrate-fs-gateway.html
7+
8+
### 2. Rebuild all containers
9+
```sh
10+
docker compose build && docker compose up -d
11+
```
12+
13+
### 3. Django migration
14+
15+
```sh
16+
docker compose exec django ./manage.py migrate
17+
```
18+
19+
### 4. Collect static files
20+
21+
```sh
22+
docker compose exec django ./manage.py collectstatic --no-input
23+
```
24+
25+
### 5. Upgrade compute workers
26+
27+
For every compute worker associated to the instance (default queue) or to a custom queue, you need to update the worker:
28+
29+
```sh
30+
<ssh into worker>
31+
docker compose down
32+
docker compose up -d --pull always
33+
```

documentation/docs/Developers_and_Administrators/Upgrading_Codabench/index.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,9 @@ You can find here various manual intervention needed depending on which version
2222
- [Submissions and Participants Counts](Submissions-and-Participants-Counts.md) (version < 1.14.0)
2323
- [Homepage counters](Homepage-counters.md) (version < 1.15.0)
2424
- [User removal](User-removal.md) (version < 1.17.0)
25-
- [Database size Fix](Database-size-fixes.md) (version < 1.18.0)
25+
- [Database size Fix](Database-size-fixes.md) (version < 1.18.0)
26+
- [Hide output](Hide-output.md) (version < 1.19.0)
27+
- [Django 3.0](Django-3.md) (version < 1.20.0)
28+
- [Minio image](Minio-image.md) (version < 1.21.1)
29+
- [Docker-py](Docker-py.md) (version < 1.22.0)
30+
- [Django 4.2](Django-4.md) (version < 1.23.0)

documentation/docs/Organizers/Benchmark_Creation/Advanced-Tutorial.md

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -110,26 +110,7 @@ After the bundle has been uploaded, you will see the screenshot shown below.
110110
![image](../../_attachments/102434028-e182bb00-404e-11eb-9de8-002e4589db66_17528513099222646.png)
111111

112112

113-
114-
## Benchmark Examples
115-
116-
Example bundles for code & dataset competition can be found here:
117-
118-
https://github.com/codalab/competition-examples/tree/master/codabench
119-
120-
### Iris
121-
122-
[Iris Codabench Bundle](https://github.com/codalab/competition-examples/tree/master/codabench/iris) is a simple benchmark involving two phases, code submission and results submission.
123-
124-
### AutoWSL
125-
126-
Two versions of the [Automated Weakly Supervised Learning Benchmark](https://github.com/codalab/competition-examples/tree/master/codabench/autowsl):
127-
- [Code submission benchmark](https://github.com/codalab/competition-examples/tree/master/codabench/autowsl/code_submission)
128-
- [Dataset submission benchmark](https://github.com/codalab/competition-examples/tree/master/codabench/autowsl/dataset_submission)
129-
130-
### Mini-AutoML
131-
132-
[Mini-AutoML Bundle](https://github.com/codalab/competition-examples/tree/master/codabench/mini-automl) is a benchmark template for Codabench, featuring code submission to multiple datasets (tasks).
113+
!!! tip "You can find benchmark templates to start your own project in [Benchmark Examples](Benchmark-Examples.md) page."
133114

134115

135116
## How do I set up submission comments for multiple submissions?
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Example bundles can be found here:
2+
3+
[https://github.com/codalab/competition-examples/tree/master/codabench](https://github.com/codalab/competition-examples/tree/master/codabench)
4+
5+
More details are given below, to help you select the bundle that suits your own requirements. You can easily clone a template and customize it to match your project.
6+
7+
### Iris
8+
9+
[Iris Codabench Bundle](https://github.com/codalab/competition-examples/tree/master/codabench/iris) is a simple benchmark involving two phases, code submission and results submission.
10+
11+
### Classify Wheat Seeds
12+
13+
We propose three versions of the [Classify Wheat Seeds](https://github.com/codalab/competition-examples/tree/master/codabench/wheat_seeds):
14+
- [Result submission bundle](https://github.com/codalab/competition-examples/tree/master/codabench/wheat_seeds/results_submission_bundle), with simple submission of predictions
15+
- [Code submission bundle](https://github.com/codalab/competition-examples/tree/master/codabench/wheat_seeds/code_submission_bundle), with submission of Python algorithm
16+
- [Ingestion during scoring bundle](https://github.com/codalab/competition-examples/tree/master/codabench/wheat_seeds/ingestion_during_scoring_bundle), where ingestion and scoring run in parallel
17+
18+
### Mini-AutoML
19+
20+
[Mini-AutoML Bundle](https://github.com/codalab/competition-examples/tree/master/codabench/mini-automl) is a benchmark template for Codabench, featuring code submission to multiple datasets (tasks).
21+
22+
### AutoWSL
23+
24+
You can find two versions of the [Automated Weakly Supervised Learning Benchmark](https://github.com/codalab/competition-examples/tree/master/codabench/autowsl):
25+
- [Code submission benchmark](https://github.com/codalab/competition-examples/tree/master/codabench/autowsl/code_submission)
26+
- [Dataset submission benchmark](https://github.com/codalab/competition-examples/tree/master/codabench/autowsl/dataset_submission)
27+
28+
### GPU test
29+
30+
[GPU test bundle](https://github.com/codalab/competition-examples/tree/master/codabench/example_GPU) is an example bundle to test if GPUs are available or not. It serves as testing compute workers and does **not** contain any problem to solve.

documentation/docs/Organizers/Benchmark_Creation/Competition-docker-image.md

Lines changed: 48 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ The competition docker image defines the docker environment in which the submiss
33
## Default competition docker image
44

55
The default competition docker image is `codalab/codalab-legacy:py37`.
6-
More information here: https://github.com/codalab/codalab-dockers
6+
More information and base images are available here: https://github.com/codalab/codalab-dockers
77

88

99
## Set up another image
@@ -14,23 +14,56 @@ You can select another docker image:
1414
- In the editor field "Competition Docker image" as shown in the following screenshot:
1515
![](_attachments/b8124291-92ea-4d1d-b743-00fd7a35c313_17534366792118.jpg)
1616

17-
## Building an image
18-
1917
If the default image does not suit your needs (missing libraries, etc.), you can either:
2018

21-
- Select an existing image from DockerHub
19+
- Select any existing image from DockerHub
2220
- Create your own image from scratch
23-
- Create a custom image based on the Codalab image. (more information below)
21+
- Create a custom image based on the CodaLab image (more information below)
22+
23+
## Custom image based on CodaLab image
2424

2525
If you wish to create a custom image based on the Codalab image, you can follow the steps below:
2626

27-
1) Install Docker
28-
2) Sign up to DockerHub
29-
3) `docker run -itd -u root codalab/codalab-legacy:py39 /bin/bash`
30-
4) Use `docker ps` to find running container id
31-
5) Now run `docker exec -it -u root <CONTAINER ID> bash`
32-
6) Install anything you want at the docker container shell (`apt-get install`, `pip install`, etc.)
33-
7) Exit the shell with `exit`
34-
8) `docker commit <CONTAINER ID> username/image:tag`
35-
9) `docker login`
36-
10) `docker push username/image:tag`
27+
#### Preliminary steps
28+
29+
1) Install Docker
30+
2) Sign up to [DockerHub](https://hub.docker.com/)
31+
32+
#### Method 1: update the image from a container
33+
34+
1) Start a container using the base image:
35+
```sh
36+
docker run -itd -u root codalab/codalab-legacy:py39 /bin/bash
37+
```
38+
2) Identify the running container ID using `docker ps`
39+
3) Enter inside the container:
40+
```sh
41+
docker exec -it -u root <CONTAINER ID> bash
42+
```
43+
4) Install anything you want at the docker container shell (`apt-get install`, `pip install`, etc.)
44+
5) Exit the shell with `exit`
45+
6) Push the new version to your DockerHub account:
46+
```sh
47+
docker commit <CONTAINER ID> username/image:tag
48+
docker login
49+
docker push username/image:tag
50+
```
51+
52+
#### Method 2: update the Dockerfile and re-build
53+
54+
1) Download the Dockerfile of the base image:
55+
https://github.com/codalab/codalab-dockers/blob/master/legacy-py39/Dockerfile
56+
57+
2) Edit the file to include any library or program you need
58+
59+
3) Build the image
60+
```sh
61+
docker build -t username/image:tag .
62+
```
63+
64+
4) Push it to your DockerHub account
65+
66+
```sh
67+
docker login
68+
docker push username/image:tag
69+
```

documentation/docs/Organizers/Benchmark_Creation/Getting-started-with-Codabench.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ This getting started tutorial shows a **simple example** of how to create a comp
88
- Download the [sample competition bundle](https://github.com/codalab/competition-examples/blob/master/codabench/wheat_seeds/code_submission_bundle.zip) and the [sample submission](https://github.com/codalab/competition-examples/blob/master/codabench/wheat_seeds/sample_code_submission.zip).
99
- Do not unzip them.
1010

11+
!!! tip "You can find benchmark templates to start your own project in [Benchmark Examples](Benchmark-Examples.md) page."
12+
1113
## Create a competition
1214
- From the front page of [Codabench](https://codabench.org), in the top menu, go to the **Benchmark > Management**
1315
- Click the green **Upload** button at the top right.

0 commit comments

Comments
 (0)