Skip to content

Commit

Permalink
Merge a5f78fb into 045e6a2
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasyu888 committed Mar 7, 2021
2 parents 045e6a2 + a5f78fb commit 8132e21
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 26 deletions.
26 changes: 14 additions & 12 deletions challengeutils/__main__.py
Expand Up @@ -9,8 +9,8 @@
from synapseclient.core.retry import with_retry
from synapseclient.core.utils import from_unix_epoch_time

from . import (annotations, createchallenge, challenge,
evaluation_queue, helpers, mirrorwiki, permissions,
from . import (annotations, createchallenge, challenge, dockertools,
evaluation_queue, mirrorwiki, permissions,
submission, utils, wiki)
from .__version__ import __version__

Expand Down Expand Up @@ -266,16 +266,16 @@ def command_send_email(syn, args):
messageBody=message)


def command_kill_docker_over_quota(syn, args):
def command_stop_submission_over_quota(syn, args):
"""
Sets an annotation on Synapse Docker submissions such that it will
be terminated by the orchestrator. Usually applies to submissions
that have been running for longer than the alloted time.
>>> challengeutils killdockeroverquota evaluationid quota
>>> challengeutils stop-submission-over-quota evaluationid quota
"""
helpers.kill_docker_submission_over_quota(syn, args.evaluationid,
quota=args.quota)
submission.stop_submission_over_quota(syn, args.evaluationid,
quota=args.quota)


def command_validate_docker(syn, args):
Expand Down Expand Up @@ -608,20 +608,22 @@ def build_parser():

parser_send_email.set_defaults(func=command_send_email)

parser_kill_docker = subparsers.add_parser(
'kill-docker-over-quota',
help='Kill Docker submissions over the quota')
parser_stop_submission = subparsers.add_parser(
'stop-submission-over-quota',
help='Stop Docker submissions over the quota')

parser_kill_docker.add_argument(
parser_stop_submission.add_argument(
"evaluationid",
type=str,
help='Synapse evaluation queue id')

parser_kill_docker.add_argument(
parser_stop_submission.add_argument(
"quota",
type=int,
help="Time quota submission has to run in milliseconds")
parser_kill_docker.set_defaults(func=command_kill_docker_over_quota)
parser_stop_submission.set_defaults(
func=command_stop_submission_over_quota
)

parser_set_quota = subparsers.add_parser(
'set-evaluation-quota',
Expand Down
2 changes: 1 addition & 1 deletion challengeutils/__version__.py
@@ -1 +1 @@
__version__ = "4.0.0"
__version__ = "4.0.1"
2 changes: 1 addition & 1 deletion docs/about/changelog.rst
Expand Up @@ -8,7 +8,7 @@ For older releases, visit the `GitHub releases`_.

.. _Github releases: https://github.com/Sage-Bionetworks/challengeutils/releases

v4.0.0
v4.0.1
------
.. Important::
**Support for synapseclient<2.3.0 is no longer available**; upgrade to the
Expand Down
4 changes: 2 additions & 2 deletions docs/client/admin.rst
Expand Up @@ -401,7 +401,7 @@ Stop a Docker submission
Synopsis
^^^^^^^^

kill-docker-over-quota
stop-submission-over-quota
eval_id time_quota

Description
Expand All @@ -413,7 +413,7 @@ runtime longer than the alloted time).
Positional
^^^^^^^^^^

.. program:: challengeutils kill-docker-over-quota
.. program:: challengeutils stop-submission-over-quota

.. cmdoption:: eval_id

Expand Down
2 changes: 1 addition & 1 deletion docs/client/source.rst
Expand Up @@ -23,7 +23,7 @@ Admin
command_list_evaluations, command_set_evaluation_quota,
command_set_evaluation_acl, command_query,
command_download_submission, command_annotate_submission_with_json,
command_change_status, command_kill_docker_over_quota,
command_change_status, command_stop_submission_over_quota,
command_set_entity_acl, command_validate_project, command_archive_project,
command_delete_submission, command_validate_docker,
command_push_wiki, command_pull_wiki
Expand Down
4 changes: 3 additions & 1 deletion docs/index.rst
Expand Up @@ -7,10 +7,12 @@
python/wiki
python/submissions
python/discussion
python/helpers
python/annotations
python/permissions
python/teams
python/utils
python/evaluation_queues
python/dockertools

.. toctree::
:caption: Command-Line Client
Expand Down
8 changes: 8 additions & 0 deletions docs/python/annotations.rst
@@ -0,0 +1,8 @@
***********
Annotations
***********

.. automodule:: challengeutils.annotations
:members:
:undoc-members:
:show-inheritance:
8 changes: 8 additions & 0 deletions docs/python/dockertools.rst
@@ -0,0 +1,8 @@
************
Docker Tools
************

.. automodule:: challengeutils.dockertools
:members:
:undoc-members:
:show-inheritance:
8 changes: 8 additions & 0 deletions docs/python/evaluation_queues.rst
@@ -0,0 +1,8 @@
*****************
Evaluation Queues
*****************

.. automodule:: challengeutils.evaluation_queue
:members:
:undoc-members:
:show-inheritance:
8 changes: 0 additions & 8 deletions docs/python/helpers.rst

This file was deleted.

0 comments on commit 8132e21

Please sign in to comment.