Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
201 commits
Select commit Hold shift + click to select a range
72269dd
do not allow users to rerun all submissions if submissions are more t…
ihsaan-ullah Aug 16, 2023
5b638ea
additional conditions added for queue owner and organizer
ihsaan-ullah Aug 16, 2023
bd3bedd
empty lines removed
ihsaan-ullah Aug 16, 2023
66d66b4
rerun code uncommented
ihsaan-ullah Aug 16, 2023
f92e15f
blessings for shell_plus
bbearce Sep 11, 2023
318db68
http instead of https
ihsaan-ullah Sep 11, 2023
c7826e5
Merge pull request #1153 from codalab/rabbit_flower_links
Didayolo Sep 11, 2023
438de4d
task update and delete option visible to owner only
ihsaan-ullah Sep 14, 2023
2fce7d6
Add help in Files table
Didayolo Sep 14, 2023
7b1742a
Merge pull request #1157 from codalab/task_edit_delete_show_to_owner
Didayolo Sep 14, 2023
b568f68
compute worker crash handled: docker image pull and execution time limit
ihsaan-ullah Sep 17, 2023
0e1511e
env variable added
ihsaan-ullah Sep 18, 2023
99c14b9
Phase dates ui bug removed
ihsaan-ullah Sep 18, 2023
2b43568
ghost files fix
bbearce Sep 18, 2023
2c42be7
Merge pull request #1163 from codalab/phase_data_time
Didayolo Sep 19, 2023
9b0d3ad
cast str to int
dtuantran Sep 19, 2023
a93810c
Update docker-compose.yml
dtuantran Sep 20, 2023
e14d86a
Merge pull request #1168 from codalab/upgrade-rabbitmq
Didayolo Sep 20, 2023
6927700
First guide lines for contributors
acletournel Sep 20, 2023
899e388
Merge pull request #1161 from codalab/compute_worker_crash_handled
Didayolo Sep 21, 2023
ca886b5
Merge pull request #1084 from codalab/rerun_submissions
Didayolo Sep 21, 2023
2e4f026
Merge pull request #1151 from codalab/issue_1150_shellpluss_and_bless…
Didayolo Sep 21, 2023
0ea36ed
Merge pull request #1158 from codalab/add-help-available
Didayolo Sep 21, 2023
134df42
clickable report link added
ihsaan-ullah Sep 22, 2023
b728d06
Merge pull request #1172 from codalab/competition_report
Didayolo Sep 22, 2023
b382905
Create Dockerfile.rabbitmq
dtuantran Oct 4, 2023
e67f3bd
Update .env_sample
dtuantran Oct 4, 2023
cf1b249
Update docker-compose.yml for rabbitmq
dtuantran Oct 4, 2023
9735d39
Update .env_circleci for new timeout variable
dtuantran Oct 4, 2023
dff4d48
Update .env_circleci
dtuantran Oct 4, 2023
3b73b82
Update .env_sample
dtuantran Oct 4, 2023
932672f
Fix f-string (#1176)
Didayolo Oct 4, 2023
4021610
Typos from Ihsan's review
acletournel Oct 4, 2023
54bd3a1
Merge pull request #1181 from codalab/changing-rabbit-connection-timeout
Didayolo Oct 5, 2023
1c3d366
Merge pull request #1165 from codalab/issue1164
Didayolo Oct 5, 2023
8e83308
add file size rows in 2 DB tables
OhMaley Aug 10, 2023
416a9b0
add celery task definitions for storage analytics
OhMaley Aug 10, 2023
a72b5e3
reset computed storage analytics task done
OhMaley Aug 10, 2023
b7993e4
handle file size error
OhMaley Aug 10, 2023
6d5a4cb
create storage analytics snapshot task done
OhMaley Aug 17, 2023
63d71a7
analyse and log database-storage inconsistency
OhMaley Aug 18, 2023
d9a3be2
work on the front-end
OhMaley Sep 22, 2023
36238d0
tab competitions done
OhMaley Sep 26, 2023
5208185
user page done
OhMaley Oct 3, 2023
d95c336
refactoring + display and sort on all pages
OhMaley Oct 4, 2023
bdfba16
fix unit for backups usage
OhMaley Oct 18, 2023
f702532
add export buttons
OhMaley Oct 18, 2023
b375ec8
numeric ordering
bbearce Oct 22, 2023
db4d9ff
circleci commit 1c3d366
bbearce Oct 22, 2023
bac3d69
yaml and watchdog update cw - requirements.txt
bbearce Oct 24, 2023
6cfb7b4
Merge pull request #1193 from codalab/issue_1171
Didayolo Oct 25, 2023
d60859f
Increase timeout and add retries for docker pull
Didayolo Oct 24, 2023
59518bd
Merge pull request #1169 from codalab/contributing_file
Didayolo Oct 25, 2023
98f6acc
Merge pull request #1196 from codalab/fix-na-worker
Didayolo Oct 25, 2023
221d00a
task manager replaced with Resources section
ihsaan-ullah Nov 1, 2023
e379b6f
Merge pull request #1210 from codalab/public_data_starting_kit_info
Didayolo Nov 2, 2023
8a93626
Create ISSUE_TEMPLATE.md
Didayolo Nov 2, 2023
9332bdd
show docker pull or execution time limit error in scoring_std_err whe…
ihsaan-ullah Nov 5, 2023
ebb8bb9
Update CONTRIBUTING.md
Didayolo Nov 9, 2023
d543c62
Update CONTRIBUTING.md
Didayolo Nov 9, 2023
75cf715
cnrs, paris-saclay and lisn logos added to the main banner
ihsaan-ullah Nov 10, 2023
9487139
edit profile, disable email field and remove it from form before send…
ihsaan-ullah Nov 10, 2023
c341a59
svg logos used
ihsaan-ullah Nov 10, 2023
174c6ff
white cnrs logo added
ihsaan-ullah Nov 10, 2023
578bb3a
Merge pull request #1218 from codalab/email_update
Didayolo Nov 10, 2023
e38b1e3
Merge pull request #1219 from codalab/logos
Didayolo Nov 10, 2023
10a819a
in server status, show parent's submission queue for child submissions
ihsaan-ullah Nov 12, 2023
45b6398
default value of has_max_submissions changed to True in Phase table
ihsaan-ullah Nov 13, 2023
6a84ff3
super users can access private competitions without secret key and ca…
ihsaan-ullah Nov 13, 2023
ab17fbc
Merge pull request #1226 from codalab/admin_private_comp
Didayolo Nov 15, 2023
8a459de
Merge pull request #1224 from codalab/num_sub_used
Didayolo Nov 15, 2023
d692ef6
Merge pull request #1222 from codalab/child_submission_queue
Didayolo Nov 15, 2023
5985291
Competition Whitelist Emails feature (#1223)
ihsaan-ullah Nov 20, 2023
4c1d013
Add Chalearn logo to main page (#1233)
Didayolo Nov 20, 2023
1415339
Add merge migration
Didayolo Nov 20, 2023
1f93bbc
Merge pull request #1235 from codalab/merge-migrations
Didayolo Nov 20, 2023
99f339b
add default quota in settings and quota per user un the User model
OhMaley Nov 22, 2023
af60332
add basic api and display
OhMaley Nov 23, 2023
896a3cf
Merge pull request #1247 from OhMaley/feature/storage/monitoring-tool
Didayolo Nov 28, 2023
491a64d
check on submission upload done
OhMaley Nov 29, 2023
ab64b08
add visual feedback on bulndle upload quota error
OhMaley Nov 29, 2023
d70f66e
Add RabbitMQ http proxy environment variables example
dtuantran Dec 12, 2023
3a188f6
Add http proxy environment variables for rabbitmq
dtuantran Dec 12, 2023
cfeea10
No need ":" for default value
dtuantran Dec 12, 2023
0311135
Merge pull request #1248 from codalab/monitoring-tool
ihsaan-ullah Dec 14, 2023
9ecd29a
Merge pull request #1251 from OhMaley/feature/storage/user-quota
ihsaan-ullah Dec 14, 2023
5bfd601
flake resolved
ihsaan-ullah Dec 14, 2023
aa3edcb
flake fixed
ihsaan-ullah Dec 14, 2023
ed0bd71
solve migration issue
ihsaan-ullah Dec 14, 2023
2b03915
add analytics snapshot date in API response + display it
OhMaley Dec 18, 2023
0efcceb
merged migrations
ihsaan-ullah Dec 21, 2023
ca7500c
fix test
OhMaley Dec 21, 2023
b31ba03
lint
OhMaley Dec 21, 2023
f5f17f2
Merge pull request #1254 from codalab/user-quota
ihsaan-ullah Dec 21, 2023
a1c121e
Merge pull request #1261 from codalab/adding-http-proxy-environment-v…
ihsaan-ullah Dec 21, 2023
78bc24a
partners logos added
ihsaan-ullah Jan 3, 2024
1aaac21
Merge branch 'analytics_snapshot_date' into feature/storage/monitorin…
ihsaan-ullah Jan 3, 2024
9d59890
Merge pull request #1260 from OhMaley/feature/storage/monitoring-tool…
ihsaan-ullah Jan 3, 2024
274a64a
flake white spaces
ihsaan-ullah Jan 3, 2024
cd91d48
Merge pull request #1264 from codalab/partners
ihsaan-ullah Jan 9, 2024
d10d239
idf logo place changed
ihsaan-ullah Jan 9, 2024
6812066
Merge pull request #1267 from codalab/logo_idf
ihsaan-ullah Jan 9, 2024
9045a3a
fix time to reference created_at vs at_date
bbearce Jan 16, 2024
1a12fb4
Merge pull request #1265 from codalab/analytics_snapshot_date
ihsaan-ullah Jan 16, 2024
1bc1fec
Update submissions.py
ihsaan-ullah Jan 18, 2024
b16492b
More logs when docker pull fails in compute_worker.py
Didayolo Jan 18, 2024
1bd2dca
Merge pull request #1214 from codalab/scoring_error_std
Didayolo Jan 18, 2024
0c74b70
Merge pull request #1283 from codalab/worker-logs
Didayolo Jan 18, 2024
c453702
Add loading animation, lazy loading, hide buttons during loading
Didayolo Jan 20, 2024
92fedf4
Rename public competitions page
Didayolo Jan 20, 2024
0e90e6f
Merge pull request #1285 from codalab/competition_list_loading
Didayolo Jan 20, 2024
ea016e4
Clickable username in participant manager
Didayolo Jan 20, 2024
efa140e
Merge pull request #1287 from codalab/clickable-username
Didayolo Jan 20, 2024
4e3a822
Patch PR #1285 and add show more button in front page
Didayolo Jan 20, 2024
4fc411e
Clickable username in competition header
Didayolo Jan 21, 2024
8f4face
Merge pull request #1291 from codalab/username
Didayolo Jan 21, 2024
e9c8bd3
Replace "date of last entry" by "date"
Didayolo Jan 21, 2024
2a941ab
leaderboard date fixed
ihsaan-ullah Jan 22, 2024
98f7cc5
Merge pull request #1292 from codalab/date-leaderboard
Didayolo Jan 22, 2024
e293f35
quota message details and link to user quote
bbearce Jan 23, 2024
e9ae970
Update quota error messages
Didayolo Jan 23, 2024
ec29a31
Remove warning from submission_upload.tag
Didayolo Jan 23, 2024
4b52220
Merge pull request #1293 from codalab/issue_1280_user_quota_message
Didayolo Jan 23, 2024
9e48021
Rerun submission, display error when a task is deleted and a submissi…
ihsaan-ullah Jan 28, 2024
cb77137
warning message displayed on task deletion
ihsaan-ullah Jan 28, 2024
a9066d5
added env option to disable and enable regular signin and sign up
ihsaan-ullah Feb 1, 2024
f1dd8ae
login html hide `login` title when sign in not enabled
ihsaan-ullah Feb 3, 2024
95bf70c
organization oidc login added
ihsaan-ullah Feb 7, 2024
93a8af6
unused test file removed
ihsaan-ullah Feb 7, 2024
7a3f8ad
files tab: show login if not loggedin + hide available column from no…
ihsaan-ullah Feb 7, 2024
dd3f738
do not delete original submission when are reun is deleted, similarly…
ihsaan-ullah Feb 7, 2024
4ff7b40
Merge pull request #1311 from codalab/submission_rerun_delete_parent
Didayolo Feb 7, 2024
4004cec
http client
ihsaan-ullah Feb 8, 2024
ba021c3
less than and greater than rendering fixed
ihsaan-ullah Feb 8, 2024
b22c8f9
Merge pull request #1301 from codalab/rerun_submission
Didayolo Feb 8, 2024
a40e4e4
Add an example of competition docker image
Didayolo Feb 8, 2024
b56e716
Merge pull request #1315 from codalab/docker-image-example
Didayolo Feb 8, 2024
dbe8f88
warning message added
ihsaan-ullah Feb 9, 2024
ac48c17
show competiitons using the queue
ihsaan-ullah Feb 9, 2024
81c4dc3
Merge pull request #1317 from codalab/queue_used
Didayolo Feb 9, 2024
eb9cc69
Merge pull request #1316 from codalab/task_deletion
Didayolo Feb 9, 2024
4f441b6
Create Codabench Statistics (#1307)
ihsaan-ullah Feb 9, 2024
acf0125
Merge pull request #1310 from codalab/files_tab
Didayolo Feb 9, 2024
61b0149
Logo Icons too big fix (Issue: 1290) (#1306)
bbearce Feb 9, 2024
62358ae
public competitions page error fixed
ihsaan-ullah Feb 10, 2024
8f06015
code simplified
ihsaan-ullah Feb 10, 2024
bfd153f
Merge pull request #1320 from codalab/queue_conflict_public_comp
Didayolo Feb 10, 2024
2546aa0
rerun whole phase, only rerun submissions with no parent (this automa…
ihsaan-ullah Feb 11, 2024
5179ec3
add message in the empty error
ihsaan-ullah Feb 11, 2024
35eaaee
unused import removed
ihsaan-ullah Feb 11, 2024
3513e9e
test fixed, additional test added
ihsaan-ullah Feb 12, 2024
b1d549d
leaderboard number of enteries: exlude failed and cancelled submissions
ihsaan-ullah Feb 14, 2024
52b84d4
Merge pull request #1330 from codalab/leaderboard_num_submissions
Didayolo Feb 15, 2024
bfce6b5
Merge pull request #1323 from codalab/rerun_all_submissions
Didayolo Feb 15, 2024
16579a7
empty error is now shown to participant
ihsaan-ullah Feb 15, 2024
fca617e
empty error resolved
ihsaan-ullah Feb 16, 2024
18f521b
small logo for popular and featured comps on home page
ihsaan-ullah Feb 16, 2024
1490108
privacy link updated
ihsaan-ullah Feb 16, 2024
76e4d2b
html tags in email text
ihsaan-ullah Feb 17, 2024
d38e74c
Merge pull request #1336 from codalab/small_logo
Didayolo Feb 19, 2024
4e5e085
Merge pull request #1324 from codalab/submission_leaderboard
Didayolo Feb 19, 2024
5e424c8
Merge pull request #1339 from codalab/privacy_link
Didayolo Feb 19, 2024
0c2e12a
some changes
ihsaan-ullah Feb 20, 2024
a3787e4
removed caching competitions for the public page
ihsaan-ullah Feb 20, 2024
24526da
unused imports removed
ihsaan-ullah Feb 20, 2024
f6e5a8b
oidc login and signup added
ihsaan-ullah Feb 20, 2024
a4ff842
Merge pull request #1343 from codalab/public_page_comp
Didayolo Feb 21, 2024
68c4983
PhaseSerializer is_final_phase change
bbearce Feb 21, 2024
1ca4c3e
Merge pull request #1344 from codalab/issue_1180_manual_ui_creation
Didayolo Feb 21, 2024
720f014
Add email in .env_sample
Didayolo Feb 22, 2024
6826930
Competition show user display name if available (#1321)
ihsaan-ullah Feb 22, 2024
88c8a89
Competition Auto-Run Submissions (#1294)
ihsaan-ullah Feb 22, 2024
b12fb43
Merge pull request #1340 from codalab/user_email
Didayolo Feb 22, 2024
dba7623
Merge Django migrations
Didayolo Feb 22, 2024
ee8cdbc
Merge pull request #1313 from codalab/latex
Didayolo Feb 27, 2024
9935f2c
oidc flow completed
ihsaan-ullah Mar 4, 2024
ede7d9f
task action buttons fixed
ihsaan-ullah Mar 4, 2024
39c9e5c
Merge pull request #1348 from codalab/task_actions
Didayolo Mar 5, 2024
48cb7f8
Prevent LimitOverrunError with large output lines
cjh1 Mar 5, 2024
48474d9
show GitHub instead of Website for github link in profile
ihsaan-ullah Mar 6, 2024
641a247
Merge pull request #1304 from codalab/oidc
Didayolo Mar 11, 2024
94eaa94
Merge pull request #1353 from codalab/profile_github
Didayolo Mar 11, 2024
f83f94c
Remove unnecessary spaces in .env_sample
Didayolo Mar 13, 2024
0fe72d5
terms and condition check added
ihsaan-ullah Mar 16, 2024
5966fef
Merge branch 'develop' into oidc_2
ihsaan-ullah Mar 16, 2024
f017559
one terms checkbox for all organization login buttons
ihsaan-ullah Mar 31, 2024
1f8bdcd
Merge branch 'oidc_2' of https://github.com/codalab/codabench into oi…
ihsaan-ullah Mar 31, 2024
5a5bf58
Fix CircleCI configuration (#1375)
Didayolo Apr 3, 2024
92d0953
CompetitionSerializer Simple vs Detail
Didayolo Apr 3, 2024
f601b55
Merge pull request #1376 from codalab/comp-serializer
Didayolo Apr 3, 2024
7d33156
Merge branch 'develop' into oidc_2
ihsaan-ullah Apr 4, 2024
66d1a6b
Public competition filtering (#1381)
bbearce Apr 4, 2024
1b4dde2
removed sandbox property from iframe to allow links in the iframe
ihsaan-ullah Apr 11, 2024
df76fd9
Merge pull request #1351 from cjh1/limit-overrun
ihsaan-ullah Apr 11, 2024
df26ec2
Merge pull request #1309 from codalab/oidc_2
Didayolo Apr 11, 2024
362f443
Detailed results title removed
ihsaan-ullah Apr 11, 2024
e2bab19
Merge pull request #1404 from codalab/limit_over_run_outpu
Didayolo Apr 12, 2024
dcd9f03
Merge pull request #1403 from codalab/iframe
Didayolo Apr 12, 2024
2423eb8
Detailed results configuration (#1374)
ihsaan-ullah Apr 12, 2024
403fc2b
Option to hide make submission public button from participants (#1372)
ihsaan-ullah Apr 12, 2024
c3ac800
Submission ID in leaderboard (#1370)
ihsaan-ullah Apr 12, 2024
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
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2
jobs:
test:
machine:
image: ubuntu-2004:2022.07.1
image: ubuntu-2204:2024.01.2
steps:
- checkout

Expand Down Expand Up @@ -34,18 +34,18 @@ jobs:
- run:
name: Build containers and collect static
command: |
docker-compose -f docker-compose.yml -f docker-compose.selenium.yml up -d
docker-compose -f docker-compose.yml -f docker-compose.selenium.yml exec django python manage.py collectstatic --noinput
docker compose -f docker-compose.yml -f docker-compose.selenium.yml up -d
docker compose -f docker-compose.yml -f docker-compose.selenium.yml exec django python manage.py collectstatic --noinput

- run: docker-compose exec django flake8 src/

- run:
name: pytest
command: docker-compose -f docker-compose.yml -f docker-compose.selenium.yml exec django py.test src/ -m "not e2e"
command: docker compose -f docker-compose.yml -f docker-compose.selenium.yml exec django py.test src/ -m "not e2e"

- run:
name: e2e tests
command: docker-compose -f docker-compose.yml -f docker-compose.selenium.yml exec django py.test src/tests/functional/ -m e2e
command: docker compose -f docker-compose.yml -f docker-compose.selenium.yml exec django py.test src/tests/functional/ -m e2e
no_output_timeout: 60m

- store_artifacts:
Expand Down
1 change: 1 addition & 0 deletions .env_circleci
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ RABBITMQ_DEFAULT_USER=rabbit-username
RABBITMQ_DEFAULT_PASS=rabbit-password-you-should-change
RABBITMQ_PORT=5672
RABBITMQ_HOST=rabbit
WORKER_CONNECTION_TIMEOUT=100000000 # milliseconds

FLOWER_BASIC_AUTH=root:password-you-should-change

Expand Down
23 changes: 23 additions & 0 deletions .env_sample
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ RABBITMQ_DEFAULT_USER=rabbit-username
RABBITMQ_DEFAULT_PASS=rabbit-password-you-should-change
RABBITMQ_MANAGEMENT_PORT=15672
RABBITMQ_PORT=5672
WORKER_CONNECTION_TIMEOUT=100000000 # milliseconds
#RABBITMQ_HTTP_PROXY=http://proxy-example:3128
#RABBITMQ_HTTPS_PROXY=http://proxy-example:3128
#RABBITMQ_NO_PROXY=localhost,172.0.0.0/8

FLOWER_PUBLIC_PORT=5555

Expand All @@ -37,6 +41,9 @@ SELENIUM_HOSTNAME=selenium
#EMAIL_HOST_PASSWORD=pass
#EMAIL_PORT=587
#EMAIL_USE_TLS=True
#DEFAULT_FROM_EMAIL="Codabench <noreply@example.com>"
#SERVER_EMAIL=noreply@example.com


# -----------------------------------------------------------------------------
# Storage
Expand All @@ -59,6 +66,22 @@ AWS_STORAGE_PRIVATE_BUCKET_NAME=private
AWS_S3_ENDPOINT_URL=http://minio:9000/
AWS_QUERYSTRING_AUTH=False


# -----------------------------------------------------------------------------
# Limit for re-running submission
# This is used to limit users to rerun submissions
# on default queue when number of submissions are < RERUN_SUBMISSION_LIMIT
# -----------------------------------------------------------------------------
RERUN_SUBMISSION_LIMIT=30


# -----------------------------------------------------------------------------
# Enable or disbale regular email sign-in an sign-up
# -----------------------------------------------------------------------------
ENABLE_SIGN_UP=True
ENABLE_SIGN_IN=True


# # S3 storage example
# STORAGE_TYPE=s3
# AWS_ACCESS_KEY_ID=12312312312312312331223
Expand Down
23 changes: 23 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# HOW YOU CAN CONTRIBUTE TO THE CODABENCH PROJECT

## 1. Being a Codabench user.

- Create a user account on https://codalab.lisn.fr and on https://codabench.org.
- 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
- 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

## 2. Setting a local instance of Codabench.

- 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.
- If needed, you can also look into https://github.com/codalab/codabench/wiki/How-to-deploy-Codabench-on-your-server

## 3. Using one's local instance

- Create your own competition and play with it. You can look at the output logs of each different docker container.
- 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

## 4. Setting an autonomous computer-worker on your PC

- Configure and launch the docker container: https://github.com/codalab/codabench/wiki/Compute-Worker-Management---Setup
- 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
- Assign your own compute-worker to this private queue instead of the default queue.
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
***This is a template, please remove any non-relevant details to your issue***

If you are competition participant:
-----------------------------------

- This Github repository is about the **platform** itself.
- If you problem is specific to a competition, **please contact directly its organizers**.

If you are an organizer and have problem hosting your competition:
------------------------------------------------------------------

- Please post a link to your competition.


If you are having trouble using the site:
-----------------------------------------

- What browser and version are you using?
- What is the URL of the problem? Codalab is an open source project, we may not be supporting the instance you are using!
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ var/
var_*/
certs/
backups/
logs/

src/static/output.css
src/static/output.js
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile.rabbitmq
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM rabbitmq:management
ARG WORKER_CONNECTION_TIMEOUT
RUN echo "consumer_timeout = $WORKER_CONNECTION_TIMEOUT" >> /etc/rabbitmq/conf.d/10-defaults.conf
140 changes: 123 additions & 17 deletions compute_worker/compute_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@
from kombu import Queue, Exchange
from urllib3 import Retry


logger = logging.getLogger()


# -----------------------------------------------
# Celery + Rabbit MQ
# -----------------------------------------------
# Init celery + rabbit queue definitions
app = Celery()
app.config_from_object('celery_config') # grabs celery_config.py
Expand All @@ -38,13 +41,20 @@
]


# -----------------------------------------------
# Directories
# -----------------------------------------------
# Setup base directories used by all submissions
# note: we need to pass this directory to docker-compose so it knows where to store things!
HOST_DIRECTORY = os.environ.get("HOST_DIRECTORY", "/tmp/codabench/")
BASE_DIR = "/codabench/" # base directory inside the container
CACHE_DIR = os.path.join(BASE_DIR, "cache")
MAX_CACHE_DIR_SIZE_GB = float(os.environ.get('MAX_CACHE_DIR_SIZE_GB', 10))


# -----------------------------------------------
# Submission status
# -----------------------------------------------
# Status options for submissions
STATUS_NONE = "None"
STATUS_SUBMITTING = "Submitting"
Expand All @@ -65,6 +75,10 @@
STATUS_FAILED,
)


# -----------------------------------------------
# Container Engine
# -----------------------------------------------
# Setup the container engine that we are using
if os.environ.get("CONTAINER_ENGINE_EXECUTABLE"):
CONTAINER_ENGINE_EXECUTABLE = os.environ.get("CONTAINER_ENGINE_EXECUTABLE")
Expand All @@ -75,9 +89,18 @@
CONTAINER_ENGINE_EXECUTABLE = "docker"


# -----------------------------------------------
# Exceptions
# -----------------------------------------------
class SubmissionException(Exception):
pass

class DockerImagePullException(Exception):
pass

class ExecutionTimeLimitExceeded(Exception):
pass


# -----------------------------------------------------------------------------
# The main compute worker entrypoint, this is how a job is ran at the highest
Expand All @@ -94,6 +117,8 @@ def run_wrapper(run_args):
if run.is_scoring:
run.push_scores()
run.push_output()
except DockerImagePullException as e:
run._update_status(STATUS_FAILED, str(e))
except SubmissionException as e:
run._update_status(STATUS_FAILED, str(e))
except SoftTimeLimitExceeded:
Expand Down Expand Up @@ -160,14 +185,14 @@ def is_valid_zip(zip_path):
return False


class ExecutionTimeLimitExceeded(Exception):
pass


def alarm_handler(signum, frame):
raise ExecutionTimeLimitExceeded


# -----------------------------------------------
# Class Run
# Respnosible for running a submission inside a docker container
# -----------------------------------------------
class Run:
"""A "Run" in Codalab is composed of some program, some data to work with, and some signed URLs to upload results
to. There is also a secret key to do special commands for just this submission.
Expand Down Expand Up @@ -309,7 +334,7 @@ def _update_submission(self, data):

logger.info(f"Updating submission @ {url} with data = {data}")

resp = self.requests_session.patch(url, data, timeout=15)
resp = self.requests_session.patch(url, data, timeout=150)
if resp.status_code == 200:
logger.info("Submission updated successfully!")
else:
Expand All @@ -335,13 +360,69 @@ def _update_status(self, status, extra_information=None):

def _get_container_image(self, image_name):
logger.info("Running pull for image: {}".format(image_name))
retries, max_retries = (0, 3)
while retries < max_retries:
try:
cmd = [CONTAINER_ENGINE_EXECUTABLE, 'pull', image_name]
container_engine_pull = check_output(cmd)
logger.info("Pull complete for image: {0} with output of {1}".format(image_name, container_engine_pull))
break # Break if the loop is successful
except CalledProcessError as pull_error:
retries += 1
if retries >= max_retries:
error_message = f"Pull for image: {image_name} returned a non-zero exit code! Check if the docker image exists on docker hub. {pull_error}"
logger.info(error_message)
# Prepare data to be sent to submissions api
docker_pull_fail_data = {
"type": "Docker_Image_Pull_Fail",
"error_message": error_message,
"is_scoring": self.is_scoring
}
# Send data to be written to ingestion logs
self._update_submission(docker_pull_fail_data)
# Send error through web socket to the frontend
asyncio.run(self._send_data_through_socket(error_message))
raise DockerImagePullException(f"Pull for {image_name} failed!")
else:
logger.info("Failed. Retrying in 5 seconds...")
time.sleep(5) # Wait 5 seconds before retrying

async def _send_data_through_socket(self, error_message):
"""
This function gets an error messages and sends it through a web socket. This function is used for sending
- Docker image pull failure logs
- Execution time limit exceeded logs
"""
logger.info(f"Connecting to {self.websocket_url} to send docker image pull error")

# connect to web socket
websocket = await websockets.connect(self.websocket_url)

# define websocket errors
websocket_errors = (socket.gaierror, websockets.WebSocketException, websockets.ConnectionClosedError, ConnectionRefusedError)

try:
cmd = [CONTAINER_ENGINE_EXECUTABLE, 'pull', image_name]
container_engine_pull = check_output(cmd)
logger.info("Pull complete for image: {0} with output of {1}".format(image_name, container_engine_pull))
except CalledProcessError:
logger.info("Pull for image: {} returned a non-zero exit code!")
raise SubmissionException(f"Pull for {image_name} failed!")
# send message
await websocket.send(json.dumps({
"kind": "stderr",
"message": error_message
}))

except websocket_errors:
# handle websocket errors
logger.info(f"Error sending failed through websocket")
try:
await websocket.close()
except Exception as e:
logger.error(e)
else:
# no error in websocket message sending
logger.info(f"Error sent successfully through websocket")

logger.info(f"Disconnecting from websocket {self.websocket_url}")

# close websocket
await websocket.close()

def _get_bundle(self, url, destination, cache=True):
"""Downloads zip from url and unzips into destination. If cache=True then url is hashed and checked
Expand Down Expand Up @@ -384,7 +465,7 @@ def _get_bundle(self, url, destination, cache=True):
raise # Re-raise the last caught BadZipFile exception
else:
logger.info("Failed. Retrying in 60 seconds...")
time.sleep(60) # Wait 60 seconds before retrying
time.sleep(60) # Wait 60 seconds before retrying
# Return the zip file path for other uses, e.g. for creating a MD5 hash to identify it
return bundle_file

Expand Down Expand Up @@ -426,12 +507,25 @@ async def _run_container_engine_cmd(self, engine_cmd, kind):
websocket = await websockets.connect(self.websocket_url)
websocket_errors = (socket.gaierror, websockets.WebSocketException, websockets.ConnectionClosedError, ConnectionRefusedError)

# Function to read a line, if the line is larger than the buffer size we will
# return the buffer so we can continue reading until we get a newline, rather
# than getting a LimitOverrunError
async def _readline_or_chunk(stream):
try:
return await stream.readuntil(b"\n")
except asyncio.exceptions.IncompleteReadError as e:
# Just return what has been read so far
return e.partial
except asyncio.exceptions.LimitOverrunError as e:
# If we get a LimitOverrunError, we will return the buffer so we can continue reading
return await stream.read(e.consumed)

while any(v["continue"] for k, v in self.logs[kind].items() if k in ['stdout', 'stderr']):
try:
logs = [self.logs[kind][key] for key in ('stdout', 'stderr')]
for value in logs:
try:
out = await asyncio.wait_for(value["stream"].readline(), timeout=.1)
out = await asyncio.wait_for(_readline_or_chunk(value["stream"]), timeout=.1)
if out:
value["data"] += out
print("WS: " + str(out))
Expand Down Expand Up @@ -610,7 +704,7 @@ def _put_dir(self, url, directory):
start_time = time.time()
zip_path = make_archive(os.path.join(self.root_dir, str(uuid.uuid4())), 'zip', directory)
duration = time.time() - start_time
logger.info("Time needed to zip archive: {duration} seconds.")
logger.info(f"Time needed to zip archive: {duration} seconds.")
if is_valid_zip(zip_path): # Check zip integrity
self._put_file(url, file=zip_path) # Send the file
break # Leave the loop in case of success
Expand All @@ -627,7 +721,7 @@ def _put_file(self, url, file=None, raw_data=None, content_type='application/zip
"""
if file and raw_data:
raise Exception("Cannot put both a file and raw_data")

headers = {
# For Azure only, other systems ignore these headers
'x-ms-blob-type': 'BlockBlob',
Expand Down Expand Up @@ -731,7 +825,19 @@ def start(self):
try:
loop.run_until_complete(gathered_tasks)
except ExecutionTimeLimitExceeded:
raise SubmissionException(f"Execution Time Limit exceeded. Limit was {self.execution_time_limit} seconds")
error_message = f"Execution Time Limit exceeded. Limit was {self.execution_time_limit} seconds"
logger.info(error_message)
# Prepare data to be sent to submissions api
execution_time_limit_exceeded_data = {
"type": "Execution_Time_Limit_Exceeded",
"error_message": error_message,
"is_scoring": self.is_scoring
}
# Send data to be written to ingestion/scoring std_err
self._update_submission(execution_time_limit_exceeded_data)
# Send error through web socket to the frontend
asyncio.run(self._send_data_through_socket(error_message))
raise SubmissionException(error_message)
finally:
self.watch = False
for kind, logs in self.logs.items():
Expand Down
Loading