diff --git a/Dockerfile b/Dockerfile index 3a67ff1f3..93541187f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM python:3.8 -RUN apt-get update && apt-get install -yy gcc build-essential python-setuptools +RUN apt-get update && apt-get install -y gcc build-essential && rm -rf /var/lib/apt/lists/* ENV PYTHONUNBUFFERED 1 @@ -9,6 +9,4 @@ ADD requirements.txt . RUN pip install -U pip RUN pip install -r requirements.dev.txt -# INSTALL CHROMEDRIVER HERE? - WORKDIR /app diff --git a/compute_worker/compute_worker.py b/compute_worker/compute_worker.py index 152ab2d0e..5057e3778 100644 --- a/compute_worker/compute_worker.py +++ b/compute_worker/compute_worker.py @@ -497,9 +497,16 @@ async def _run_program_directory(self, program_dir, kind, can_be_output=False): logger.info(f"Metadata path is {os.path.join(program_dir, metadata_path)}") with open(os.path.join(program_dir, metadata_path), 'r') as metadata_file: - metadata = yaml.load(metadata_file.read(), Loader=yaml.FullLoader) - logger.info(f"Metadata contains:\n {metadata}") - command = metadata.get("command") if metadata is not None else None # in case the file exists but is empty + try: # try to find a command in the metadata, in other cases set metadata to None + metadata = yaml.load(metadata_file.read(), Loader=yaml.FullLoader) + logger.info(f"Metadata contains:\n {metadata}") + if isinstance(metadata, dict): # command found + command = metadata.get("command") + else: + command = None + except yaml.YAMLError as e: + print("Error parsing YAML file: ", e) + command = None if not command and kind == "ingestion": raise SubmissionException("Program directory missing 'command' in metadata") elif not command: diff --git a/src/static/riot/competitions/detail/_header.tag b/src/static/riot/competitions/detail/_header.tag index 55950fa64..3b34c066f 100644 --- a/src/static/riot/competitions/detail/_header.tag +++ b/src/static/riot/competitions/detail/_header.tag @@ -32,6 +32,7 @@
+
Organized by: {competition.created_by} @@ -44,10 +45,19 @@ Current server time: {pretty_date(CURRENT_DATE_TIME)}
+ +
+ Docker image: + { competition.docker_image } + + + +
+
Secret url: https://{ URLS.SECRET_KEY_URL(competition.id, competition.secret_key) } - +
@@ -207,7 +217,17 @@ window.getSelection().addRange(range); // to select text document.execCommand("copy"); window.getSelection().removeAllRanges();// to deselect - $('.send-pop').popup('toggle') + $('.send-pop-secret').popup('toggle') + } + + self.copy_docker_url = function () { + let range = document.createRange(); + range.selectNode(document.getElementById("docker-image")); + window.getSelection().removeAllRanges(); // clear current selection + window.getSelection().addRange(range); // to select text + document.execCommand("copy"); + window.getSelection().removeAllRanges();// to deselect + $('.send-pop-docker').popup('toggle') } self.get_end_date = function (competition) { @@ -232,6 +252,7 @@ $blue = #2c3f4c $teal = #00bbbb $lightblue = #f2faff + $red = #DB2828 .detail-label font-size 1.25em @@ -249,7 +270,10 @@ font-size 13px .secret-label - color #DB2828 + color $red + + .docker-label + color $teal .secret-url color $blue diff --git a/src/static/riot/competitions/tile/front_page_competitions.tag b/src/static/riot/competitions/tile/front_page_competitions.tag index 4d48da314..a24f83823 100644 --- a/src/static/riot/competitions/tile/front_page_competitions.tag +++ b/src/static/riot/competitions/tile/front_page_competitions.tag @@ -2,7 +2,7 @@
- Popular Benchmarks + Popular Benchmarks