Skip to content

Commit

Permalink
feat(api): add workflow engine versions to info endpoint (reanahub#711)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alputer committed Nov 12, 2024
1 parent 908aca2 commit a5a7daf
Show file tree
Hide file tree
Showing 2 changed files with 222 additions and 0 deletions.
113 changes: 113 additions & 0 deletions docs/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,10 @@
"description": "Request succeeded. The response contains general info about the cluster.",
"examples": {
"application/json": {
"adage_version": {
"title": "CWL version",
"value": "0.11.0"
},
"compute_backends": {
"title": "List of supported compute backends",
"value": [
Expand All @@ -429,6 +433,14 @@
"slurmcern"
]
},
"cwl_package": {
"title": "CWL package",
"value": "cwltool"
},
"cwl_version": {
"title": "CWL version",
"value": "3.1.20210628163208"
},
"dask_autoscaler_enabled": {
"title": "Dask autoscaler enabled in the cluster",
"value": "False"
Expand Down Expand Up @@ -492,18 +504,50 @@
"title": "Maximum retention period in days for workspace files",
"value": "3650"
},
"packtivity_version": {
"title": "Packtivity version",
"value": "0.16.2"
},
"snakemake_version": {
"title": "Snakemake",
"value": "8.24.1"
},
"supported_workflow_engines": {
"title": "List of supported workflow engines",
"value": [
"cwl",
"serial",
"snakemake",
"yadage"
]
},
"workspaces_available": {
"title": "List of available workspaces",
"value": [
"/usr/share",
"/eos/home",
"/var/reana"
]
},
"yadage_version": {
"title": "Yadage version",
"value": "0.20.1"
}
}
},
"schema": {
"properties": {
"adage_version": {
"properties": {
"title": {
"type": "string"
},
"value": {
"type": "string"
}
},
"type": "object"
},
"compute_backends": {
"properties": {
"title": {
Expand All @@ -518,6 +562,28 @@
},
"type": "object"
},
"cwl_package": {
"properties": {
"title": {
"type": "string"
},
"value": {
"type": "string"
}
},
"type": "object"
},
"cwl_version": {
"properties": {
"title": {
"type": "string"
},
"value": {
"type": "string"
}
},
"type": "object"
},
"dask_autoscaler_enabled": {
"properties": {
"title": {
Expand Down Expand Up @@ -700,6 +766,42 @@
},
"type": "object"
},
"packtivity_version": {
"properties": {
"title": {
"type": "string"
},
"value": {
"type": "string"
}
},
"type": "object"
},
"snakemake_version": {
"properties": {
"title": {
"type": "string"
},
"value": {
"type": "string"
}
},
"type": "object"
},
"supported_workflow_engines": {
"properties": {
"title": {
"type": "string"
},
"value": {
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"workspaces_available": {
"properties": {
"title": {
Expand All @@ -713,6 +815,17 @@
}
},
"type": "object"
},
"yadage_version": {
"properties": {
"title": {
"type": "string"
},
"value": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
Expand Down
109 changes: 109 additions & 0 deletions reana_server/rest/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import logging
import traceback
from importlib.metadata import version

from flask import Blueprint, jsonify
from marshmallow import Schema, fields
Expand Down Expand Up @@ -150,6 +151,57 @@ def info(user, **kwargs): # noqa
type: string
type: array
type: object
supported_workflow_engines:
properties:
title:
type: string
value:
items:
type: string
type: array
type: object
cwl_package:
properties:
title:
type: string
value:
type: string
type: object
cwl_version:
properties:
title:
type: string
value:
type: string
type: object
yadage_version:
properties:
title:
type: string
value:
type: string
type: object
adage_version:
properties:
title:
type: string
value:
type: string
type: object
packtivity_version:
properties:
title:
type: string
value:
type: string
type: object
snakemake_version:
properties:
title:
type: string
value:
type: string
type: object
dask_enabled:
properties:
title:
Expand Down Expand Up @@ -250,6 +302,39 @@ def info(user, **kwargs): # noqa
"title": "Whether users are allowed to spawn custom interactive session images",
"value": "False"
},
"supported_workflow_engines": {
"title": "List of supported workflow engines",
"value": [
'cwl',
'serial',
'snakemake',
'yadage'
]
},
"cwl_package": {
"title": "CWL package",
"value": "cwltool"
},
"cwl_version": {
"title": "CWL version",
"value": "3.1.20210628163208"
},
"yadage_version": {
"title": "Yadage version",
"value": "0.20.1"
},
"adage_version": {
"title": "CWL version",
"value": "0.11.0"
},
"packtivity_version": {
"title": "Packtivity version",
"value": "0.16.2"
},
"snakemake_version": {
"title": "Snakemake",
"value": "8.24.1"
},
"dask_enabled": {
"title": "Dask workflows allowed in the cluster",
"value": "False"
Expand Down Expand Up @@ -343,11 +428,27 @@ def info(user, **kwargs): # noqa
]
],
),
supported_workflow_engines=dict(
title="List of supported workflow engines",
value=["cwl", "serial", "snakemake", "yadage"],
),
cwl_package=dict(title="CWL package", value="cwltool"),
cwl_version=dict(title="CWL version", value=version("cwltool")),
yadage_version=dict(title="Yadage version", value=version("yadage")),
adage_version=dict(title="Adage version", value=version("adage")),
packtivity_version=dict(
title="Packtivity version", value=version("packtivity")
),
snakemake_version=dict(
title="Snakemake version",
value=version("snakemake"),
),
dask_enabled=dict(
title="Dask workflows allowed in the cluster",
value=bool(DASK_ENABLED),
),
)

if DASK_ENABLED:
cluster_information["dask_autoscaler_enabled"] = dict(
title="Dask autoscaler enabled in the cluster",
Expand Down Expand Up @@ -419,6 +520,14 @@ class InfoSchema(Schema):
kubernetes_max_memory_limit = fields.Nested(StringInfoValue)
interactive_session_recommended_jupyter_images = fields.Nested(ListStringInfoValue)
interactive_sessions_custom_image_allowed = fields.Nested(StringInfoValue)
supported_workflow_engines = fields.Nested(ListStringInfoValue)
cwl_package = fields.Nested(StringInfoValue)
cwl_version = fields.Nested(StringInfoValue)
yadage_version = fields.Nested(StringInfoValue)
adage_version = fields.Nested(StringInfoValue)
packtivity_version = fields.Nested(StringInfoValue)
snakemake_version = fields.Nested(StringInfoValue)

dask_enabled = fields.Nested(StringInfoValue)
if DASK_ENABLED:
dask_autoscaler_enabled = fields.Nested(StringInfoValue)
Expand Down

0 comments on commit a5a7daf

Please sign in to comment.