commit/galaxy-central: jmchilton: Update LWR client through LWR changeset bd8d1cc.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/641f7063ce3c/ Changeset: 641f7063ce3c User: jmchilton Date: 2014-04-24 07:31:57 Summary: Update LWR client through LWR changeset bd8d1cc. Needed for LWR runner to be able to use env tags from job conf file. Affected #: 4 files diff -r b172ca94e169ccf2450432398d67623f79c5588f -r 641f7063ce3c5dcf375aafdd9a65a2e3f7ccfa4c lib/galaxy/jobs/runners/lwr_client/client.py --- a/lib/galaxy/jobs/runners/lwr_client/client.py +++ b/lib/galaxy/jobs/runners/lwr_client/client.py @@ -39,6 +39,7 @@ ) else: job_directory = None + self.env = destination_params.get( "env", [] ) self.files_endpoint = destination_params.get("files_endpoint", None) self.job_directory = job_directory @@ -81,7 +82,7 @@ super(JobClient, self).__init__(destination_params, job_id) self.job_manager_interface = job_manager_interface - def launch(self, command_line, requirements=[], remote_staging=[], job_config=None): + def launch(self, command_line, requirements=[], env=[], remote_staging=[], job_config=None): """ Queue up the execution of the supplied `command_line` on the remote server. Called launch for historical reasons, should be renamed to @@ -98,6 +99,8 @@ launch_params['params'] = dumps(submit_params_dict) if requirements: launch_params['requirements'] = dumps([requirement.to_dict() for requirement in requirements]) + if env: + launch_params['env'] = dumps(env) if remote_staging: launch_params['remote_staging'] = dumps(remote_staging) if job_config and self.setup_handler.local: @@ -291,7 +294,7 @@ raise Exception(error_message) self.client_manager = client_manager - def launch(self, command_line, requirements=[], remote_staging=[], job_config=None): + def launch(self, command_line, requirements=[], env=[], remote_staging=[], job_config=None): """ """ launch_params = dict(command_line=command_line, job_id=self.job_id) @@ -300,6 +303,8 @@ launch_params['params'] = submit_params_dict if requirements: launch_params['requirements'] = [requirement.to_dict() for requirement in requirements] + if env: + launch_params['env'] = env if remote_staging: launch_params['remote_staging'] = remote_staging if job_config and self.setup_handler.local: diff -r b172ca94e169ccf2450432398d67623f79c5588f -r 641f7063ce3c5dcf375aafdd9a65a2e3f7ccfa4c lib/galaxy/jobs/runners/lwr_client/staging/__init__.py --- a/lib/galaxy/jobs/runners/lwr_client/staging/__init__.py +++ b/lib/galaxy/jobs/runners/lwr_client/staging/__init__.py @@ -32,6 +32,8 @@ Local path created by Galaxy for running this job. requirements : list List of requirements for tool execution. + env: list + List of dict object describing environment variables to populate. version_file : str Path to version file expected on the client server arbitrary_files : dict() @@ -54,6 +56,7 @@ client_outputs, working_directory, requirements, + env=[], arbitrary_files=None, rewrite_paths=True, ): @@ -64,6 +67,7 @@ self.client_outputs = client_outputs self.working_directory = working_directory self.requirements = requirements + self.env = env self.rewrite_paths = rewrite_paths self.arbitrary_files = arbitrary_files or {} @@ -156,5 +160,5 @@ return join(output_directory, self.path_helper.local_name(name)) files_directory = "%s_files%s" % (basename(output_file)[0:-len(".dat")], self.path_helper.separator) - names = filter(lambda o: o.startswith(files_directory), self.output_directory_contents) + names = filter(lambda o: o.startswith(files_directory), self.output_directory_contents) return dict(map(lambda name: (local_path(name), name), names)) diff -r b172ca94e169ccf2450432398d67623f79c5588f -r 641f7063ce3c5dcf375aafdd9a65a2e3f7ccfa4c lib/galaxy/jobs/runners/lwr_client/staging/down.py --- a/lib/galaxy/jobs/runners/lwr_client/staging/down.py +++ b/lib/galaxy/jobs/runners/lwr_client/staging/down.py @@ -80,7 +80,10 @@ if self._attempt_collect_output('output_workdir', path=output_file, name=lwr_name): self.downloaded_working_directory_files.append(lwr_name) # Remove from full output_files list so don't try to download directly. - self.output_files.remove(output_file) + try: + self.output_files.remove(output_file) + except ValueError: + raise Exception("Failed to remove %s from %s" % (output_file, self.output_files)) def __collect_outputs(self): # Legacy LWR not returning list of files, iterate over the list of diff -r b172ca94e169ccf2450432398d67623f79c5588f -r 641f7063ce3c5dcf375aafdd9a65a2e3f7ccfa4c lib/galaxy/jobs/runners/lwr_client/staging/up.py --- a/lib/galaxy/jobs/runners/lwr_client/staging/up.py +++ b/lib/galaxy/jobs/runners/lwr_client/staging/up.py @@ -25,6 +25,7 @@ launch_kwds = dict( command_line=rebuilt_command_line, requirements=client_job_description.requirements, + env=client_job_description.env, ) if file_stager.job_config: launch_kwds["job_config"] = file_stager.job_config Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org