Skip to content

Commit

Permalink
Minor formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
pcm32 committed Apr 13, 2016
1 parent 2607be1 commit ac2a82c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/galaxy/jobs/runners/kubernetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __init__( self, app, nworkers ):
# Check if pykube was importable, fail if not
assert operator is not None, K8S_IMPORT_MESSAGE
"""Start the job runner parent object """
super( KubernetesJobRunner, self ).__init__( app, nworkers )
super(KubernetesJobRunner, self).__init__(app, nworkers)

# self.cli_interface = CliInterface()

Expand All @@ -51,12 +51,13 @@ def __init__( self, app, nworkers ):
# self._init_monitor_thread()
# self._init_worker_threads()

def get_cli_plugins( self, shell_params, job_params ):
def get_cli_plugins(self, shell_params, job_params ):
return self.cli_interface.get_plugins( shell_params, job_params )

def url_to_destination( self, url ):
# TODO apparently needs to be implemented for pykube-k8s
params = {}
shell_params, job_params = url.split( '/' )[ 2:4 ]
shell_params, job_params = url.split('/')[2:4]
# split 'foo=bar&baz=quux' into { 'foo' : 'bar', 'baz' : 'quux' }
shell_params = dict( [ ( 'shell_' + k, v ) for k, v in [ kv.split( '=', 1 ) for kv in shell_params.split( '&' ) ] ] )
job_params = dict( [ ( 'job_' + k, v ) for k, v in [ kv.split( '=', 1 ) for kv in job_params.split( '&' ) ] ] )
Expand All @@ -67,13 +68,14 @@ def url_to_destination( self, url ):
return JobDestination( runner='cli', params=params )

def parse_destination_params( self, params ):
# TODO apparently no need to re-implement, can be deleted.
return split_params( params )

def queue_job( self, job_wrapper ):
"""Create job script and submit it to Kubernetes cluster"""
# prepare the job
# TODO understand weather we need include_metadata and include_work_dir_outputs
if not self.prepare_job( job_wrapper, include_metadata=True ):
# TODO understand whether we need to include_metadata and include_work_dir_outputs
if not self.prepare_job(job_wrapper, include_metadata=True ):
return

# Get shell and job execution interface
Expand Down

0 comments on commit ac2a82c

Please sign in to comment.