Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
LucaCinquini opened this issue Jan 22, 2025 · 0 comments
Open
Labels

Comments

@LucaCinquini
Copy link
Collaborator

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"
}
}
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

No branches or pull requests

1 participant