From f2faeaa76f42c4484db70766fc1d7a3a122ee38f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tibor=20=C5=A0imko?= Date: Mon, 6 May 2024 14:23:41 +0200 Subject: [PATCH 1/6] fix(config): remove hard-coded component host name domain (#458) Removes hard-coded infrastructure component host name domain "svc.local.cluster", since this assumption is not really necessary and made REANA not to work under some deployment scenarios, such as on SSL-RIVER. Closes #457 --- reana_commons/config.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/reana_commons/config.py b/reana_commons/config.py index fc20cb35..87296b29 100644 --- a/reana_commons/config.py +++ b/reana_commons/config.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # This file is part of REANA. -# Copyright (C) 2018, 2019, 2020, 2021, 2022, 2023 CERN. +# Copyright (C) 2018, 2019, 2020, 2021, 2022, 2023, 2024 CERN. # # REANA is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. @@ -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, From a389acfeaa26b050f6385e0db4535283a1f157a0 Mon Sep 17 00:00:00 2001 From: Marco Donadoni Date: Tue, 2 Jul 2024 16:41:16 +0200 Subject: [PATCH 2/6] chore(openapi): update OpenAPI specifications (#460) Closes reanahub/reana-server#690 --- .../openapi_specifications/reana_server.json | 30 +++++++++++++++---- .../reana_workflow_controller.json | 21 +++++++++---- 2 files changed, 41 insertions(+), 10 deletions(-) diff --git a/reana_commons/openapi_specifications/reana_server.json b/reana_commons/openapi_specifications/reana_server.json index 3001071d..327c70a8 100644 --- a/reana_commons/openapi_specifications/reana_server.json +++ b/reana_commons/openapi_specifications/reana_server.json @@ -2,7 +2,7 @@ "info": { "description": "Submit workflows to be run on REANA Cloud", "title": "REANA Server", - "version": "0.9.1a3" + "version": "0.9.3" }, "paths": { "/account/settings/linkedaccounts/": {}, @@ -3198,15 +3198,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" } }, @@ -3595,6 +3599,11 @@ }, { "description": "Required. New workflow status.", + "enum": [ + "start", + "stop", + "deleted" + ], "in": "query", "name": "status", "required": true, @@ -3608,19 +3617,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" } }, diff --git a/reana_commons/openapi_specifications/reana_workflow_controller.json b/reana_commons/openapi_specifications/reana_workflow_controller.json index 8fa267f5..e082d75d 100644 --- a/reana_commons/openapi_specifications/reana_workflow_controller.json +++ b/reana_commons/openapi_specifications/reana_workflow_controller.json @@ -2,7 +2,7 @@ "info": { "description": "Submit and manage workflows", "title": "REANA Workflow Controller", - "version": "0.9.1a2" + "version": "0.9.3" }, "paths": { "/api/workflows": { @@ -1116,19 +1116,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" } }, From 0570f4ade9135a2d340009d2091c97dfc81a2e60 Mon Sep 17 00:00:00 2001 From: Manuel Giffels Date: Thu, 15 Feb 2024 13:45:19 +0100 Subject: [PATCH 3/6] feat(schema): allow Compute4PUNCH backend options (#445) --- AUTHORS.md | 1 + reana_commons/api_client.py | 17 +++++++++++++- .../reana_job_controller.json | 9 ++++++++ reana_commons/serial.py | 22 ++++++++++++++++++- .../schemas/reana_analysis_schema.json | 18 ++++++++++++++- 5 files changed, 64 insertions(+), 3 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 373cd589..ac0a2949 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -16,6 +16,7 @@ The list of contributors in alphabetical order: - [Jan Okraska](https://orcid.org/0000-0002-1416-3244) - [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) diff --git a/reana_commons/api_client.py b/reana_commons/api_client.py index 36986c69..7e342a43 100644 --- a/reana_commons/api_client.py +++ b/reana_commons/api_client.py @@ -87,7 +87,7 @@ def _get_spec(self, spec_file): class JobControllerAPIClient(BaseAPIClient): """REANA-Job-Controller http client class.""" - def submit( + def submit( # noqa: C901 self, workflow_uuid="", image="", @@ -108,6 +108,9 @@ def submit( 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. @@ -132,6 +135,9 @@ def submit( :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 = { @@ -181,6 +187,15 @@ def submit( if slurm_time: job_spec["slurm_time"] = slurm_time + if c4p_cpu_cores: + job_spec["c4p_cpu_cores"] = c4p_cpu_cores + + if c4p_memory_limit: + job_spec["c4p_memory_limit"] = c4p_memory_limit + + if c4p_additional_requirements: + job_spec["c4p_additional_requirements"] = c4p_additional_requirements + try: response, http_response = self._client.jobs.create_job( job=job_spec diff --git a/reana_commons/openapi_specifications/reana_job_controller.json b/reana_commons/openapi_specifications/reana_job_controller.json index a4842434..2cc25255 100644 --- a/reana_commons/openapi_specifications/reana_job_controller.json +++ b/reana_commons/openapi_specifications/reana_job_controller.json @@ -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" diff --git a/reana_commons/serial.py b/reana_commons/serial.py index ace49556..b5205992 100644 --- a/reana_commons/serial.py +++ b/reana_commons/serial.py @@ -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", @@ -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", diff --git a/reana_commons/validation/schemas/reana_analysis_schema.json b/reana_commons/validation/schemas/reana_analysis_schema.json index 1a3bc422..692659ef 100644 --- a/reana_commons/validation/schemas/reana_analysis_schema.json +++ b/reana_commons/validation/schemas/reana_analysis_schema.json @@ -247,7 +247,8 @@ "enum": [ "kubernetes", "htcondorcern", - "slurmcern" + "slurmcern", + "compute4punch" ], "title": "Compute backend" }, @@ -297,6 +298,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": [ From b80bc707fa9311e3e5d00ea71bb17f853845d6bf Mon Sep 17 00:00:00 2001 From: Marco Donadoni Date: Tue, 26 Nov 2024 11:54:30 +0100 Subject: [PATCH 4/6] ci(actions): pin setuptools 70 (#479) Pin `setuptools` to the maximum version of 70 to allow working on Ubuntu 20.04 LTS based environments. (New versions of `setuptools` are not compatible.) Note that this fix is necessary only for the `maint-0.9` branches and the REANA 0.9 release series. In `master` we have switched to Ubuntu 24.04 LTS based environments and Python 3.12 and no pinning is necessary there. --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 68619550..4aa95974 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -134,6 +134,7 @@ jobs: - name: Install Python dependencies run: | + pip install --upgrade pip 'setuptools<71' py pip install -e .[all] - name: Run Sphinx documentation with doctests @@ -161,6 +162,7 @@ jobs: - name: Install Python dependencies run: | + pip install --upgrade pip 'setuptools<71' py pip install twine wheel pip install -e .[all] From 5de760512a3aa86282a9dc31ac031773ddf49ef6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jelizaveta=20Leme=C5=A1eva?= Date: Wed, 9 Oct 2024 16:35:40 +0200 Subject: [PATCH 5/6] build(python): add support for Python 3.13 (#480) Closes reanahub/reana#837 --- .github/workflows/ci.yml | 2 +- AUTHORS.md | 1 + setup.py | 1 + tox.ini | 10 +++++++++- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4aa95974..8918beca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -144,7 +144,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] steps: - name: Checkout diff --git a/AUTHORS.md b/AUTHORS.md index ac0a2949..7939a22b 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -14,6 +14,7 @@ The list of contributors in alphabetical order: - [Dinos Kousidis](https://orcid.org/0000-0002-4914-4289) - [Giuseppe Steduto](https://orcid.org/0009-0002-1258-8553) - [Jan Okraska](https://orcid.org/0000-0002-1416-3244) +- [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) diff --git a/setup.py b/setup.py index 8597fede..9d2f2942 100755 --- a/setup.py +++ b/setup.py @@ -123,6 +123,7 @@ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", diff --git a/tox.ini b/tox.ini index 9904a694..81399019 100644 --- a/tox.ini +++ b/tox.ini @@ -5,7 +5,15 @@ # under the terms of the MIT License; see LICENSE file for more details. [tox] -envlist = py36, py37, py38, py39, py310, py311, py312 +envlist = + py36 + py37 + py38 + py39 + py310 + py311 + py312 + py313 [testenv] deps = pytest From 61b0ed582437bd6c2e1044ebd2d0957f782da196 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 28 Nov 2024 08:24:30 +0000 Subject: [PATCH 6/6] chore(maint-0.9): release 0.9.9 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 22 ++++++++++++++++++++++ reana_commons/version.py | 2 +- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c206008b..e0389a46 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.9.8" + ".": "0.9.9" } diff --git a/CHANGELOG.md b/CHANGELOG.md index e366ceca..c38fcb6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/reana_commons/version.py b/reana_commons/version.py index f4a53f06..c19da050 100755 --- a/reana_commons/version.py +++ b/reana_commons/version.py @@ -14,4 +14,4 @@ from __future__ import absolute_import, print_function -__version__ = "0.9.8" +__version__ = "0.9.9"