diff --git a/codalab/common.py b/codalab/common.py index 2bf211307..3f32b3215 100644 --- a/codalab/common.py +++ b/codalab/common.py @@ -8,7 +8,7 @@ # Increment this on the develop branch when develop is merged into master. # http://semver.org/ -CODALAB_VERSION = '0.2.26' +CODALAB_VERSION = '0.2.27' class IntegrityError(ValueError): diff --git a/docs/rest.md b/docs/rest.md index 20ac11655..fbab30227 100644 --- a/docs/rest.md +++ b/docs/rest.md @@ -1,6 +1,6 @@ # REST API Reference -_version 0.2.12_ +_version 0.2.27_ This reference and the REST API itself is still under heavy development and is subject to change at any time. Feedback through our GitHub issues is appreciated! @@ -468,6 +468,7 @@ Query parameters: - `size=.sort- ` : Sort by a particular field in reverse. - `size=.sum ` : Compute total of a particular field. - `.mine ` : Match only bundles I own. + - `.shared ` : Match only bundles shared with a group I'm a part of. - `.floating ` : Match bundles that aren't on any worksheet. - `.count ` : Count the number of bundles. - `.limit=10 ` : Limit the number of results to the top 10. diff --git a/worker/codalabworker/worker.py b/worker/codalabworker/worker.py index 43403750c..ff237fd83 100644 --- a/worker/codalabworker/worker.py +++ b/worker/codalabworker/worker.py @@ -9,12 +9,11 @@ from download_util import BUNDLE_NO_LONGER_RUNNING_MESSAGE from state_committer import JsonStateCommitter -VERSION = 19 +VERSION = 20 COMMAND_RETRY_SECONDS = 60 * 12 logger = logging.getLogger(__name__) - """ Codalab Worker Workers handle communications with the Codalab server. Their main role in Codalab execution @@ -25,7 +24,8 @@ class Worker(object): - def __init__(self, create_run_manager, commit_file, worker_id, tag, work_dir, bundle_service): + def __init__(self, create_run_manager, commit_file, worker_id, tag, + work_dir, bundle_service): self.id = worker_id self._state_committer = JsonStateCommitter(commit_file) self._tag = tag @@ -111,10 +111,12 @@ def _run(self, bundle, resources): 'start_time': int(now), } - if self._bundle_service.start_bundle(self.id, bundle['uuid'], start_message): + if self._bundle_service.start_bundle(self.id, bundle['uuid'], + start_message): self._run_manager.create_run(bundle, resources) else: - print >>sys.stdout, 'Bundle {} no longer assigned to this worker'.format(bundle['uuid']) + print >> sys.stdout, 'Bundle {} no longer assigned to this worker'.format( + bundle['uuid']) def _read(self, socket_id, uuid, path, read_args): def reply(err, message={}, data=None): @@ -122,8 +124,11 @@ def reply(err, message={}, data=None): try: run_state = self._run_manager.get_run(uuid) - dep_paths = set([dep['child_path'] for dep in run_state.bundle['dependencies']]) - self._run_manager.read(run_state, path, dep_paths, read_args, reply) + dep_paths = set([ + dep['child_path'] for dep in run_state.bundle['dependencies'] + ]) + self._run_manager.read(run_state, path, dep_paths, read_args, + reply) except BundleServiceException: traceback.print_exc() except Exception as e: @@ -134,6 +139,7 @@ def reply(err, message={}, data=None): def _netcat(self, socket_id, uuid, port, message): def reply(err, message={}, data=None): self._bundle_service_reply(socket_id, err, message, data) + try: run_state = self._run_manager.get_run(uuid) self._run_manager.netcat(run_state, port, message, reply) @@ -146,7 +152,8 @@ def reply(err, message={}, data=None): def _write(self, uuid, subpath, string): run_state = self._run_manager.get_run(uuid) - dep_paths = set([dep['child_path'] for dep in run_state.bundle['dependencies']]) + dep_paths = set( + [dep['child_path'] for dep in run_state.bundle['dependencies']]) self._run_manager.write(run_state, subpath, dep_paths, string) def _kill(self, uuid): diff --git a/worker/setup.py b/worker/setup.py index b8565b90f..61c725576 100644 --- a/worker/setup.py +++ b/worker/setup.py @@ -2,19 +2,24 @@ from setuptools.command.install import install import os + def get_requirements(*requirements_file_paths): requirements = [] for requirements_file_path in requirements_file_paths: with open(requirements_file_path) as requirements_file: for line in requirements_file: - if line[0:2] != '-r' and line.find('git') == -1 and line.find('codalabworker') == -1: + if line[0:2] != '-r' and line.find('git') == -1 and line.find( + 'codalabworker') == -1: requirements.append(line) return requirements -setup(name='codalabworker', - version='0.2.23', + +setup( + name='codalabworker', + version='0.2.27', description='Worker for CodaLab, a platform for reproducible computation', - long_description='To use your own hardware in CodaLab Worksheets, visit https://github.com/codalab/codalab-worksheets/wiki/Execution#running-your-own-worker. You can find the code at https://github.com/codalab/codalab-cli.', + long_description= + 'To use your own hardware in CodaLab Worksheets, visit https://github.com/codalab/codalab-worksheets/wiki/Execution#running-your-own-worker. You can find the code at https://github.com/codalab/codalab-cli.', url='https://github.com/codalab/codalab-cli', author='CodaLab', author_email='codalab.worksheets@gmail.com',