mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Update LWR client to pass along tool id and version, required if LWR server is configured to point to a toolbox. The LWR server uses this information to match the job up with a tool and uses the tool to validate inputs.
For more information see: https://lwr.readthedocs.org/en/latest/#setting-up-a-public-lwr-server https://bitbucket.org/jmchilton/lwr/src/tip/test/validator_test.py Updates the LWR client to revision 8a249f4254eb6aa1eed8669f738c5a9764caccdb of the LWR. https://bitbucket.org/jmchilton/lwr/commits/8a249f4254eb6aa1eed8669f738c5a9764caccdb
This commit is contained in:
@@ -69,7 +69,8 @@ class LwrJobRunner( AsynchronousJobRunner ):
|
||||
output_files = self.get_output_files(job_wrapper)
|
||||
input_files = job_wrapper.get_input_fnames()
|
||||
working_directory = job_wrapper.working_directory
|
||||
file_stager = FileStager(client, command_line, job_wrapper.extra_filenames, input_files, output_files, job_wrapper.tool.tool_dir, working_directory)
|
||||
tool = job_wrapper.tool
|
||||
file_stager = FileStager(client, tool, command_line, job_wrapper.extra_filenames, input_files, output_files, working_directory)
|
||||
rebuilt_command_line = file_stager.get_rewritten_command_line()
|
||||
job_id = file_stager.job_id
|
||||
client.launch( rebuilt_command_line )
|
||||
@@ -228,4 +229,4 @@ class LwrJobRunner( AsynchronousJobRunner ):
|
||||
elif job.get_state() == model.Job.states.QUEUED:
|
||||
# LWR doesn't queue currently, so this indicates galaxy was shutoff while
|
||||
# job was being staged. Not sure how to recover from that.
|
||||
job_state.job_wrapper.fail( "This job was killed when Galaxy was restarted. Please retry the job." )
|
||||
job_state.job_wrapper.fail( "This job was killed when Galaxy was restarted. Please retry the job." )
|
||||
|
||||
@@ -132,7 +132,7 @@ class FileStager(object):
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, client, command_line, config_files, input_files, output_files, tool_dir, working_directory):
|
||||
def __init__(self, client, tool, command_line, config_files, input_files, output_files, working_directory):
|
||||
"""
|
||||
"""
|
||||
self.client = client
|
||||
@@ -140,7 +140,9 @@ class FileStager(object):
|
||||
self.config_files = config_files
|
||||
self.input_files = input_files
|
||||
self.output_files = output_files
|
||||
self.tool_dir = os.path.abspath(tool_dir)
|
||||
self.tool_id = tool.id
|
||||
self.tool_version = tool.version
|
||||
self.tool_dir = os.path.abspath(tool.tool_dir)
|
||||
self.working_directory = working_directory
|
||||
|
||||
# Setup job inputs, these will need to be rewritten before
|
||||
@@ -161,7 +163,7 @@ class FileStager(object):
|
||||
self.__upload_rewritten_config_files()
|
||||
|
||||
def __handle_setup(self):
|
||||
job_config = self.client.setup()
|
||||
job_config = self.client.setup(self.tool_id, self.tool_version)
|
||||
|
||||
self.new_working_directory = job_config['working_directory']
|
||||
self.new_outputs_directory = job_config['outputs_directory']
|
||||
@@ -480,11 +482,16 @@ class Client(object):
|
||||
self.__raw_execute("clean", {"job_id": self.job_id})
|
||||
|
||||
@parseJson()
|
||||
def setup(self):
|
||||
def setup(self, tool_id=None, tool_version=None):
|
||||
"""
|
||||
Setup remote LWR server to run this job.
|
||||
"""
|
||||
return self.__raw_execute("setup", {"job_id": self.job_id})
|
||||
setup_args = {"job_id": self.job_id}
|
||||
if tool_id:
|
||||
setup_args["tool_id"] = tool_id
|
||||
if tool_version:
|
||||
setup_args["tool_version"] = tool_version
|
||||
return self.__raw_execute("setup", setup_args)
|
||||
|
||||
|
||||
def _read(path):
|
||||
|
||||
Reference in New Issue
Block a user