Skip to content

Commit

Permalink
CLI still imported helpers, Create patch release 4.0.1 (#218)
Browse files Browse the repository at this point in the history
* Fix

* Fix

* Patch release

* Change name

* Change name

* Add documentation

* Add patch version

* Update challengeutils/__main__.py

* stopping submission quota uses submission view now

* Add to changelog
  • Loading branch information
thomasyu888 authored Mar 7, 2021
1 parent 045e6a2 commit 6d51fb8
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 28 deletions.
28 changes: 15 additions & 13 deletions challengeutils/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from synapseclient.core.utils import from_unix_epoch_time

from . import (annotations, createchallenge, challenge,
evaluation_queue, helpers, mirrorwiki, permissions,
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 submission_viewid quota
"""
helpers.kill_docker_submission_over_quota(syn, args.evaluationid,
quota=args.quota)
submission.stop_submission_over_quota(syn, args.submission_viewid,
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(
"evaluationid",
parser_stop_submission.add_argument(
"submission_viewid",
type=str,
help='Synapse evaluation queue id')
help='Synapse Submission View 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
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "4.0.0"
__version__ = "4.0.1"
4 changes: 2 additions & 2 deletions docs/about/changelog.rst
Original file line number Diff line number Diff line change
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 All @@ -25,7 +25,7 @@ v4.0.0
- Support `Python` 3.9
- Deprecate `helpers.py` and create `stop_submissions_over_quota` function
- Fix conditionals when validating permissions for project submissions

- Stopping submissions over a quota now uses submission views instead of evaluation queues.

v3.2.0
------
Expand Down
4 changes: 2 additions & 2 deletions docs/client/admin.rst
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
***********
Annotations
***********

.. automodule:: challengeutils.annotations
:members:
:undoc-members:
:show-inheritance:
8 changes: 8 additions & 0 deletions docs/python/dockertools.rst
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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 6d51fb8

Please sign in to comment.