competitions-v2

Overview

Codabench

(formerly Codalab Competitions v2)

Installation

$ cp .env_sample .env
$ docker-compose up -d
$ docker-compose exec django ./manage.py migrate
$ docker-compose exec django ./manage.py generate_data
$ docker-compose exec django ./manage.py collectstatic --noinput

You can now login as username "admin" with password "admin" at http://localhost:8000

If you ever need to reset the database, use the script ./reset_db.sh

Running tests

# Non "end to end tests"
$ docker-compose exec django py.test -m "not e2e"

# "End to end tests" (a shell script to launch a selenium docker container)
$ ./run_selenium_tests.sh

# If you are on Mac OSX it is easy to watch these tests, no need to install
# anything just do:
$ open vnc://0.0.0.0:5900

# And login with password "secret"

Example competitions

The repo comes with a couple examples that are used during tests:

v2 test data

src/tests/functional/test_files/submission.zip
src/tests/functional/test_files/competition.zip

v1.5 legacy test data

src/tests/functional/test_files/submission15.zip
src/tests/functional/test_files/competition15.zip

Other Codalab Competition examples

https://github.com/codalab/competition-examples/tree/master/v2/

Building compute worker

To build the normal image:

docker build -t codalab/competitions-v2-compute-worker:latest -f Dockerfile.compute_worker .

To build the GPU version:

docker build -t codalab/competitions-v2-compute-worker:nvidia -f Dockerfile.compute_worker_gpu .

Updating the image

docker push codalab/competitions-v2-compute-worker

Worker setup

# install docker
$ curl https://get.docker.com | sudo sh
$ sudo usermod -aG docker $USER

# >>> reconnect <<<

Start CPU worker

Make a file .env and put this in it:

# Queue URL
BROKER_URL=
   
    

# Location to store submissions/cache -- absolute path!
HOST_DIRECTORY=/your/path/to/codabench/storage

# If SSL is enabled, then uncomment the following line
#BROKER_USE_SSL=True

   

NOTE /your/path/to/codabench -- this path needs to be volumed into /codabench on the worker, as you can see below.

$ docker run \
    -v /your/path/to/codabench/storage:/codabench \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -d \
    --env-file .env \
    --restart unless-stopped \
    --log-opt max-size=50m \
    --log-opt max-file=3 \
    codalab/competitions-v2-compute-worker:latest 

Start GPU worker

nvidia installation instructions

$ nvidia-docker run \
    -v /your/path/to/codabench/storage:/codabench \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v /var/lib/nvidia-docker/nvidia-docker.sock:/var/lib/nvidia-docker/nvidia-docker.sock \
    -d \
    --env-file .env \
    --restart unless-stopped \
    --log-opt max-size=50m \
    --log-opt max-file=3 \
    codalab/competitions-v2-compute-worker:nvidia 

Worker management

Outside of docker containers install Fabric like so:

pip install fab-classic==1.17.0

Create a server_config.yaml in the root of this repository using:

cp server_config_sample.yaml server_config.yaml

Below is an example server_config.yaml that defines 2 roles comp-gpu and comp-cpu, one with gpu style workers (is_gpu and the nvidia docker_image) and one with cpu style workers

comp-gpu:
  hosts:
    - [email protected]
    - [email protected]
  broker_url: pyamqp://user:pass@host:port/vhost-gpu
  is_gpu: true
  docker_image: codalab/competitions-v2-compute-worker:nvidia

comp-cpu:
  hosts:
    - [email protected]
  broker_url: pyamqp://user:pass@host:port/vhost-cpu
  is_gpu: false
  docker_image: codalab/competitions-v2-compute-worker:latest

You can of course create your own docker_image and specify it here.

You can execute commands against a role:

❯ fab -R comp-gpu status
..
[[email protected]] out: CONTAINER ID        IMAGE                                           COMMAND                  CREATED             STATUS              PORTS               NAMES
[[email protected]] out: 1d318268bee1        codalab/competitions-v2-compute-worker:nvidia   "/bin/sh -c 'celery …"   2 hours ago         Up 2 hours                              hardcore_greider
..

❯ fab -R comp-gpu update
..
(updates workers)

See available commands with fab -l

Comments
  • Bundle uploading/unpacking taking forever

    Bundle uploading/unpacking taking forever

    I'm trying to upload the following bundle to Codalab V2 (prod LRI instance):

    Mortality challenge bundle.

    The uploading seems to work but then the unpacking step never finishes.

    Bug 
    opened by Didayolo 18
  • Queue setup

    Queue setup

    I follow the instruction here https://github.com/codalab/competitions-v2/wiki/Compute-Worker-Management---Setup to setup a new queue (not even a GPU one)

    The command I used was:

    docker run
    -v /var/run/docker.sock:/var/run/docker.sock
    --env BROKER_URL=pyamqp://**
    --name compute_worker
    -d
    --restart unless-stopped
    --log-opt max-size=1m
    --log-opt max-file=3
    codalab/competitions-v2-compute-worker

    The broker url corresponds to the queue I created on v2

    The docker logs shows:

    /usr/local/lib/python3.8/site-packages/celery/platforms.py:800: RuntimeWarning: You're running the worker with supe ruser privileges: this is absolutely not recommended! Please specify a different user using the --uid option. User information: uid=0 euid=0 gid=0 egid=0 warnings.warn(RuntimeWarning(ROOT_DISCOURAGED.format(

    -------------- compute-worker@c3839e9a21b5 v4.4.0 (cliffs) --- ***** ----- -- ******* ---- Linux-5.4.0-1025-gcp-x86_64-with-glibc2.2.5 2021-01-11 07:32:06

    • *** --- * ---
    • ** ---------- [config]
    • ** ---------- .> app: main:0x7f1ef93648e0
    • ** ---------- .> transport: amqp://dd64f051-6cd3-4c4e-a646-ef5980276e1f:**@broker.codabench.org:9001/b348279e-a cb4-4178-8778-a8805f7dda3c
    • ** ---------- .> results: disabled://
    • *** --- * --- .> concurrency: 1 (prefork) -- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker) --- ***** ----- -------------- [queues] .> compute-worker exchange=compute-worker(direct) key=compute-worker

    [tasks] . compute_worker_run [2021-01-11 07:32:07,130: ERROR/MainProcess] consumer: Cannot connect to amqp://dd64f051-6cd3-4c4e-a646-ef5980276e1 f:**@broker.codabench.org:9001/b348279e-acb4-4178-8778-a8805f7dda3c: [Errno 104] Connection reset by peer. Trying again in 2.00 seconds... [2021-01-11 07:32:09,421: ERROR/MainProcess] consumer: Cannot connect to amqp://dd64f051-6cd3-4c4e-a646-ef5980276e1

    Please help with this!

    Blocker 
    opened by NehzUx 12
  • Unable to create compute workers

    Unable to create compute workers

    I have trouble creating compute workers.

    • For the default queue, I struggle to find the broker URL
    • For a custom queue, I have a broker URL of this form:
    pyamqp://26df2d3e-345e-472b-[...]-6e1ae58c4202:6a7f18d6-85a0-455f-[...]-9903297abd15@rabbit:5672/f561486f-803a-[...]-ab79-d8fecb6badf1
    

    Shouldn't the domain appears somewhere here? Like codabench.org instead of rabbit?

    I get the following error:

    [2022-03-28 14:38:15,413: ERROR/MainProcess] consumer: Cannot connect to amqp://26df2d3e-345e-472b-9d41-6e1ae58c4202:**@rabbit:5672/f561486f-803a-4612-ab79-d8fecb6badf1: failed to resolve broker hostname.
    Trying again in 2.00 seconds...
    
    [2022-03-28 14:38:17,438: ERROR/MainProcess] consumer: Cannot connect to amqp://26df2d3e-345e-472b-9d41-6e1ae58c4202:**@rabbit:5672/f561486f-803a-4612-ab79-d8fecb6badf1: failed to resolve broker hostname.
    Trying again in 4.00 seconds...
    

    Or, when I edit the broker URL by hand:

    [2022-03-28 14:34:47,967: ERROR/MainProcess] consumer: Cannot connect to amqp://[...]:**@codabench.org:5672//: [Errno 99] Cannot assign requested address.
    Trying again in 2.00 seconds...
    
    [2022-03-28 14:34:58,097: ERROR/MainProcess] consumer: Cannot connect to amqp://[...]:**@codabench.org:5672//: [Errno 99] Cannot assign requested address.
    Trying again in 4.00 seconds...
    
    P1 Setup Workers / Queues Documentation 
    opened by Didayolo 10
  • Why some submissions are running or submitted forever?

    Why some submissions are running or submitted forever?

    Dear all,

    I have noticed something very strange to me, that is problematic in our implementation of the codabench benchmark (and blocking for the connexion with the meteor webapp).

    I am currently testing things (with small-size datasets) using the competition #183 https://www.codabench.org/competitions/183/#/participate-tab

    The same submission.zip file can be successfully run within few minutes, or stucked forever in 'submitted' or 'running' status. This happens as well when we make submission in bot mode.

    I can't see any error message that would explain this behaviour.

    Do you have an idea of why this is happening and what we should do to solve this issue?

    We are currently trying to set up compute workers with our partner in Heidelberg but they currently struggle to get a public access to their machine. However, I am not sure that this would solve the problem.

    Thanks for your input!

    Magali

    Blocker 
    opened by magrichard 10
  • added toastr instead of modal on ux dump

    added toastr instead of modal on ux dump

    @ mention of reviewers

    @jimmykodes @ckcollab

    A brief description of the purpose of the changes contained in this PR.

    Changed the Modal to a Toastr message once dump has been successful.

    Issues this PR resolves

    resolves #389

    Misc. comments

    I think I did what was needed but just incase i left the code commented to make sure I can revert and adjust

    Checklist

    • [x] Code review by me
    • [x] Hand tested by me
    • [x] I'm proud of my work
    • [x] Code review by reviewer
    • [x] Hand tested by reviewer
    • [x] Ready to merge
    opened by Germs31 10
  • Codalab Competition-V2 webpage not getting rendered properly.

    Codalab Competition-V2 webpage not getting rendered properly.

    I have installed an instance of Codalab Competition-v2 in our institute's cloud VM which is accessible publically at http://141.80.100.203/. However, it seems that the web page is not getting rendered correctly and looks different from the one at https://www.codabench.org/.

    The outputs from executing the installation steps are these -

    $ docker-compose up -d
    
    competitions-v2_minio_1 is up-to-date
    competitions-v2_redis_1 is up-to-date
    competitions-v2_rabbit_1 is up-to-date
    competitions-v2_builder_1 is up-to-date
    competitions-v2_db_1 is up-to-date
    Starting competitions-v2_createbuckets_1 ... 
    competitions-v2_flower_1 is up-to-date
    competitions-v2_django_1 is up-to-date
    competitions-v2_site_worker_1 is up-to-date
    Starting competitions-v2_createbuckets_1 ... done
    
    $ docker-compose exec django ./manage.py migrate
    
    Operations to perform:
      Apply all migrations: admin, auth, authtoken, competitions, contenttypes, datasets, forums, leaderboards, oauth2_provider, profiles, queues, sessions, sites, social_django, tasks
    Running migrations:
      No migrations to apply.
    
    $ docker-compose exec django ./manage.py generate_data
    
    Creating data of size 3 with an admin account.
    
    $ docker-compose exec django ./manage.py collectstatic --noinput
    
    0 static files copied to '/app/src/staticfiles', 269 unmodified.
    
    

    I am unable to figure out the reason behind this partial rendering of the webpage.

    opened by ashwini-kr-sharma 9
  • Added adapt features for v1.8 bundle

    Added adapt features for v1.8 bundle

    Template

    This is a template. While not all sections are necessary, depending on the size and complexity of the PR, more information is better.

    @ mention of reviewers

    @ckcollab @dde6khkg ...

    A brief description of the purpose of the changes contained in this PR.

    ... Added adaptation of v1.8 bundle.

    Issues this PR resolves

    ... enabled v18 bundle create competition and submit solution curr

    Known issues to be addressed in a separate PR

    ...

    A checklist for hand testing

    • [ ] add checklist here

    Any relevant files for testing

    link to any relevant files (or drag and drop into github)

    Misc. comments

    ...

    Checklist

    • [ ] Code review by me
    • [x] Hand tested by me
    • [x] I'm proud of my work
    • [x] Code review by reviewer
    • [x] Hand tested by reviewer
    • [x] Ready to merge
    opened by AuroraLauu 7
  • Isabelle review: phase-to-phase migrations

    Isabelle review: phase-to-phase migrations

    Acceptance

    • [x] Able to enable phase migrations in competition editor
    • [ ] Phase does not migrate when it's already migrating
    • [ ] Phase does not migrate when it is scoring submissions
    • [x] Phase auto-migrates after date passes, submissions are run
    opened by ckcollab 7
  • Submissions blocked (using our own worker)

    Submissions blocked (using our own worker)

    Dear @ckcollab,

    The workers you helped us to set up in Heidleberg are now working. Thanks! I was able to successfully run some submissions (competition 218), with workers properly dimensioned to our benchmark.

    However, I am still facing the eratic behaviour of some submissions being blocked for hours, without knowing why.

    For instance:

    Submission 1811 was created 15 hours ago. Looking at the server status, I see that none of the children subtasks has been created.

    Capture d’écran 2020-12-16 à 08 35 19

    When I click on the submission in the regular competition interface or from the competition admin menu, I get a blank field.

    Capture d’écran 2020-12-16 à 08 34 58

    Blocker Workers / Queues 
    opened by magrichard 6
  • [BUG] lack of feedbacks to debug failed submission

    [BUG] lack of feedbacks to debug failed submission

    Hello,

    I am currently trying to run a competition (link to competition). The bundle (zip) was loaded properly and the competition created. Then, I tried to do a sample submission to test my competition. The submission failed but when I try to look at the logs trough the website I can't see any error (see attached screenshots). I am having difficulties to debug this because I am not even sure about the root of the failure.

    Screenshot 2020-06-29 at 16 30 20 Screenshot 2020-06-29 at 16 30 56 Screenshot 2020-06-29 at 16 31 10
    opened by Deathn0t 6
  • Submission Management Page Wireframe

    Submission Management Page Wireframe

    Resolves #51

    TODO

    • [ ] /static/riot/submissions/submit.tag was old Submission Management tag file. Please check and see if we want to keep the file or remove it from the project.

    Functional testing

    https://competitions-v2-staging-pr-62.herokuapp.com/management/submissions

    opened by BrendanMyers88 6
  • Server error during sign up with special character in the username

    Server error during sign up with special character in the username

    When trying to register with a username containing . or / (maybe other special characters too), we get this error:

    Capture d’écran 2022-12-16 à 18 05 48

    It would be better to have a simple red message like this one:

    Capture d’écran 2022-12-16 à 18 06 39

    I don't know if it is linked with the recent email confirmation feature. Maybe it was there already and we missed it.

    Bug P1 
    opened by Didayolo 0
  • Leaderboard not showing when not logged in

    Leaderboard not showing when not logged in

    You need to be logged in to be able to see the leaderboard.

    We can either:

    • Change this behaviour
    • Add a message instead of the empty leaderboard saying "please login to see the results"
    Enhancement 
    opened by Didayolo 1
  • Detailed results not written to after 60 seconds, exiting!

    Detailed results not written to after 60 seconds, exiting!

    In CodaBench, if the detailed_results.html file is not created, the compute worker stop the execution (without logs on the platform side by the way).

    I guess the idea behind this is to be able to have a look at the detailed results during the execution, in real time.

    This is cool but not really robust. This causes error because usually this file is created at the end of the execution (especially in old CodaLab bundles).

    See:

    https://github.com/codalab/codabench/blob/232490ddf2682b89feedc2f6b907e88110828077/docker/compute_worker/compute_worker.py#L242

    Update: if the detailed_results.html file is empty, it creates a bug.

    I think the file should be created by CodaLab (the compute worker) itself if it does not exist.

    Discussion 
    opened by Didayolo 0
  • Bump pillow from 8.0.1 to 9.3.0

    Bump pillow from 8.0.1 to 9.3.0

    Bumps pillow from 8.0.1 to 9.3.0.

    Release notes

    Sourced from pillow's releases.

    9.3.0

    https://pillow.readthedocs.io/en/stable/releasenotes/9.3.0.html

    Changes

    ... (truncated)

    Changelog

    Sourced from pillow's changelog.

    9.3.0 (2022-10-29)

    • Limit SAMPLESPERPIXEL to avoid runtime DOS #6700 [wiredfool]

    • Initialize libtiff buffer when saving #6699 [radarhere]

    • Inline fname2char to fix memory leak #6329 [nulano]

    • Fix memory leaks related to text features #6330 [nulano]

    • Use double quotes for version check on old CPython on Windows #6695 [hugovk]

    • Remove backup implementation of Round for Windows platforms #6693 [cgohlke]

    • Fixed set_variation_by_name offset #6445 [radarhere]

    • Fix malloc in _imagingft.c:font_setvaraxes #6690 [cgohlke]

    • Release Python GIL when converting images using matrix operations #6418 [hmaarrfk]

    • Added ExifTags enums #6630 [radarhere]

    • Do not modify previous frame when calculating delta in PNG #6683 [radarhere]

    • Added support for reading BMP images with RLE4 compression #6674 [npjg, radarhere]

    • Decode JPEG compressed BLP1 data in original mode #6678 [radarhere]

    • Added GPS TIFF tag info #6661 [radarhere]

    • Added conversion between RGB/RGBA/RGBX and LAB #6647 [radarhere]

    • Do not attempt normalization if mode is already normal #6644 [radarhere]

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    Dependencies 
    opened by dependabot[bot] 0
Owner
CodaLab
CodaLab