Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
6d57c06
consumer async and template static loading changes
bbearce Jan 16, 2025
f7796a2
flake problems
bbearce Jan 16, 2025
e07bf99
comp participant needs creating
bbearce Jan 16, 2025
85bb7ca
ORM based issues recified.
bbearce Jan 19, 2025
5e58b1c
flake message removal
bbearce Jan 21, 2025
1b3d96a
CONCERN task
bbearce Jan 21, 2025
12701cb
Merge pull request #1814 from codalab/develop
Didayolo Apr 9, 2025
d188aea
Add remove button for cancelled submissions (#1808)
Didayolo Apr 13, 2025
e14bd46
more waits added
bbearce Apr 14, 2025
a6b8def
flake concerns
bbearce Apr 14, 2025
d7a4461
Merge branch 'master' into django_2.2.28_to_3.0.0
bbearce Apr 14, 2025
d7e8580
Update compute_worker.py
Didayolo Apr 16, 2025
6fd40df
Triggering tests with blank line deletion
bbearce Apr 21, 2025
d0a4280
flake
bbearce Apr 22, 2025
69fc1db
circleci resource_class: medium+
bbearce Apr 22, 2025
19b1031
circleci resource_class: large
bbearce Apr 22, 2025
e8b79a6
circleci resource_class: xlarge
bbearce Apr 22, 2025
b2e86d9
Add permissions check for bulk download
Didayolo Apr 22, 2025
f120f09
flake8 fix
Didayolo Apr 22, 2025
b714a60
Merge pull request #1830 from codalab/worker-timeout-message
Didayolo Apr 23, 2025
78f5a76
Merge pull request #1834 from codalab/fix-download-permission
Didayolo Apr 23, 2025
5f167a7
Add hide_score_output option (#1838)
Didayolo Apr 29, 2025
c1884de
code removed that was copying submission files to predictions dir
ihsaan-ullah May 5, 2025
99e9704
hail mary
bbearce May 7, 2025
c0b9d44
flake
bbearce May 7, 2025
882dd5a
config
bbearce May 7, 2025
578f5cc
version update workflow removed
ihsaan-ullah May 12, 2025
929a6cb
Merge pull request #1847 from codalab/manual_versioning
Didayolo May 14, 2025
02694da
Add hide_prediction_output feature
Didayolo May 14, 2025
200a683
Calendar lock fixed, additional check added for start and end date
ihsaan-ullah May 15, 2025
9376366
Simplify code
Didayolo May 15, 2025
4d99dc7
Merge pull request #1852 from codalab/end_date
Didayolo May 15, 2025
b8bba75
Version bump
May 15, 2025
ff8ab57
Removed time and updated date to today
May 15, 2025
90227a0
Merge pull request #1851 from codalab/hide_prediction_output
Didayolo May 15, 2025
0108a9f
Merge pull request #1855 from codalab/versionbump
Didayolo May 15, 2025
632111a
Caddy image update
May 22, 2025
79091f4
fix Caddyfile indentation
curious-broccoli May 27, 2025
450b70a
Merge pull request #1863 from curious-broccoli/format-caddyfile
Didayolo May 27, 2025
16d73c3
Merge pull request #1841 from codalab/submission_duplicate_in_predict…
Didayolo Jun 5, 2025
3aff869
Merge pull request #1864 from codalab/format-caddyfile
Didayolo Jun 5, 2025
74eb2df
django to 3.2.0 - but still has websocket errors for test_submissions…
bbearce Jun 16, 2025
abcbfe2
Merge pull request #1860 from codalab/caddyUpdate
Didayolo Jun 19, 2025
84b6812
poetry.lock
bbearce Jun 19, 2025
9b0d3df
removing submissions to pass circleci
bbearce Jun 19, 2025
c2d57ad
Do not allow signup with email with `*` (#1882)
ihsaan-ullah Jun 20, 2025
ac30787
User model filters - remove `deleted` (#1887)
ihsaan-ullah Jun 20, 2025
09f3611
consumer async and template static loading changes
bbearce Jan 16, 2025
7f5ba58
flake problems
bbearce Jan 16, 2025
8657164
comp participant needs creating
bbearce Jan 16, 2025
6a03667
ORM based issues recified.
bbearce Jan 19, 2025
91daa9b
flake message removal
bbearce Jan 21, 2025
0b472e1
CONCERN task
bbearce Jan 21, 2025
01ed4e0
more waits added
bbearce Apr 14, 2025
bad8970
flake concerns
bbearce Apr 14, 2025
6ce4b62
Triggering tests with blank line deletion
bbearce Apr 21, 2025
9e30b5e
flake
bbearce Apr 22, 2025
fcc9a03
circleci resource_class: medium+
bbearce Apr 22, 2025
06d63b1
circleci resource_class: large
bbearce Apr 22, 2025
cdaa3aa
circleci resource_class: xlarge
bbearce Apr 22, 2025
1c0cde4
hail mary
bbearce May 7, 2025
8de51b1
flake
bbearce May 7, 2025
dd2425b
config
bbearce May 7, 2025
f3bbe8e
django to 3.2.0 - but still has websocket errors for test_submissions…
bbearce Jun 16, 2025
ec30ee3
poetry.lock
bbearce Jun 19, 2025
0c72845
removing submissions to pass circleci
bbearce Jun 19, 2025
6e41692
integrate dev branch commit: 2883349
bbearce Jun 26, 2025
3ed442f
forgot a couple changes from the upgrade branch and needed this commi…
bbearce Jun 26, 2025
33f10dd
config.yml for circleci
bbearce Jul 2, 2025
936dfb9
config.yml for circleci
bbearce Jul 2, 2025
8358126
spelling mistake
bbearce Jul 2, 2025
83506e1
timing issues
bbearce Jul 3, 2025
d3c6f63
flake
bbearce Jul 3, 2025
71dd448
timing issues
bbearce Jul 3, 2025
7a32b83
timing issues
bbearce Jul 3, 2025
b28fa3d
timing issues
bbearce Jul 3, 2025
a1a455c
timing issues
bbearce Jul 3, 2025
c8e0864
logger.info -> logger.debug changes
bbearce Jul 3, 2025
2e4aead
test just selenium submissions
bbearce Jul 3, 2025
792a636
time adjustment
bbearce Jul 3, 2025
7bdcfed
separating out submissions to see if one is particulary troublesome
bbearce Jul 3, 2025
c0f5fd3
time adjustment
bbearce Jul 3, 2025
0336cd7
time adjustment
bbearce Jul 3, 2025
507b153
docker images
bbearce Jul 3, 2025
d8f5b8d
submissions in batch
bbearce Jul 3, 2025
adf4714
all
bbearce Jul 3, 2025
3938623
final clean up
bbearce Jul 17, 2025
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: 10 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ jobs:
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: docker pull codalab/codalab-legacy:py37 # not available without "not e2e" tests as they pull ahead of time
- run: docker pull codalab/codalab-legacy:py3 # not available without "not e2e" tests as they pull ahead of time
- run: docker pull vergilgxw/autotable:v2 # not available without "not e2e" tests as they pull ahead of time

- run:
name: pytest
Expand All @@ -48,6 +51,13 @@ jobs:
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

# Example to run specific set of tests (for debugging individual tests from a batch of tests)
# - run:
# name: e2e tests - competitions
# command: docker compose -f docker-compose.yml -f docker-compose.selenium.yml exec django py.test src/tests/functional/test_competitions.py -m e2e
# no_output_timeout: 60m


- store_artifacts:
path: artifacts/

Expand Down
69 changes: 0 additions & 69 deletions .github/workflows/release-version-update.yml

This file was deleted.

13 changes: 6 additions & 7 deletions Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# HTTPS Options
tls {$TLS_EMAIL}


# Test HTTPS setup
# tls {$TLS_EMAIL} {
# ca https://acme-staging-v02.api.letsencrypt.org/directory
Expand All @@ -20,23 +19,23 @@
root /srv
try_files maintenance.on
}
handle @maintenanceModeActive {
handle @maintenanceModeActive {
root * /srv
redir @noRedirect /maintenance.html
file_server {
file_server {
status 503
}
}
}

# Serves static files, should be the same as `STATIC_ROOT` setting:
root * /var/www/django
root * /var/www/django
file_server

@noStatic {
not path /static/*
not path /media/*
}


# Serving dynamic requests:
reverse_proxy @noStatic django:8000
Expand Down
56 changes: 37 additions & 19 deletions compute_worker/compute_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ async def watch_detailed_results(self):
else:
logger.info(time.time() - start)
if time.time() - start > expiration_seconds:
timeout_error_message = f"Detailed results not written to after {expiration_seconds} seconds, exiting!"
timeout_error_message = f"WARNING: Detailed results not written before the execution."
logger.warning(timeout_error_message)
await asyncio.sleep(5)
file_path = self.get_detailed_results_file_path()
Expand All @@ -302,7 +302,9 @@ def get_detailed_results_file_path(self):
async def send_detailed_results(self, file_path):
logger.info(f"Updating detailed results {file_path} - {self.detailed_results_url}")
self._put_file(self.detailed_results_url, file=file_path, content_type='text/html')
async with websockets.connect(self.websocket_url) as websocket:
websocket_url = f"{self.websocket_url}?kind=detailed_results"
logger.info(f"Connecting to {websocket_url} for detailed results")
async with websockets.connect(websocket_url) as websocket:
await websocket.send(json.dumps({
"kind": 'detailed_result_update',
}))
Expand Down Expand Up @@ -390,10 +392,14 @@ async def _send_data_through_socket(self, error_message):
- Docker image pull failure logs
- Execution time limit exceeded logs
"""
logger.info(f"Connecting to {self.websocket_url} to send docker image pull error")
# Create a unique websocket URL for error messages
websocket_url = f"{self.websocket_url}?kind=error_logs"
logger.info(f"Connecting to {websocket_url} to send error message")

logger.info(f"Connecting to {websocket_url} to send docker image pull error")

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

# define websocket errors
websocket_errors = (socket.gaierror, websockets.WebSocketException, websockets.ConnectionClosedError, ConnectionRefusedError)
Expand All @@ -416,7 +422,7 @@ async def _send_data_through_socket(self, error_message):
# no error in websocket message sending
logger.info(f"Error sent successfully through websocket")

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

# close websocket
await websocket.close()
Expand Down Expand Up @@ -500,8 +506,11 @@ async def _run_container_engine_cmd(self, engine_cmd, kind):
}

# Start websocket, it will reconnect in the stdout/stderr listener loop below
logger.info(f"Connecting to {self.websocket_url}")
websocket = await websockets.connect(self.websocket_url)
# This ensures each task has its own independent WebSocket connection
websocket_url = f"{self.websocket_url}?kind={kind}"
logger.debug(f"WORKER_MARKER: Connecting to {websocket_url}")
websocket = await websockets.connect(websocket_url)
# websocket = await websockets.connect(self.websocket_url) # old BB
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
Expand All @@ -522,7 +531,7 @@ async def _readline_or_chunk(stream):
logs = [self.logs[kind][key] for key in ('stdout', 'stderr')]
for value in logs:
try:
out = await asyncio.wait_for(_readline_or_chunk(value["stream"]), timeout=.1)
out = await asyncio.wait_for(_readline_or_chunk(value["stream"]), timeout=0.1)
if out:
value["data"] += out
print("WS: " + str(out))
Expand All @@ -535,32 +544,36 @@ async def _readline_or_chunk(stream):
except asyncio.TimeoutError:
continue
except websocket_errors:
logger.debug("\n\nWebsocket error (line 538)\n\n")
try:
# do we need to await websocket.close() on the old socket? before making a new one probably not?
await websocket.close()
except Exception as e:
logger.error(e)
logger.info(e)
# TODO: catch proper exceptions here..! What can go wrong failing to close?
pass

# try to reconnect a few times
tries = 0
while tries < 3 and not websocket.open:
try:
websocket = await websockets.connect(self.websocket_url)
logger.debug(f"\n\nAttempting to reconnect in 2 seconds (attempt {tries+1}/3)")
websocket = await websockets.connect(websocket_url)
logger.debug(f"\n\nSuccessfully reconnected to {websocket_url}")
except websocket_errors:
logger.error(f"\n\nReconnection attempt {tries+1} failed: {websocket_errors}")
await asyncio.sleep(2)
tries += 1

self.logs[kind]["end"] = time.time()

logger.info(f"Process exited with {proc.returncode}")
logger.info(f"Disconnecting from websocket {self.websocket_url}")
logger.debug(f"Process exited with {proc.returncode}")
logger.debug(f"Disconnecting from websocket {websocket_url}")

# Communicate that the program is closing
self.completed_program_counter += 1

logger.debug(f"WORKER_MARKER: Disconnecting from {websocket_url}, program counter = {self.completed_program_counter}")
await websocket.close()

def _get_host_path(self, *paths):
Expand All @@ -583,7 +596,14 @@ def _get_host_path(self, *paths):

return path

async def _run_program_directory(self, program_dir, kind, can_be_output=False):
async def _run_program_directory(self, program_dir, kind):
"""
Function responsible for running program directory

Args:
- program_dir : can be either ingestion program or program/submission
- kind : either `program` or `ingestion`
"""
# If the directory doesn't even exist, move on
if not os.path.exists(program_dir):
logger.info(f"{program_dir} not found, no program to execute")
Expand All @@ -597,13 +617,11 @@ async def _run_program_directory(self, program_dir, kind, can_be_output=False):
elif os.path.exists(os.path.join(program_dir, "metadata")):
metadata_path = 'metadata'
else:
if can_be_output:
# Display a warning in logs when there is no metadata file in submission/program dir
if kind == "program":
logger.info(
"Program directory missing metadata, assuming it's going to be handled by ingestion "
"program so move it to output"
"Program directory missing metadata, assuming it's going to be handled by ingestion"
)
# Copying so that we don't move a code submission w/out a metadata command
shutil.copytree(program_dir, self.output_dir)
return
else:
raise SubmissionException("Program directory missing 'metadata.yaml/metadata'")
Expand Down Expand Up @@ -815,7 +833,7 @@ def start(self):
logger.info("Running scoring program, and then ingestion program")
loop = asyncio.new_event_loop()
gathered_tasks = asyncio.gather(
self._run_program_directory(program_dir, kind='program', can_be_output=True),
self._run_program_directory(program_dir, kind='program'),
self._run_program_directory(ingestion_program_dir, kind='ingestion'),
self.watch_detailed_results(),
loop=loop,
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.selenium.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ services:
environment:
- SELENIUM_HOSTNAME=selenium
- SUBMISSIONS_API_URL=http://django:36475/api
- WEBSOCKET_ALLOWED_ORIGINS=*
ports:
- 36475:36475

selenium:
image: selenium/standalone-firefox:124.0
image: selenium/standalone-firefox:120.0
volumes:
- ./src/tests/functional/test_files:/test_files/
- ./artifacts:/artifacts/:z
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
# Web Services
#-----------------------------------------------
caddy:
image: caddy:2.8.4
image: caddy:2.10.0
env_file: .env
environment:
- ACME_AGREE=true
Expand Down
Loading