Skip to content

[Enhancement]: Redeploy the OGC processes after an SPS redeployment #281

Closed
@LucaCinquini

Description

@LucaCinquini

After the SPS is redeployed, the Airflow Postgres database is restored, but the OGC processes that were deployed are not visible any more because the Python code does not exist any more in the Airflow DAG directory.

One solution to this problem is (with corresponding CURL commands):

  1. Query the OGC API for all processes currently deployed:

export WPST_API=http://.......:8080/unity-luca-1/dev/ogc/
curl -k -v -X GET $WPST_API/processes

  1. Parse the JSON output, and loop over the process ids. Query the API to retrieve the description of each process, save it to a local JSON file:
    curl -k -v -X GET -o ${PROCESS_ID}.json $WPST_API/processes/${PROCESS_ID}

  2. Undeploy each process:
    curl -k -v -X GET $WPST_API/processes/${PROCESS_ID}

4)Read the JSON description of each process and convert it to a format suitable for OGC publication.
Specifically, file ${PROCESS_ID}.json [1] must be converted to file ${PROCESS_ID}_new.json [2]

  1. Redeploy each process:

curl -k -v -X POST -H "Expect:" -H "Content-Type: application/json; charset=utf-8" --data-binary @"./${PROCESS_ID}_new.json" "${WPST_API}/processes"

=========================

[1]
{
"title": "Generic CWL Process",
"description": "This process executes any CWL workflow.",
"keywords": null,
"metadata": null,
"id": "cwl_dag",
"version": "1.0.0",
"jobControlOptions": [
"async-execute"
],
"links": null,
"inputs": {
"cwl_args": {
"title": "CWL Workflow Parameters URL",
"description": "The URL of the CWL workflow's YAML parameters file",
"keywords": null,
"metadata": null,
"schema": {
"title": null,
"multipleOf": null,
"maximum": null,
"exclusiveMaximum": false,
"minimum": null,
"exclusiveMinimum": false,
"maxLength": null,
"minLength": 0,
"pattern": null,
"maxItems": null,
"minItems": 0,
"uniqueItems": false,
"maxProperties": null,
"minProperties": 0,
"required": null,
"enum": null,
"type": "string",
"not": null,
"allOf": null,
"oneOf": null,
"anyOf": null,
"items": null,
"properties": null,
"additionalProperties": null,
"description": null,
"format": "uri",
"default": null,
"nullable": false,
"readOnly": false,
"writeOnly": false,
"example": null,
"deprecated": false,
"contentMediaType": null,
"contentEncoding": null,
"contentSchema": null
},
"minOccurs": 1,
"maxOccurs": 1,
"valuePassing": null
},
"cwl_workflow": {
"title": "CWL Workflow URL",
"description": "The URL of the CWL workflow",
"keywords": null,
"metadata": null,
"schema": {
"title": null,
"multipleOf": null,
"maximum": null,
"exclusiveMaximum": false,
"minimum": null,
"exclusiveMinimum": false,
"maxLength": null,
"minLength": 0,
"pattern": null,
"maxItems": null,
"minItems": 0,
"uniqueItems": false,
"maxProperties": null,
"minProperties": 0,
"required": null,
"enum": null,
"type": "string",
"not": null,
"allOf": null,
"oneOf": null,
"anyOf": null,
"items": null,
"properties": null,
"additionalProperties": null,
"description": null,
"format": "uri",
"default": null,
"nullable": false,
"readOnly": false,
"writeOnly": false,
"example": null,
"deprecated": false,
"contentMediaType": null,
"contentEncoding": null,
"contentSchema": null
},
"minOccurs": 1,
"maxOccurs": 1,
"valuePassing": null
},
"request_instance_type": {
"title": "Requested EC2 Type",
"description": "The specific EC2 instance type requested for the job",
"keywords": null,
"metadata": null,
"schema": {
"title": null,
"multipleOf": null,
"maximum": null,
"exclusiveMaximum": false,
"minimum": null,
"exclusiveMinimum": false,
"maxLength": null,
"minLength": 0,
"pattern": null,
"maxItems": null,
"minItems": 0,
"uniqueItems": false,
"maxProperties": null,
"minProperties": 0,
"required": null,
"enum": null,
"type": "string",
"not": null,
"allOf": null,
"oneOf": null,
"anyOf": null,
"items": null,
"properties": null,
"additionalProperties": null,
"description": null,
"format": null,
"default": null,
"nullable": false,
"readOnly": false,
"writeOnly": false,
"example": null,
"deprecated": false,
"contentMediaType": null,
"contentEncoding": null,
"contentSchema": null
},
"minOccurs": 1,
"maxOccurs": 1,
"valuePassing": null
},
"request_storage": {
"title": "Requested Storage",
"description": "The amount of storage requested for the job",
"keywords": null,
"metadata": null,
"schema": {
"title": null,
"multipleOf": null,
"maximum": null,
"exclusiveMaximum": false,
"minimum": null,
"exclusiveMinimum": false,
"maxLength": null,
"minLength": 0,
"pattern": null,
"maxItems": null,
"minItems": 0,
"uniqueItems": false,
"maxProperties": null,
"minProperties": 0,
"required": null,
"enum": null,
"type": "string",
"not": null,
"allOf": null,
"oneOf": null,
"anyOf": null,
"items": null,
"properties": null,
"additionalProperties": null,
"description": null,
"format": null,
"default": null,
"nullable": false,
"readOnly": false,
"writeOnly": false,
"example": null,
"deprecated": false,
"contentMediaType": null,
"contentEncoding": null,
"contentSchema": null
},
"minOccurs": 1,
"maxOccurs": 1,
"valuePassing": null
}
},
"outputs": {
"result": {
"title": "Process Result",
"description": "The result of the SBG Preprocess Workflow execution",
"keywords": null,
"metadata": null,
"schema": {
"$ref": "some-ref"
}
}
}
}%

============

[2]

{
"title": "Generic CWL Process",
"description": "This process executes any CWL workflow.",
"keywords": null,
"metadata": null,
"id": "cwl_dag",
"version": "1.0.0",
"jobControlOptions": [
"async-execute"
],
"links": null,
"inputs": {
"cwl_args": {
"title": "CWL Workflow Parameters URL",
"description": "The URL of the CWL workflow's YAML parameters file",
"keywords": null,
"metadata": null,
"schema": {
"title": null,
"multipleOf": null,
"maximum": null,
"exclusiveMaximum": false,
"minimum": null,
"exclusiveMinimum": false,
"maxLength": null,
"minLength": 0,
"pattern": null,
"maxItems": null,
"minItems": 0,
"uniqueItems": false,
"maxProperties": null,
"minProperties": 0,
"required": null,
"enum": null,
"type": "string",
"not": null,
"allOf": null,
"oneOf": null,
"anyOf": null,
"items": null,
"properties": null,
"additionalProperties": null,
"description": null,
"format": "uri",
"default": null,
"nullable": false,
"readOnly": false,
"writeOnly": false,
"example": null,
"deprecated": false,
"contentMediaType": null,
"contentEncoding": null,
"contentSchema": null
},
"minOccurs": 1,
"maxOccurs": 1,
"valuePassing": null
},
"cwl_workflow": {
"title": "CWL Workflow URL",
"description": "The URL of the CWL workflow",
"keywords": null,
"metadata": null,
"schema": {
"title": null,
"multipleOf": null,
"maximum": null,
"exclusiveMaximum": false,
"minimum": null,
"exclusiveMinimum": false,
"maxLength": null,
"minLength": 0,
"pattern": null,
"maxItems": null,
"minItems": 0,
"uniqueItems": false,
"maxProperties": null,
"minProperties": 0,
"required": null,
"enum": null,
"type": "string",
"not": null,
"allOf": null,
"oneOf": null,
"anyOf": null,
"items": null,
"properties": null,
"additionalProperties": null,
"description": null,
"format": "uri",
"default": null,
"nullable": false,
"readOnly": false,
"writeOnly": false,
"example": null,
"deprecated": false,
"contentMediaType": null,
"contentEncoding": null,
"contentSchema": null
},
"minOccurs": 1,
"maxOccurs": 1,
"valuePassing": null
},
"request_instance_type": {
"title": "Requested EC2 Type",
"description": "The specific EC2 instance type requested for the job",
"keywords": null,
"metadata": null,
"schema": {
"title": null,
"multipleOf": null,
"maximum": null,
"exclusiveMaximum": false,
"minimum": null,
"exclusiveMinimum": false,
"maxLength": null,
"minLength": 0,
"pattern": null,
"maxItems": null,
"minItems": 0,
"uniqueItems": false,
"maxProperties": null,
"minProperties": 0,
"required": null,
"enum": null,
"type": "string",
"not": null,
"allOf": null,
"oneOf": null,
"anyOf": null,
"items": null,
"properties": null,
"additionalProperties": null,
"description": null,
"format": null,
"default": null,
"nullable": false,
"readOnly": false,
"writeOnly": false,
"example": null,
"deprecated": false,
"contentMediaType": null,
"contentEncoding": null,
"contentSchema": null
},
"minOccurs": 1,
"maxOccurs": 1,
"valuePassing": null
},
"request_storage": {
"title": "Requested Storage",
"description": "The amount of storage requested for the job",
"keywords": null,
"metadata": null,
"schema": {
"title": null,
"multipleOf": null,
"maximum": null,
"exclusiveMaximum": false,
"minimum": null,
"exclusiveMinimum": false,
"maxLength": null,
"minLength": 0,
"pattern": null,
"maxItems": null,
"minItems": 0,
"uniqueItems": false,
"maxProperties": null,
"minProperties": 0,
"required": null,
"enum": null,
"type": "string",
"not": null,
"allOf": null,
"oneOf": null,
"anyOf": null,
"items": null,
"properties": null,
"additionalProperties": null,
"description": null,
"format": null,
"default": null,
"nullable": false,
"readOnly": false,
"writeOnly": false,
"example": null,
"deprecated": false,
"contentMediaType": null,
"contentEncoding": null,
"contentSchema": null
},
"minOccurs": 1,
"maxOccurs": 1,
"valuePassing": null
}
},
"outputs": {
"result": {
"title": "Process Result",
"description": "The result of the SBG Preprocess Workflow execution",
"keywords": null,
"metadata": null,
"schema": {
"$ref": "some-ref"
}
}
}
}

Metadata

Metadata

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions