Skip to content

Commit 162ef1e

Browse files
authored
Merge pull request #2077 from codalab/develop
Merge Develop into Master (v1.22)
2 parents 36e2f0f + 71370f7 commit 162ef1e

152 files changed

Lines changed: 4044 additions & 2871 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/config.yml

Lines changed: 47 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ version: 2
33
jobs:
44
test:
55
machine:
6-
image: ubuntu-2204:2024.01.2
6+
image: ubuntu-2404:2025.09.1
7+
resource_class: large
78
steps:
89
- checkout
9-
1010
- run:
1111
# NOTE: To connect to this, use an SSH tunnel in front, like so..
1212
#
@@ -22,54 +22,73 @@ jobs:
2222
# x11vnc -forever -nopw
2323
background: true
2424

25-
- run:
25+
- run:
2626
name: "Setup: Copy environment variables"
2727
command: cp .env_circleci .env
2828

29-
3029
- run:
3130
name: "Setup: Create directories for MinIO (cannot be made by docker for some reason)"
3231
command: |
33-
sudo mkdir -p var/minio/public
34-
sudo mkdir -p var/minio/private
32+
mkdir -p var/minio/public
33+
mkdir -p var/minio/private
3534
3635
- run:
37-
name: "Docker: Build containers and collect static files"
36+
name: "Setup: Prepare the playwright environment"
3837
command: |
39-
docker compose -f docker-compose.yml -f docker-compose.selenium.yml up -d
40-
docker compose -f docker-compose.yml -f docker-compose.selenium.yml exec django python manage.py collectstatic --noinput
41-
42-
- run:
43-
name: "Lint: Check code style with flake8"
44-
command: docker-compose exec django flake8 src/
45-
46-
47-
- run:
38+
cd tests
39+
apt update && apt upgrade -y
40+
curl -LsSf https://astral.sh/uv/install.sh | sh
41+
$HOME/.local/bin/uv sync --frozen
42+
$HOME/.local/bin/uv run playwright install
43+
- run:
4844
name: "Docker: Pull required images"
4945
# not available without "not e2e" tests as they pull ahead of time
5046
command: |
51-
docker pull codalab/codalab-legacy:py37
52-
docker pull codalab/codalab-legacy:py3
53-
docker pull vergilgxw/autotable:v2
47+
docker pull codalab/codalab-legacy:py37
48+
docker pull codalab/codalab-legacy:py3
49+
docker pull vergilgxw/autotable:v2
50+
background: true
51+
52+
- run:
53+
name: "Docker: Build containers and collect static files"
54+
command: |
55+
docker compose up -d
56+
docker compose exec django python manage.py collectstatic --noinput
57+
docker compose exec django python manage.py migrate
58+
docker compose exec django python ./manage.py createsuperuser --no-input
59+
60+
- run:
61+
name: "Get compute worker, site worker and django logs"
62+
command: |
63+
mkdir dockerLogs
64+
docker compose logs -f site_worker compute_worker django > dockerLogs/django_workers.log
65+
background: true
66+
67+
- run:
68+
name: "Lint: Check code style with flake8"
69+
command: docker compose exec django flake8 src/
5470

5571
- run:
5672
name: "Tests: Run unit/integration tests (excluding e2e)"
57-
command: docker compose -f docker-compose.yml -f docker-compose.selenium.yml exec django py.test src/ -m "not e2e"
73+
command: docker compose exec django py.test src/ -m "not e2e"
5874

75+
# We give the name of the test files manually because we need test_auth.py to be run before the others for state.json file to be created
76+
# CI="true" to skip some tests that fail in the CI for now
5977
- run:
6078
name: "Tests: Run end-to-end (E2E) tests"
61-
command: docker compose -f docker-compose.yml -f docker-compose.selenium.yml exec django py.test src/tests/functional/ -m e2e
62-
no_output_timeout: 60m
79+
command: |
80+
cd tests && CI="true" $HOME/.local/bin/uv run pytest test_auth.py test_account_creation.py test_competition.py test_submission.py
81+
no_output_timeout: 30m
6382

6483
# Example to run specific set of tests (for debugging individual tests from a batch of tests)
6584
# - run:
66-
# name: e2e tests - competitions
67-
# command: docker compose -f docker-compose.yml -f docker-compose.selenium.yml exec django py.test src/tests/functional/test_competitions.py -m e2e
68-
# no_output_timeout: 60m
69-
70-
85+
# name: "Tests: Run end-to-end (E2E) tests"
86+
# command: cd tests && $HOME/.local/bin/uv run pytest test_auth.py test_competition.py
87+
# no_output_timeout: 30m
88+
- store_artifacts:
89+
path: tests/test-results
7190
- store_artifacts:
72-
path: artifacts/
91+
path: dockerLogs/
7392

7493
workflows:
7594
version: 2

.env_circleci

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,9 @@ AWS_STORAGE_PRIVATE_BUCKET_NAME=private
3232
# NOTE! port 9000 here should match $MINIO_PORT
3333
AWS_S3_ENDPOINT_URL=http://172.17.0.1:9000/
3434
AWS_QUERYSTRING_AUTH=False
35+
DJANGO_SUPERUSER_PASSWORD=codabench
36+
DJANGO_SUPERUSER_EMAIL=test@test.com
37+
DJANGO_SUPERUSER_USERNAME=codabench
38+
DOMAIN_NAME=localhost:80
39+
TLS_EMAIL=your@email.com
40+
SUBMISSIONS_API_URL=http://django:8000/api

.env_sample

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ SELENIUM_HOSTNAME=selenium
4545
#DEFAULT_FROM_EMAIL="Codabench <noreply@example.com>"
4646
#SERVER_EMAIL=noreply@example.com
4747

48+
# Contact Email
49+
CONTACT_EMAIL=info@codabench.org
4850

4951
# -----------------------------------------------------------------------------
5052
# Storage

.github/CONTRIBUTING.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,20 @@
33
## 1. Being a Codabench user.
44

55
- Create a user account on https://codalab.lisn.fr and on https://codabench.org.
6-
- Register on https://codabench.org to this existing competition (IRIS-tuto) https://www.codabench.org/competitions/1115/ and make a submission (from https://github.com/codalab/competition-examples/tree/master/codabench/iris): sample_result_submission and sample_code_submission. See https://github.com/codalab/codabench/wiki/User_Participating-in-a-Competition
7-
- Create your own private competition (from https://github.com/codalab/competition-examples/tree/master/codabench/ ). See https://github.com/codalab/codabench/wiki/Getting-started-with-Codabench
6+
- Register on https://codabench.org to this existing competition (IRIS-tuto) https://www.codabench.org/competitions/1115/ and make a submission (from https://github.com/codalab/competition-examples/tree/master/codabench/iris): sample_result_submission and sample_code_submission. See https://docs.codabench.org/latest/Participants/User_Participating-in-a-Competition/
7+
- Create your own private competition (from https://github.com/codalab/competition-examples/tree/master/codabench/ ). See https://docs.codabench.org/latest/Organizers/Benchmark_Creation/Getting-started-with-Codabench/
88

99
## 2. Setting a local instance of Codabench.
1010

11-
- Follow the tutorial in codabench wiki: https://github.com/codalab/codabench/wiki/Codabench-Installation. According to your hosting OS, you might have to tune your environment file a bit. Try without enabling the SSL protocol (doing so, you don't need a domain name for the server). Try using the embedded Minio storage solution instead of a private cloud storage.
12-
- If needed, you can also look into https://github.com/codalab/codabench/wiki/How-to-deploy-Codabench-on-your-server
11+
- Follow the tutorial in codabench docs: https://docs.codabench.org/latest/Developers_and_Administrators/Codabench-Installation/. According to your hosting OS, you might have to tune your environment file a bit. Try without enabling the SSL protocol (doing so, you don't need a domain name for the server). Try using the embedded Minio storage solution instead of a private cloud storage.
12+
- If needed, you can also look into https://docs.codabench.org/latest/Developers_and_Administrators/How-to-deploy-Codabench-on-your-server/
1313

1414
## 3. Using one's local instance
1515

1616
- Create your own competition and play with it. You can look at the output logs of each different docker container.
17-
- Setting you as an admin of your platform (https://github.com/codalab/codabench/wiki/Administrator-procedures#give-superuser-privileges-to-an-user) and visit the Django Admin menu: https://github.com/codalab/codabench/wiki/Administrator-procedures#give-superuser-privileges-to-an-user
18-
17+
- Setting you as an admin of your platform (https://docs.codabench.org/latest/Developers_and_Administrators/Administrator-procedures/#give-superuser-privileges-to-a-user) and visit the Django Admin menu: https://docs.codabench.org/latest/Developers_and_Administrators/Administrator-procedures/#give-superuser-privileges-to-a-user
1918
## 4. Setting an autonomous computer-worker on your PC
2019

21-
- Configure and launch the docker container: https://github.com/codalab/codabench/wiki/Compute-Worker-Management---Setup
22-
- Create a private queue on your new own competition on the production server codabench.org: https://github.com/codalab/codabench/wiki/Queue-Management#create-queue
20+
- Configure and launch the docker container: https://docs.codabench.org/latest/Organizers/Running_a_benchmark/Compute-Worker-Management---Setup/
21+
- Create a private queue on your new own competition on the production server codabench.org: https://docs.codabench.org/latest/Organizers/Running_a_benchmark/Queue-Management/#create-queue
2322
- Assign your own compute-worker to this private queue instead of the default queue.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: build_CW_docker_image_branch
2+
on:
3+
push:
4+
# On push for every branch except develop and master since they have their own workflows
5+
branches:
6+
- '*'
7+
- '!develop'
8+
- '!master'
9+
paths:
10+
- Dockerfile.compute_worker
11+
- compute_worker/**
12+
jobs:
13+
build_push_image:
14+
name: Build Docker Image then Push it to Docker.io
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Check out repository code
18+
uses: actions/checkout@v5
19+
- name: Build Image
20+
run: docker build -t codalab/codabench-compute-worker:${{ github.ref_name }} -f Dockerfile.compute_worker .
21+
- name: Login to Docker Hub
22+
uses: docker/login-action@v3
23+
with:
24+
username: ${{ vars.DOCKERHUB_USERNAME }}
25+
password: ${{ secrets.DOCKERHUB_TOKEN }}
26+
- name: Push image with branch name as tag
27+
run: docker push codalab/codabench-compute-worker:${{ github.ref_name }}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: build_CW_docker_image_develop
2+
on:
3+
push:
4+
branches:
5+
- develop
6+
paths:
7+
- Dockerfile.compute_worker
8+
- compute_worker/**
9+
jobs:
10+
build:
11+
name: Build Docker Images
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check out repository code
15+
uses: actions/checkout@v5
16+
- name: Build Image
17+
run: docker build -t codalab/codabench-compute-worker:test -f Dockerfile.compute_worker .
18+
- name: Login to Docker Hub
19+
uses: docker/login-action@v3
20+
with:
21+
username: ${{ vars.DOCKERHUB_USERNAME }}
22+
password: ${{ secrets.DOCKERHUB_TOKEN }}
23+
- name: Push image with test tag
24+
run: docker push codalab/codabench-compute-worker:test
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: build_CW_docker_image_branch
2+
on:
3+
push:
4+
tags:
5+
- '*'
6+
paths:
7+
- Dockerfile.compute_worker
8+
- compute_worker/**
9+
jobs:
10+
build:
11+
name: Build Docker Images
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check out repository code
15+
uses: actions/checkout@v5
16+
- name: Build Image
17+
run: docker build -t codalab/codabench-compute-worker:${{ github.ref_name }} -f Dockerfile.compute_worker .
18+
- name: Login to Docker Hub
19+
uses: docker/login-action@v3
20+
with:
21+
username: ${{ vars.DOCKERHUB_USERNAME }}
22+
password: ${{ secrets.DOCKERHUB_TOKEN }}
23+
- name: Push image with prod release tag
24+
run: docker push codalab/codabench-compute-worker:${{ github.ref_name }}
25+
- name: Change tag to latest
26+
run: |
27+
docker tag codalab/codabench-compute-worker:${{ github.ref_name }} codalab/codabench-compute-worker:latest
28+
docker push codalab/codabench-compute-worker:latest
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: build_and_test
2+
on: [push]
3+
jobs:
4+
build:
5+
name: Build necessary services
6+
# runs-on: self-hosted
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Check out repository code
10+
uses: actions/checkout@v5
11+
- name: "Setup: Copy environment variables"
12+
run: cp .env_circleci .env
13+
- name: "Setup: Create directories for MinIO (cannot be made by docker for some reason)"
14+
run: |
15+
mkdir -p var/minio/public
16+
mkdir -p var/minio/private
17+
- name: "Setup: Prepare the playwright environment"
18+
run: |
19+
cd playwrightPython
20+
curl -LsSf https://astral.sh/uv/install.sh | sh
21+
$HOME/.local/bin/uv sync
22+
$HOME/.local/bin/uv run playwright install
23+
- name: "Docker: Build containers and collect static files"
24+
run: |
25+
docker compose -f docker-compose.yml -f docker-compose.selenium.yml up -d
26+
docker compose -f docker-compose.yml -f docker-compose.selenium.yml exec django python manage.py collectstatic --noinput
27+
docker compose -f docker-compose.yml -f docker-compose.selenium.yml exec django python manage.py migrate
28+
docker compose -f docker-compose.yml exec django python ./manage.py createsuperuser --no-input
29+
- name: "Docker: Pull required images"
30+
run: |
31+
docker pull codalab/codalab-legacy:py37
32+
docker pull codalab/codalab-legacy:py3
33+
linter:
34+
name: Flake8 linter
35+
runs-on: self-hosted
36+
needs: [build]
37+
steps:
38+
- name: "Lint: Check code style with flake8"
39+
run: docker compose exec django flake8 src/
40+
unit_tests:
41+
name: Unit test with Selenium
42+
runs-on: self-hosted
43+
needs: [linter,build]
44+
steps:
45+
- name: "Tests: Run unit/integration tests (excluding e2e)"
46+
run: docker compose -f docker-compose.yml -f docker-compose.selenium.yml exec django py.test src/ -m "not e2e"
47+
e2e:
48+
name: End to End tests with Playwright
49+
runs-on: self-hosted
50+
needs: [linter,build]
51+
steps:
52+
- name: "Tests: Run end-to-end (E2E) tests"
53+
run: cd playwrightPython && $HOME/.local/bin/uv run pytest test_auth.py test_account_creation.py test_competition.py test_submission.py
54+
cleanup:
55+
name: Cleanup
56+
runs-on: self-hosted
57+
if: ${{ always() }}
58+
needs: [unit_tests,e2e,linter]
59+
steps:
60+
- name: Cleanup
61+
run: |
62+
docker compose -f docker-compose.yml -f docker-compose.selenium.yml down --rmi all
63+
rm -rf ${{ github.workspace }}/*

Containerfile.compute_worker_podman

Lines changed: 0 additions & 62 deletions
This file was deleted.

Containerfile.compute_worker_podman_gpu

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)