Skip to content

Commit

Permalink
Merge 1d99195 into d120ebb
Browse files Browse the repository at this point in the history
  • Loading branch information
roksys committed Oct 8, 2019
2 parents d120ebb + 1d99195 commit dcd43bc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion reana_workflow_controller/workflow_run_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,9 @@ def _create_job_controller_startup_cmd(self, user=None):
"""Create job controller startup cmd."""
base_cmd = 'flask run -h 0.0.0.0;'
if user:
add_group_cmd = 'groupadd -g {} {};'.format(
WORKFLOW_RUNTIME_USER_GID,
WORKFLOW_RUNTIME_USER_GID)
add_user_cmd = 'useradd -u {} -g {} -M {};'.format(
WORKFLOW_RUNTIME_USER_UID,
WORKFLOW_RUNTIME_USER_GID,
Expand All @@ -456,7 +459,8 @@ def _create_job_controller_startup_cmd(self, user=None):
SHARED_VOLUME_PATH + '/' + self.workflow.get_workspace()
)
run_app_cmd = 'su {} /bin/bash -c "{}"'.format(user, base_cmd)
full_cmd = add_user_cmd + chown_workspace_cmd + run_app_cmd
full_cmd = add_group_cmd + add_user_cmd + chown_workspace_cmd + \
run_app_cmd
return [full_cmd]
else:
return base_cmd.split()

0 comments on commit dcd43bc

Please sign in to comment.