diff --git a/CHANGES.rst b/CHANGES.rst index 32083a48..cc551769 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -6,6 +6,7 @@ Version 0.9.4 (UNRELEASED) - Changes the REANA specification schema to use the ``draft 2020-12`` version of the JSON schema specification. - Changes validation of REANA specification to expose functions for loading workflow input parameters and workflow specifications. +- Changes the validation schema of the REANA specification to make the ``environment`` property mandatory for the steps of serial workflows. - Fixes the mounting of CVMFS volumes for the REANA deployments that use non-default Kubernetes namespace. Version 0.9.3 (2023-09-26) diff --git a/reana_commons/validation/schemas/reana_analysis_schema.json b/reana_commons/validation/schemas/reana_analysis_schema.json index 65b9afa0..9bd671a1 100644 --- a/reana_commons/validation/schemas/reana_analysis_schema.json +++ b/reana_commons/validation/schemas/reana_analysis_schema.json @@ -108,6 +108,109 @@ } } }, + "oneOf": [ + { + "properties": { + "type": { + "const": "serial" + }, + "specification": { + "type": "object", + "title": "Serial workflow specification.", + "description": "Serial workflow specification.", + "additionalProperties": false, + "properties": { + "steps": { + "type": "array", + "title": "Serial workflow steps.", + "description": "List of steps which represent the workflow.", + "items": { + "properties": { + "name": { + "type": "string", + "title": "Step name." + }, + "environment": { + "type": "string", + "title": "Image to be used by the container in which the step should be run." + }, + "kubernetes_memory_limit": { + "type": "string", + "title": "Memory limit for the step container (e.g. 256Mi)." + }, + "commands": { + "type": "array", + "title": "Step commands.", + "description": "List of commands to be run in the step.", + "items": { + "type": "string", + "title": "Command to be run." + } + } + }, + "required": [ + "environment" + ] + } + } + } + } + } + }, + { + "properties": { + "type": { + "const": "cwl" + }, + "specification": { + "type": "object", + "title": "CWL workflow specification.", + "description": "CWL workflow specification.", + "properties": { + "cwlVersion": { + "type": "string", + "title": "CWL version.", + "description": "CWL version to which the workflow was written for." + }, + "class": { + "type": "string", + "title": "CWL class.", + "description": "CWL class which represents the type of the workflow." + }, + "inputs": { + "type": "array", + "title": "CWL workflow inputs.", + "description": "CWL workflow inputs." + } + } + } + } + }, + { + "properties": { + "type": { + "const": "snakemake" + }, + "specification": { + "type": "object", + "title": "Snakemake workflow specification.", + "description": "Snakemake workflow specification." + } + } + }, + { + "properties": { + "type": { + "const": "yadage" + }, + "specification": { + "type": "object", + "title": "Yadage workflow specification.", + "description": "Yadage workflow specification." + } + } + } + ], "anyOf": [ { "required": [ diff --git a/reana_commons/validation/utils.py b/reana_commons/validation/utils.py index 6038e635..ae7f5fc5 100644 --- a/reana_commons/validation/utils.py +++ b/reana_commons/validation/utils.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # This file is part of REANA. -# Copyright (C) 2022 CERN. +# Copyright (C) 2022, 2023 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. @@ -77,6 +77,8 @@ def validate_reana_yaml(reana_yaml: Dict) -> Dict: """Validate REANA specification file according to jsonschema. :param reana_yaml: Dictionary which represents REANA specification file. + :returns: Dictionary of non-critical warnings, in the form of + {warning_key: [warning_value1, warning_value2, ...]}. :raises ValidationError: Given REANA spec file does not validate against REANA specification schema. """