Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -9,6 +9,4 @@ ADD requirements.txt .
RUN pip install -U pip
RUN pip install -r requirements.dev.txt

# INSTALL CHROMEDRIVER HERE?

WORKDIR /app
13 changes: 10 additions & 3 deletions compute_worker/compute_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
30 changes: 27 additions & 3 deletions src/static/riot/competitions/detail/_header.tag
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
</div>
<div class="row">
<div class="column">
<!-- Main information -->
<div>
<span class="detail-label">Organized by:</span>
<span class="detail-item">{competition.created_by}</span>
Expand All @@ -44,10 +45,19 @@
<span class="detail-label">Current server time:</span>
<span class="detail-item" id="server_time">{pretty_date(CURRENT_DATE_TIME)}</span>
</div>
<!-- Docker image -->
<div class="competition-secret-key">
<span class="docker-label">Docker image:</span>
<span id="docker-image">{ competition.docker_image }</span>
<span onclick="{copy_docker_url}" class="ui send-pop-docker" data-content="Copied!">
<i class="ui copy icon"></i>
</span>
</div>
<!-- Secret URL -->
<div class="competition-secret-key" if="{ competition.admin }">
<span class="secret-label">Secret url:</span>
<span id="secret-url">https://{ URLS.SECRET_KEY_URL(competition.id, competition.secret_key) }</span>
<span onclick="{copy_secret_url}" class="ui send-pop" data-content="Copied!">
<span onclick="{copy_secret_url}" class="ui send-pop-secret" data-content="Copied!">
<i class="ui copy icon"></i>
</span>
</div>
Expand Down Expand Up @@ -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) {
Expand All @@ -232,6 +252,7 @@
$blue = #2c3f4c
$teal = #00bbbb
$lightblue = #f2faff
$red = #DB2828

.detail-label
font-size 1.25em
Expand All @@ -249,7 +270,10 @@
font-size 13px

.secret-label
color #DB2828
color $red

.docker-label
color $teal

.secret-url
color $blue
Expand Down
4 changes: 2 additions & 2 deletions src/static/riot/competitions/tile/front_page_competitions.tag
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="ui two column grid">
<div class="eight wide column">
<div class="ui large header">
Popular Benchmarks
<a href="/competitions/public/">Popular Benchmarks</a>
</div>
<div class="loader-container popular">
<div class="lds-ring">
Expand All @@ -17,7 +17,7 @@

<div class="eight wide column">
<div class="ui large header">
Featured Benchmarks
<a href="/competitions/public/">Featured Benchmarks</a>
</div>
<div class="loader-container popular">
<div class="lds-ring">
Expand Down
13 changes: 13 additions & 0 deletions src/static/stylus/home.styl
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,19 @@ body
.color-header
color #4a4a4a

#cite-container
padding 2em
align-items left


#cite-container .row
margin 2em
padding 1em !important
background-color #F8F9FA

#cite-container pre
text-align left

.footer.segment
padding 2em
margin 1em 7.5em
Expand Down
34 changes: 30 additions & 4 deletions src/templates/pages/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ <h3 class="ui icon header">
<div class="home-wrap">
<front-page-competitions></front-page-competitions>


<!-- Action Section -->
<div id="action-container" class="segment-container ui segment full-width">
<div class="ui header">
About CodaBench
Get Started
</div>
<div class="container-content">
<div class="center aligned column">
Expand All @@ -53,7 +53,7 @@ <h3 class="ui icon header">
Organize
</h3>
<div>
<p>Organize a benchmark on Codabench. Start with our <a href="https://github.com/codalab/competitions-v2/wiki/Getting-started-with-Codabench">tutorial</a>.</p>
<p>Organize a benchmark on Codabench. Start with our <a href="https://github.com/codalab/codabench/wiki/Getting-started-with-Codabench">tutorial</a>.</p>
</div>
</div>
<div class="center aligned column">
Expand All @@ -62,12 +62,13 @@ <h3 class="ui icon header">
Contribute
</h3>
<div>
<p>Interested in joining the development team? Join us on <a href="https://github.com/codalab/competitions-v2">Github</a> or <a href="mailto:info@codalab.org">contact us</a> directly.</p>
<p>Interested in joining the development team? Join us on <a href="https://github.com/codalab/codabench">Github</a> or <a href="mailto:info@codalab.org">contact us</a> directly.</p>
</div>
</div>
</div>
</div>

<!-- Stats section -->
<div class="ui five column grid" id="general-stats">
{% for stat in general_stats %}
<div class="column">
Expand All @@ -83,6 +84,7 @@ <h3 class="ui icon header">
{% endfor %}
</div>

<!-- About Section -->
<div id="about-container" class="segment-container ui segment full-width">
<div class="ui header">
About CodaBench
Expand Down Expand Up @@ -330,6 +332,30 @@ <h3>Homework</h3></a>
</div>
</div>
</div>

<!-- Citation Section -->
<div id="cite-container" class="segment-container ui segment full-width">
<div class="ui header">
Cite Codabench in your research
</div>
<div class="row container-content">
<pre>
@article{codabench,
title = {Codabench: Flexible, easy-to-use, and reproducible meta-benchmark platform},
author = {Zhen Xu and Sergio Escalera and Adrien Pavão and Magali Richard and
Wei-Wei Tu and Quanming Yao and Huan Zhao and Isabelle Guyon},
journal = {Patterns},
volume = {3},
number = {7},
pages = {100543},
year = {2022},
issn = {2666-3899},
doi = {<a href="https://doi.org/10.1016/j.patter.2022.100543" target="_blank">https://doi.org/10.1016/j.patter.2022.100543</a>},
url = {<a href="https://www.sciencedirect.com/science/article/pii/S2666389922001465" target="_blank">https://www.sciencedirect.com/science/article/pii/S2666389922001465</a>}
} </pre>
</div>
</div>

</div>
{% endblock %}

Expand Down