Skip to content

Commit

Permalink
Merge pull request #1286 from codalab/develop
Browse files Browse the repository at this point in the history
Merge develop into master
  • Loading branch information
Didayolo authored Jan 20, 2024
2 parents 11bd026 + efa140e commit fed1462
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 8 deletions.
5 changes: 3 additions & 2 deletions compute_worker/compute_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,15 +367,16 @@ def _get_container_image(self, 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:
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."
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)
Expand Down
5 changes: 2 additions & 3 deletions src/apps/api/views/submissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@ def check_object_permissions(self, request, obj):
# Set file name to ingestion std error as default
error_file_name = "prediction_ingestion_stderr"

# Change error file name when error comes from execution time limit
# and error occured during scoring
if request.data["type"] == "Execution_Time_Limit_Exceeded" and request.data['is_scoring'] == "True":
# Change error file name to scoring_stderr when error occurs during scoring
if request.data.get("is_scoring", "False") == "True":
error_file_name = "scoring_stderr"

try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</thead>
<tbody>
<tr each="{participants}">
<td>{username}</td>
<td><a href="/profiles/user/{username}" target="_BLANK">{username}</a></td>
<td>{email}</td>
<td>{is_bot}</td>
<td>{_.startCase(status)}</td>
Expand Down
34 changes: 32 additions & 2 deletions src/static/riot/competitions/public-list.tag
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
<public-list>
<h1>Public Competitions</h1>
<h1>Public Benchmarks and Competitions</h1>
<div class="pagination-nav" hide="{(competitions.count < 10)}">
<button show="{competitions.previous}" onclick="{handle_ajax_pages.bind(this, -1)}" class="float-left ui inline button active">Back</button>
<button hide="{competitions.previous}" disabled="disabled" class="float-left ui inline button disabled">Back</button>
{ current_page } of {Math.ceil(competitions.count/competitions.page_size)}
<button show="{competitions.next}" onclick="{handle_ajax_pages.bind(this, 1)}" class="float-right ui inline button active">Next</button>
<button hide="{competitions.next}" disabled="disabled" class="float-right ui inline button disabled">Next</button>
</div>
<div id="loading" class="loading-indicator" show="{!competitions}">
<div class="spinner"></div>
</div>
<div each="{competition in competitions.results}">
<div class="tile-wrapper">
<div class="ui square tiny bordered image img-wrapper">
<img src="{competition.logo}">
<img src="{competition.logo}" loading="lazy">
</div>
<a class="link-no-deco" href="../{competition.id}">
<div class="comp-info">
Expand Down Expand Up @@ -59,6 +62,8 @@

self.update_competitions_list = function (num) {
self.current_page = num
$('#loading').show()
$('.pagination-nav').hide()
if (self.competitions_cache[self.current_page]){
self.competitions = self.competitions_cache[self.current_page]
history.pushState("", document.title, "?page="+self.current_page)
Expand All @@ -67,11 +72,15 @@
} else {
return CODALAB.api.get_public_competitions({"page":self.current_page})
.fail(function (response) {
$('#loading').hide()
$('.pagination-nav').show()
toastr.error("Could not load competition list")
})
.done(function (response){
self.competitions = response
self.competitions_cache[self.current_page.toString()] = response
$('#loading').hide()
$('.pagination-nav').show()
history.pushState("", document.title, "?page="+self.current_page)
$('.pagination-nav > button').prop('disabled', false)
self.update()
Expand Down Expand Up @@ -208,6 +217,27 @@
font-size 13px
text-align left
margin 0.35em

.loading-indicator
display flex
align-items center
padding 20px
width 100%
margin: 0 auto;

.spinner
border 4px solid rgba(0,0,0,.1)
width 36px
height 36px
border-radius 50%
border-top-color #3498db
animation spin 1s ease-in-out infinite

@keyframes spin
0%
transform rotate(0deg)
100%
transform rotate(360deg)
</style>

</public-list>

0 comments on commit fed1462

Please sign in to comment.