Skip to content

Commit

Permalink
Merge pull request #80 from EOSC-synergy/release/1.4.0
Browse files Browse the repository at this point in the history
Release/1.4.0
  • Loading branch information
orviz authored Apr 29, 2022
2 parents 2e4b2b0 + 119886d commit d451551
Show file tree
Hide file tree
Showing 4 changed files with 162 additions and 19 deletions.
24 changes: 24 additions & 0 deletions QC.FAIR/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM ubuntu:20.04

MAINTAINER Fernando Aguilar "[email protected]"

RUN apt-get update -y && \
apt-get install -y curl python3-pip python3-dev git vim lsof

RUN ls
RUN git clone https://github.com/EOSC-synergy/FAIR_eva.git

WORKDIR /FAIR_eva

RUN pip3 install -r requirements.txt

EXPOSE 5000 9090
RUN ls
RUN cp config.ini.template config.ini
RUN cd /FAIR_eva
RUN chmod 777 start.sh
RUN cat start.sh
COPY fair-eva.py /usr/bin
RUN chmod +x /usr/bin/fair-eva.py
ENV CONFIG_FILE=/FAIR_eva/config.ini
CMD ["/FAIR_eva/start.sh", "/FAIR_eva/config.ini"]
54 changes: 54 additions & 0 deletions QC.FAIR/fair-eva.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/usr/bin/python3

import argparse
import json
import requests
from pathlib import Path


def get_input_args():
parser = argparse.ArgumentParser(description=(
'Prepare requests for FAIR assessment tool'
))
parser.add_argument(
'-ID',
metavar='ID',
type=str,
help='Persistent Identifier'
)
parser.add_argument(
'-R',
metavar='PLUGIN',
type=str,
help='HTTP method'
)
parser.add_argument(
'-B',
metavar='OAI-PMH',
type=str,
help='OAI-PMH_ENDPOINT'
)
parser.add_argument(
'--tool_endpoint',
metavar='ENDPOINT',
type=str,
help='Enpoint to perform HTTP request. Example: http://localhost:9090/v1.0/rda/rda_all'
)

return parser.parse_args()


def main():
args = get_input_args()
url = args.tool_endpoint
headers = {'Content-Type':'application/json'}
data = {
"id": args.ID,
"repo": args.R,
"oai_base": args.B,
"lang": "ES"
}
r = requests.post(url,data=json.dumps(data), headers=headers)
return json.dumps(r.text)

print(main())
9 changes: 8 additions & 1 deletion docs/tooling.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ The following table summarizes the properties that ought to be set in the tool d
| `docs` | string (url) | URL to the tool's official documentation | :heavy_check_mark: |
| `docker` | object | See [Docker](#docker-docker-property) section | :heavy_check_mark: |
| `executable` | string | Name of the executable. The tool's name is used by default. <br>*This is only required when the executable to be used is different from the tool's name* | |
| `template` | string | Name of the template to use to compose the final command (not a concatenation of `args`)) | |
| `args` | object | See [Arguments](#arguments-args-property) section | |
| `reporting` | object | See [Reporting](#reporting-reporting-property) section | |

Expand All @@ -51,13 +52,19 @@ The `args` property enables the definition of the arguments involved in the tool
| -------- | ---- | ----------- | -------- |
| `type` | string (enum) | Type of the argument. Choose between [`subcommand`, `positional`, `optional`] | :heavy_check_mark: |
| `description` | string | Short description of what the tool does | :heavy_check_mark: |
| `id` | string | Identifier of the argument (used only when `template` property is defined) | :white_check_mark: |
| `value` | *any type* | The value of the argument | |
| `option` | string | The option name (*only applicable for optional arguments*) | :white_check_mark: (for optional arguments) |
| `option` | string | The option name (*only applicable for optional arguments*). See [Special option values](#special-option-values) section for additional customization | :white_check_mark: (for optional arguments) |
| `format` | string (enum) | (for API clients) the value's data type. Useful for graphical interfaces, provides the means to render the form elements (inputs, text areas, dropdowns, ..). Choose between [`string`, `array`] | :white_check_mark: (for API clients) |
| `selectable` | boolean | (for API clients) Whether the argument's value shall be customized by the user, or otherwise it is a fixed (non-modifiable) value | :white_check_mark: (for API clients) |
| `repeatable` | boolean | (for API clients) Whether the same argument can be used several times | :white_check_mark: (for API clients) |
| `args` | object | Suitable when defining commands with more than one type of argument, it allows to define nested `args` properties | |

#### Special `option` values
The name of the `option` property might tell the SQAaaS API to perform additional work. So far it is only supported to set credentials when the `option` value contains the following substrings:
- `jenkins-credential-id`, such as in `--kubeconfig-jenkins-credential-id`.
- `jenkins-credential-variable`, such as in `--kubeconfig-jenkins-credential-variable`.

### Reporting (`reporting` property)
The `reporting` property provides the pointers to the suitable output validator that is capable of parsing the data produced by the given tool. The list of available validator plugins officially supported in the SQAaaS platform can be found in the [sqaaas-reporting-plugins](https://github.com/eosc-synergy/sqaaas-reporting-plugins) repository.

Expand Down
94 changes: 76 additions & 18 deletions tooling.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"checkstyle": {
"docs": "https://github.com/checkstyle/checkstyle",
"docker": {
"image": "davrodgon/checkstyle",
"image": "davrodgon/checkstyle@sha256:2ed1d4efd817afde40b219057935139818ee6b88105e75010bde53cd65786bf2",
"reviewed": "1970-01-01"
},
"args": [{
Expand Down Expand Up @@ -77,10 +77,10 @@
"type": "optional", "description": "only show output in the case of an error", "option": "--quiet", "value": "", "format": "string", "selectable": false, "repeatable": false
},
{
"type": "optional", "description": "report only issues of a given confidence level or higher", "option": "--confidence-level", "value": "high", "format": "string", "selectable": false, "repeatable": false
"type": "optional", "description": "report only issues of a given confidence level or higher", "option": "--confidence-level", "value": ["all", "low", "medium", "high"], "format": "array", "selectable": true, "repeatable": false
},
{
"type": "optional", "description": "report only issues of a given severity level or higher", "option": "--severity-level", "value": "high", "format": "string", "selectable": false, "repeatable": false
"type": "optional", "description": "report only issues of a given severity level or higher", "option": "--severity-level", "value": ["all", "low", "medium", "high"], "format": "array", "selectable": true, "repeatable": false
},
{
"type": "optional", "description": "find and process files in subdirectories", "option": "--recursive", "format": "string", "selectable": false, "repeatable": false
Expand Down Expand Up @@ -124,7 +124,7 @@
"jepl_support": true,
"docs": "https://tox.readthedocs.io/",
"docker": {
"image": "painless/tox",
"image": "painless/tox@sha256:4f31b329507f9ab658e3c36c5252ad063cabe3d978d6836e0ba322ccb79af060",
"reviewed": "1970-01-01"
},
"args": [{
Expand All @@ -138,24 +138,29 @@
}
},
"fair": {
"fair-evaluator": {
"docs": "https://github.com/EOSC-synergy/FAIR_eva",
"fair-eva": {
"executable" : "fair-eva.py",
"docs": "QC.FAIR/fair-eva.py",
"docker": {
"image": "ferag/fair_eva:fair",
"dockerfile": "QC.FAIR/Dockerfile",
"oneshot": false,
"reviewed": "2021-07-06"
"reviewed": "2022-04-05"
},
"executable": "/bin/curl",
"args": [
{"type": "optional", "format": "string", "description": "", "option": "-H", "value": "'Content-Type: application/json'", "selectable": true},
{"type": "optional", "format": "string", "description": "", "option": "-X", "value": "POST", "selectable": true},
{"type": "optional", "format": "string", "description": "", "option": "-d", "value": "'{\"id\": \"10261/157765\", \"repo\": \"oai-pmh\", \"oai_base\": \"http://digital.csic.es/dspace-oai/request\"}'", "selectable": true},
{"type": "positional", "format": "string", "description": "Endpoint", "value": "http://localhost:9090/v1.0/rda/rda_all", "selectable": true}]
{"type": "optional", "format": "string", "description": "Persistent Identifier", "option": "-ID", "value": "10261/157765", "selectable": true},
{"type": "optional", "format": "string", "description": "FAIR EVA plugin", "option": "-R", "value": "oai-pmh", "selectable": true},
{"type": "optional", "format": "string", "description": "OAI-PMH Endpoint", "option": "-B", "value": "http://digital.csic.es/dspace-oai/request", "selectable": true},
{"type": "optional", "format": "string", "description": "FAIR EVA endpoint", "option": "--tool_endpoint", "value": "http://localhost:9090/v1.0/rda/rda_all", "selectable": true}],
"reporting": {
"validator": "fair-eva",
"threshold": 0,
"requirement_level": "REQUIRED"
}
},
"F-UJI": {
"docs": "https://github.com/pangaea-data-publisher/fuji/blob/master/README.md",
"docker": {
"image": "steinsteiny/fuji:fair",
"image": "steinsteiny/fuji:v1.3.8.full",
"oneshot": false,
"reviewed": "2021-07-20"
},
Expand Down Expand Up @@ -283,10 +288,14 @@
"executable": "rst-lint",
"args": [
{
"type": "optional", "description": "Minimum error level to report (default: 'warning')", "option": "--level", "value": "warning", "selectable": false
"type": "optional", "description": "Minimum error level to report (default: 'warning')", "option": "--level", "value": [
"warning", "error", "severe", "info", "debug"
], "format": "array", "selectable": true
},
{
"type": "optional", "description": "Format of the output (default: 'text')", "option": "--format", "value": "json", "selectable": false
"type": "optional", "description": "Format of the output (default: 'text')", "option": "--format", "value": [
"json", "text"
], "format": "array", "selectable": true
},
{
"type": "positional", "description": "File/folder to lint", "value": ".", "selectable": true, "format": "string"
Expand All @@ -308,7 +317,9 @@
},
"args": [
{
"type": "optional", "description": "Type of file to look for in the code repository", "option": "--file-type", "value": "", "format": "string", "selectable": true, "repeatable": false
"type": "optional", "description": "Type of file to look for in the code repository", "option": "--file-type", "value": [
"README", "CODE_OF_CONDUCT", "CONTRIBUTING"
], "format": "array", "selectable": true, "repeatable": false
},
{
"type": "optional", "description": "Path to look for in the code repository", "option": "--path", "value": "", "format": "string", "selectable": true, "repeatable": false
Expand All @@ -324,6 +335,40 @@
}
}
},
"Kubernetes": {
"kubectl (via kustomize)": {
"docs": "https://kubernetes.io/docs/tasks/manage-kubernetes-objects/kustomization/",
"docker": {
"image": "bitnami/kubectl:1.23",
"reviewed": "2022-03-23"
},
"template": "kubectl_kustomize",
"args": [
{
"type": "positional", "description": "Kustomization directory", "id": "k8s_config_files", "value": "", "format": "string", "selectable": true, "repeatable": false,
"type": "optional", "description": "[from kubectl-rollout-status] The length of time to wait before ending watch, zero means never. Any other values should contain a corresponding time unit (e.g. 1s, 2m, 3h)", "id": "k8s_rollout_status_timeout", "option": "--timeout", "value": "0s", "format": "string", "selectable": true, "repeatable": false,
"type": "optional", "description": "Jenkins credential ID with the value of KUBECONFIG environment variable", "option": "--kubeconfig-jenkins-credential-id", "value": "kubernetes-cluster", "format": "string", "selectable": true, "repeatable": false,
"type": "optional", "description": "KUBECONFIG environment variable name", "option": "--kubeconfig-jenkins-credential-variable", "value": "KUBECONFIG", "format": "string", "selectable": false, "repeatable": false
}
]
},
"kubectl (via configuration files)": {
"docs": "https://kubernetes.io/docs/tasks/manage-kubernetes-objects/declarative-config/",
"docker": {
"image": "bitnami/kubectl:1.23",
"reviewed": "2022-03-23"
},
"template": "kubectl_config_files",
"args": [
{
"type": "positional", "description": "File, directory or URL of the configuration file in YAML format", "id": "k8s_config_files", "value": "", "format": "string", "selectable": true, "repeatable": true,
"type": "optional", "description": "[from kubectl-rollout-status] The length of time to wait before ending watch, zero means never. Any other values should contain a corresponding time unit (e.g. 1s, 2m, 3h)", "id": "k8s_rollout_status_timeout", "option": "--timeout", "value": "0s", "format": "string", "selectable": true, "repeatable": false,
"type": "optional", "description": "Jenkins credential ID with the value of KUBECONFIG environment variable", "option": "--kubeconfig-jenkins-credential-id", "value": "kubernetes-cluster", "format": "string", "selectable": true, "repeatable": false,
"type": "optional", "description": "KUBECONFIG environment variable name", "option": "--kubeconfig-jenkins-credential-variable", "value": "KUBECONFIG", "format": "string", "selectable": false, "repeatable": false
}
]
}
},
"default": {
"commands": {
"docs": "https://indigo-dc.github.io/jenkins-pipeline-library/2.0.0/user/config_file.html#commands",
Expand Down Expand Up @@ -371,7 +416,7 @@
"docs": "https://indigo-dc.github.io/sqa-baseline/"
},
"tools": {
"fair": ["fair-evaluator", "F-UJI"]
"fair": ["fair-eva", "F-UJI"]
}
},
"QC.Fun": {
Expand Down Expand Up @@ -436,6 +481,19 @@
"tools": {
"Python": ["tox"]
}
},
"SvcQC.Dep": {
"description": {
"msg": "Perform the service deployment in an automated fashion following Infrastructure as Code (IaC) templates",
"improves": "immutable infrastructure deployment and maintenance",
"docs": "https://eosc-synergy.github.io/service-qa-baseline/#dep"
},
"tools": {
"Kubernetes": [
"kubectl (via kustomize)",
"kubectl (via configuration files)"
]
}
}
}
}

0 comments on commit d451551

Please sign in to comment.