diff --git a/compute_worker/compute_worker.py b/compute_worker/compute_worker.py
index c8bef06d1..152ab2d0e 100644
--- a/compute_worker/compute_worker.py
+++ b/compute_worker/compute_worker.py
@@ -39,9 +39,9 @@
# Setup base directories used by all submissions
-HOST_DIRECTORY = os.environ.get("HOST_DIRECTORY", "/tmp/codabench/") # note: we need to pass this directory to
- # docker compose so it knows where to store things!
-BASE_DIR = "/codabench/"
+# 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))
@@ -182,6 +182,7 @@ def __init__(self, run_args):
self.bundle_dir = os.path.join(self.root_dir, "bundles")
self.input_dir = os.path.join(self.root_dir, "input")
self.output_dir = os.path.join(self.root_dir, "output")
+ self.data_dir = os.path.join(HOST_DIRECTORY, "data") # absolute path to data in the host
self.logs = {}
# Details for submission
@@ -249,7 +250,6 @@ async def watch_detailed_results(self):
if time.time() - start > expiration_seconds:
timeout_error_message = f"Detailed results not written to after {expiration_seconds} seconds, exiting!"
logger.warning(timeout_error_message)
- raise SubmissionException(timeout_error_message)
await asyncio.sleep(5)
file_path = self.get_detailed_results_file_path()
else:
@@ -522,6 +522,7 @@ async def _run_program_directory(self, program_dir, kind, can_be_output=False):
# Set the volumes
'-v', f'{self._get_host_path(program_dir)}:/app/program',
'-v', f'{self._get_host_path(self.output_dir)}:/app/output',
+ '-v', f'{self.data_dir}:/app/data:ro',
# Start in the right directory
'-w', '/app/program',
diff --git a/src/apps/api/views/competitions.py b/src/apps/api/views/competitions.py
index 4f6288da9..b104c69a6 100644
--- a/src/apps/api/views/competitions.py
+++ b/src/apps/api/views/competitions.py
@@ -97,7 +97,6 @@ def get_queryset(self):
# On GETs lets optimize the query to reduce DB calls
if self.request.method == 'GET':
- logger.warning("\n\nGET\n\n")
qs = qs.select_related('created_by')
if self.action != 'list':
qs = qs.select_related('created_by')
@@ -501,6 +500,16 @@ def get_leaderboard(self, request, pk):
columns = [col for col in query['columns']]
submissions_keys = {}
for submission in query['submissions']:
+
+ # count number of entries/number of submissions for the owner of this submission for this phase
+ num_entries = Submission.objects.filter(owner__username=submission['owner'], phase=phase).count()
+
+ # get date of last submission by the owner of this submission for this phase
+ last_entry_date = Submission.objects.filter(owner__username=submission['owner'], phase=phase)\
+ .values('created_when')\
+ .order_by('-created_when')[0]['created_when']\
+ .strftime('%Y-%m-%d')
+
submission_key = f"{submission['owner']}{submission['parent'] or submission['id']}"
if submission_key not in submissions_keys:
submissions_keys[submission_key] = len(response['submissions'])
@@ -511,6 +520,8 @@ def get_leaderboard(self, request, pk):
'fact_sheet_answers': submission['fact_sheet_answers'],
'slug_url': submission['slug_url'],
'organization': submission['organization'],
+ 'num_entries': num_entries,
+ 'last_entry_date': last_entry_date
})
for score in submission['scores']:
diff --git a/src/static/riot/competitions/detail/_tabs.tag b/src/static/riot/competitions/detail/_tabs.tag
index 719308664..3ef4279b3 100644
--- a/src/static/riot/competitions/detail/_tabs.tag
+++ b/src/static/riot/competitions/detail/_tabs.tag
@@ -218,7 +218,15 @@