Skip to content

Commit

Permalink
config+api: add k8s default namespace & multiple job backends support
Browse files Browse the repository at this point in the history
* Add config var for default K8s job namesapce. API changes for multiple
  job bakend support.
  Connects reanahub/reana-job-controller/issues/118

Signed-off-by: Rokas Maciulaitis <[email protected]>
  • Loading branch information
Rokas Maciulaitis authored and roksys committed Apr 1, 2019
1 parent 98911b2 commit a5c30c0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
4 changes: 3 additions & 1 deletion reana_commons/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class JobControllerAPIClient(BaseAPIClient):
"""REANA-Job-Controller http client class."""

def submit(self,
workflow_uuid='',
experiment='',
image='',
cmd='',
Expand Down Expand Up @@ -88,7 +89,8 @@ def submit(self,
'env_vars': {},
'workflow_workspace': workflow_workspace,
'job_name': job_name,
'cvmfs_mounts': cvmfs_mounts
'cvmfs_mounts': cvmfs_mounts,
'workflow_uuid': workflow_uuid
}

response, http_response = self._client.jobs.create_job(job=job_spec).\
Expand Down
3 changes: 3 additions & 0 deletions reana_commons/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,6 @@

REANA_WORKFLOW_UMASK = 0o0002
"""Umask used for workflow worksapce."""

K8S_DEFAULT_NAMESPACE = "default"
"""Kubernetes workflow runtime default namespace"""
10 changes: 7 additions & 3 deletions reana_commons/openapi_specifications/reana_job_controller.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
},
"JobRequest": {
"properties": {
"backend": {
"type": "string"
},
"cmd": {
"default": "",
"type": "string"
Expand All @@ -68,9 +71,6 @@
"job_name": {
"type": "string"
},
"job_type": {
"type": "string"
},
"prettified_cmd": {
"default": "",
"type": "string"
Expand All @@ -79,6 +79,9 @@
"default": true,
"type": "boolean"
},
"workflow_uuid": {
"type": "string"
},
"workflow_workspace": {
"type": "string"
}
Expand All @@ -87,6 +90,7 @@
"docker_img",
"experiment",
"job_name",
"workflow_uuid",
"workflow_workspace"
],
"type": "object"
Expand Down

0 comments on commit a5c30c0

Please sign in to comment.