Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(master): merge maint-0.9 #481

Merged
merged 7 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.9.8"
".": "0.9.9"
}
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ The list of contributors in alphabetical order:
- [Jelizaveta Lemeševa](https://orcid.org/0009-0003-6606-9270)
- [Kenyi Hurtado-Anampa](https://orcid.org/0000-0002-9779-3566)
- [Leticia Wanderley](https://orcid.org/0000-0003-4649-6630)
- [Manuel Giffels](https://orcid.org/0000-0003-0193-3032)
- [Marco Donadoni](https://orcid.org/0000-0003-2922-5505)
- [Marco Vidal](https://orcid.org/0000-0002-9363-4971)
- [Matthew Feickert](https://orcid.org/0000-0003-4124-7862)
Expand Down
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Changelog

## [0.9.9](https://github.com/reanahub/reana-commons/compare/0.9.8...0.9.9) (2024-11-28)


### Build

* **python:** add support for Python 3.13 ([#480](https://github.com/reanahub/reana-commons/issues/480)) ([5de7605](https://github.com/reanahub/reana-commons/commit/5de760512a3aa86282a9dc31ac031773ddf49ef6))


### Features

* **schema:** allow Compute4PUNCH backend options ([#445](https://github.com/reanahub/reana-commons/issues/445)) ([0570f4a](https://github.com/reanahub/reana-commons/commit/0570f4ade9135a2d340009d2091c97dfc81a2e60))


### Bug fixes

* **config:** remove hard-coded component host name domain ([#458](https://github.com/reanahub/reana-commons/issues/458)) ([f2faeaa](https://github.com/reanahub/reana-commons/commit/f2faeaa76f42c4484db70766fc1d7a3a122ee38f)), closes [#457](https://github.com/reanahub/reana-commons/issues/457)


### Continuous integration

* **actions:** pin setuptools 70 ([#479](https://github.com/reanahub/reana-commons/issues/479)) ([b80bc70](https://github.com/reanahub/reana-commons/commit/b80bc707fa9311e3e5d00ea71bb17f853845d6bf))

## [0.9.8](https://github.com/reanahub/reana-commons/compare/0.9.7...0.9.8) (2024-03-01)


Expand Down
17 changes: 16 additions & 1 deletion reana_commons/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
class JobControllerAPIClient(BaseAPIClient):
"""REANA-Job-Controller http client class."""

def submit(
def submit( # noqa: C901

Check warning on line 90 in reana_commons/api_client.py

View check run for this annotation

Codecov / codecov/patch

reana_commons/api_client.py#L90

Added line #L90 was not covered by tests
self,
workflow_uuid="",
image="",
Expand All @@ -108,6 +108,9 @@
slurm_partition="",
slurm_time="",
kubernetes_job_timeout: Optional[int] = None,
c4p_cpu_cores="",
c4p_memory_limit="",
c4p_additional_requirements="",
):
"""Submit a job to RJC API.

Expand All @@ -132,6 +135,9 @@
:param slurm_partition: Partition of a Slurm job.
:param slurm_time: Maximum timelimit of a Slurm job.
:param kubernetes_job_timeout: Timeout for the job in seconds.
:param c4p_cpu_cores: Amount of CPU cores requested to process C4P job
:param c4p_memory_limit: Amount of memory requested to process C4P job
:param c4p_additional_requirements: Additional requirements requested to process C4P job like GPU, etc.
:return: Returns a dict with the ``job_id``.
"""
job_spec = {
Expand Down Expand Up @@ -181,6 +187,15 @@
if slurm_time:
job_spec["slurm_time"] = slurm_time

if c4p_cpu_cores:
job_spec["c4p_cpu_cores"] = c4p_cpu_cores

Check warning on line 191 in reana_commons/api_client.py

View check run for this annotation

Codecov / codecov/patch

reana_commons/api_client.py#L190-L191

Added lines #L190 - L191 were not covered by tests

if c4p_memory_limit:
job_spec["c4p_memory_limit"] = c4p_memory_limit

Check warning on line 194 in reana_commons/api_client.py

View check run for this annotation

Codecov / codecov/patch

reana_commons/api_client.py#L193-L194

Added lines #L193 - L194 were not covered by tests

if c4p_additional_requirements:
job_spec["c4p_additional_requirements"] = c4p_additional_requirements

Check warning on line 197 in reana_commons/api_client.py

View check run for this annotation

Codecov / codecov/patch

reana_commons/api_client.py#L196-L197

Added lines #L196 - L197 were not covered by tests

try:
response, http_response = self._client.jobs.create_job(
job=job_spec
Expand Down
4 changes: 1 addition & 3 deletions reana_commons/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,7 @@ def load(cls, kind):
"""Kubernetes namespace in which REANA infrastructure is currently deployed."""

REANA_INFRASTRUCTURE_COMPONENTS_HOSTNAMES = {
component_name: (
"{component_prefix}-{component_name}.{namespace}.svc.cluster.local"
).format(
component_name: ("{component_prefix}-{component_name}.{namespace}").format(
component_prefix=REANA_COMPONENT_PREFIX,
component_name=component_name,
namespace=REANA_INFRASTRUCTURE_KUBERNETES_NAMESPACE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@
},
"JobRequest": {
"properties": {
"c4p_additional_requirements": {
"type": "string"
},
"c4p_cpu_cores": {
"type": "string"
},
"c4p_memory_limit": {
"type": "string"
},
"cmd": {
"default": "",
"type": "string"
Expand Down
28 changes: 24 additions & 4 deletions reana_commons/openapi_specifications/reana_server.json
Original file line number Diff line number Diff line change
Expand Up @@ -4049,15 +4049,19 @@
"schema": {
"properties": {
"input_parameters": {
"description": "Optional. Additional input parameters that override the ones from the workflow specification.",
"type": "object"
},
"operational_options": {
"description": "Optional. Additional operational options for workflow execution.",
"type": "object"
},
"reana_specification": {
"description": "Optional. Replace the original workflow specification with the given one. Only considered when restarting a workflow.",
"type": "object"
},
"restart": {
"description": "Optional. If true, restart the given workflow.",
"type": "boolean"
}
},
Expand Down Expand Up @@ -4446,6 +4450,11 @@
},
{
"description": "Required. New workflow status.",
"enum": [
"start",
"stop",
"deleted"
],
"in": "query",
"name": "status",
"required": true,
Expand All @@ -4459,19 +4468,30 @@
"type": "string"
},
{
"description": "Optional. Additional input parameters and operational options.",
"description": "Optional. Additional parameters to customise the workflow status change.",
"in": "body",
"name": "parameters",
"required": false,
"schema": {
"properties": {
"CACHE": {
"type": "string"
},
"all_runs": {
"description": "Optional. If true, delete all runs of the workflow. Only allowed when status is `deleted`.",
"type": "boolean"
},
"input_parameters": {
"description": "Optional. Additional input parameters that override the ones from the workflow specification. Only allowed when status is `start`.",
"type": "object"
},
"operational_options": {
"description": "Optional. Additional operational options for workflow execution. Only allowed when status is `start`.",
"type": "object"
},
"restart": {
"description": "Optional. If true, the workflow is a restart of an earlier workflow execution. Only allowed when status is `start`.",
"type": "boolean"
},
"workspace": {
"description": "Optional, but must be set to true if provided. If true, delete also the workspace of the workflow. Only allowed when status is `deleted`.",
"type": "boolean"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1356,19 +1356,30 @@
"type": "string"
},
{
"description": "Optional. Additional input parameters and operational options for workflow execution. Possible parameters are `CACHE=on/off`, passed to disable caching of results in serial workflows, `all_runs=True/False` deletes all runs of a given workflow if status is set to deleted and `workspace=True/False` which deletes the workspace of a workflow.",
"description": "Optional. Additional parameters to customise the workflow status change.",
"in": "body",
"name": "parameters",
"required": false,
"schema": {
"properties": {
"CACHE": {
"type": "string"
},
"all_runs": {
"description": "Optional. If true, delete all runs of the workflow. Only allowed when status is `deleted`.",
"type": "boolean"
},
"input_parameters": {
"description": "Optional. Additional input parameters that override the ones from the workflow specification. Only allowed when status is `start`.",
"type": "object"
},
"operational_options": {
"description": "Optional. Additional operational options for workflow execution. Only allowed when status is `start`.",
"type": "object"
},
"restart": {
"description": "Optional. If true, the workflow is a restart of an earlier workflow execution. Only allowed when status is `start`.",
"type": "boolean"
},
"workspace": {
"description": "Optional, but must be set to true if provided. If true, delete also the workspace of the workflow. Only allowed when status is `deleted`.",
"type": "boolean"
}
},
Expand Down
22 changes: 21 additions & 1 deletion reana_commons/serial.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@
"compute_backend": {
"$id": "#/properties/steps/properties/compute_backend",
"type": "string",
"enum": ["kubernetes", "htcondorcern", "slurmcern"],
"enum": [
"kubernetes",
"htcondorcern",
"slurmcern",
"compute4punch",
],
},
"kerberos": {
"$id": "#/properties/steps/properties/kerberos",
Expand Down Expand Up @@ -98,6 +103,21 @@
"type": "string",
"default": "",
},
"c4p_cpu_cores": {
"$id": "#/properties/steps/properties/c4p_cpu_cores",
"type": "string",
"default": "",
},
"c4p_memory_limit": {
"$id": "#/properties/steps/properties/c4p_memory_limit",
"type": "string",
"default": "",
},
"c4p_additional_requirements": {
"$id": "#/properties/steps/properties/c4p_additional_requirements",
"type": "string",
"default": "",
},
"commands": {
"$id": "#/properties/steps/properties/commands",
"type": "array",
Expand Down
18 changes: 17 additions & 1 deletion reana_commons/validation/schemas/reana_analysis_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@
"enum": [
"kubernetes",
"htcondorcern",
"slurmcern"
"slurmcern",
"compute4punch"
],
"title": "Compute backend"
},
Expand Down Expand Up @@ -318,6 +319,21 @@
"type": "boolean",
"title": "VOMS proxy",
"description": "Whether to use a VOMS proxy for the step. This would require you to upload a valid VOMS proxy as a REANA secret."
},
"c4p_cpu_cores": {
"type": "string",
"title": "C4P CPU Cores",
"description": "Number of CPU cores requested from Compute4PUNCH for running the task."
},
"c4p_memory_limit": {
"type": "string",
"title": "C4P Memory Limit",
"description": "Amount of memory requested from Compute4PUNCH for running the task."
},
"c4p_additional_requirements": {
"type": "string",
"title": "C4P Additional Requirements",
"description": "Additional HTCondor requirements like RequestGPUs for running the task."
}
},
"required": [
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@
"PyYAML>=5.1,<7.0",
"Werkzeug>=0.14.1",
"wcmatch>=8.3,<8.5",
"gherkin-official>=24.1.0",
"gherkin-official>30; python_version>'3.8'",
"gherkin-official<30; python_version<='3.8'",
"parse>=1.19.0",
]

Expand Down
Loading