Skip to content

Commit

Permalink
Merge 3e94232 into b60967d
Browse files Browse the repository at this point in the history
  • Loading branch information
roksys committed Dec 12, 2019
2 parents b60967d + 3e94232 commit 21b4105
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion reana_workflow_engine_yadage/cli.py
Expand Up @@ -15,7 +15,8 @@
import os

import click
from reana_commons.config import REANA_LOG_FORMAT, REANA_LOG_LEVEL
from reana_commons.config import (REANA_LOG_FORMAT, REANA_LOG_LEVEL,
REANA_WORKFLOW_UMASK)
from reana_commons.utils import check_connection_to_job_controller
from yadage.steering_api import steering_ctx
from yadage.utils import setupbackend_fromstring
Expand Down Expand Up @@ -59,6 +60,7 @@ def run_yadage_workflow(workflow_uuid,
# use some shared object between tasks.
os.environ["workflow_uuid"] = workflow_uuid
os.environ["workflow_workspace"] = workflow_workspace
os.umask(REANA_WORKFLOW_UMASK)

cap_backend = setupbackend_fromstring('fromenv')
toplevel = os.getcwd()
Expand Down
9 changes: 6 additions & 3 deletions reana_workflow_engine_yadage/externalbackend.py
Expand Up @@ -84,15 +84,18 @@ def submit(self, spec, parameters, state, metadata):
image = spec['environment']['image']
# tag = spec['environment']['imagetag']

kerberos = False
kerberos = None
compute_backend = None
kubernetes_uid = None
resources = spec['environment'].get('resources', None)
if resources:
for item in resources:
if 'kerberos' in item.keys():
kerberos = item['kerberos']
if 'compute_backend' in item.keys():
compute_backend = item['compute_backend']
if 'kubernetes_uid' in item.keys():
kubernetes_uid = item['kubernetes_uid']

log.info('state context is {0}'.format(state))
log.info('would run job {0}'.format(job))
Expand All @@ -104,8 +107,6 @@ def submit(self, spec, parameters, state, metadata):
workflow_uuid = os.getenv('workflow_uuid', 'default')
job_request_body = {
'workflow_uuid': workflow_uuid,
'experiment': os.getenv('REANA_WORKFLOW_ENGINE_YADAGE_EXPERIMENT',
'default'),
'image': image,
'cmd': wrapped_cmd,
'prettified_cmd': prettified_cmd,
Expand All @@ -118,6 +119,8 @@ def submit(self, spec, parameters, state, metadata):
job_request_body['compute_backend'] = compute_backend
if kerberos:
job_request_body['kerberos'] = kerberos
if kubernetes_uid:
job_request_body['kubernetes_uid'] = kubernetes_uid

job_id = self.rjc_api_client.submit(**job_request_body)

Expand Down

0 comments on commit 21b4105

Please sign in to comment.