Skip to content

Commit

Permalink
Merge 0d085a6 into e6cdbed
Browse files Browse the repository at this point in the history
  • Loading branch information
alintulu committed Oct 9, 2020
2 parents e6cdbed + 0d085a6 commit d4f5421
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.rst
Expand Up @@ -4,6 +4,7 @@ Changes
Version master (UNRELEASED)
---------------------------

- Allows htcondor_max_runtime and htcondor_accounting_group to be specified for HTC jobs
- Adds `get_disk_usage` utility function to calculate disk usage for a directory.
- Centralises `fs` package dependency

Expand Down
10 changes: 10 additions & 0 deletions reana_commons/api_client.py
Expand Up @@ -90,6 +90,8 @@ def submit(
kubernetes_uid=None,
unpacked_img=False,
voms_proxy=False,
htcondor_max_runtime="",
htcondor_accounting_group="",
):
"""Submit a job to RJC API.
Expand All @@ -108,6 +110,8 @@ def submit(
:kubernetes_uid: Overwrites the default user id in the job container.
:unpacked_img: Decides if unpacked iamges should be used.
:return: Returns a dict with the ``job_id``.
:htcondor_max_runtime: Maximum runtime of a HTCondor job.
:htcondor_accounting_group: Accounting group of a HTCondor job.
"""
job_spec = {
"docker_img": image,
Expand Down Expand Up @@ -135,6 +139,12 @@ def submit(
if unpacked_img:
job_spec["unpacked_img"] = unpacked_img

if htcondor_max_runtime:
job_spec["htcondor_max_runtime"] = htcondor_max_runtime

if htcondor_accounting_group:
job_spec["htcondor_accounting_group"] = htcondor_accounting_group

response, http_response = self._client.jobs.create_job(job=job_spec).result()
if http_response.status_code == 400:
raise HTTPBadRequest(
Expand Down
Expand Up @@ -57,6 +57,12 @@
"default": {},
"type": "object"
},
"htcondor_accounting_group": {
"type": "string"
},
"htcondor_max_runtime": {
"type": "string"
},
"job_name": {
"type": "string"
},
Expand Down Expand Up @@ -100,7 +106,7 @@
"info": {
"description": "REANA Job Controller API",
"title": "reana-job-controller",
"version": "0.7.0.dev20191230"
"version": "0.7.0a3"
},
"parameters": {},
"paths": {
Expand Down
10 changes: 10 additions & 0 deletions reana_commons/serial.py
Expand Up @@ -62,6 +62,16 @@
"type": "boolean",
"default": "false",
},
"htcondor_max_runtime": {
"$id": "#/properties/steps/properties/htcondor_max_runtime",
"type": "string",
"default": "",
},
"htcondor_accounting_group": {
"$id": "#/properties/steps/properties/htcondor_accounting_group",
"type": "string",
"default": "",
},
"commands": {
"$id": "#/properties/steps/properties/commands",
"type": "array",
Expand Down

0 comments on commit d4f5421

Please sign in to comment.