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

Processing - sample process deployment command line vs. Swagger UI #51

Closed
blaziq opened this issue Dec 2, 2024 · 1 comment
Closed

Comments

@blaziq
Copy link

blaziq commented Dec 2, 2024

The CWL process definition is different in the Deployment Guide and in the Swagger UI:

  • https://raw.githubusercontent.com/EOEPCA/deployment-guide/2.0-beta/scripts/processing/oapip/examples/water-bodies.cwl
  • https://github.com/Terradue/ogc-eo-application-package-hands-on/releases/download/1.5.0/app-water-bodies-cloud-native.1.5.0.cwl

The files are largely identical, with only minor differences such as:

  • usage of quotes for values
  • usage of array format vs yaml list format for lists
  • name of the package: water-bodies (water-bodies.cwl) vs. water_bodies (app-water-bodies-cloud-native.1.5.0.cwl)

However, the name difference in the Swagger UI actually causes an process deployment error in the Swagger UI with the default W parameter because it expects the name water-bodies.

Also, if you go to 'deploy a new process' endpoint (POST /processes) and click 'Try it out', then change the Request Body parameter from application/cwl+yaml to application/ocaapppkg+json, the data changes from a valid CWL to something that looks like a JSON schema:

{
  "processDescription": {
    "title": "string",
    "description": "string",
    "keywords": [
      "string"
    ],
    "metadata": [
      {
        "href": "string",
        "rel": "service",
        "type": "application/json",
        "hreflang": "en",
        "title": "string",
        "role": "string"
      },
      {
        "role": "string",
        "title": "string",
        "lang": "string",
        "value": "string"
      }
    ],
    "id": "string",
    "version": "string",
    "jobControlOptions": [
      "sync-execute"
    ],
    "links": [
      {
        "href": "string",
        "rel": "service",
        "type": "application/json",
        "hreflang": "en",
        "title": "string"
      }
    ],
    "inputs": {
      "additionalProp1": {
        "title": "string",
        "description": "string",
        "keywords": [
          "string"
        ],
        "metadata": [
          {
            "href": "string",
            "rel": "service",
            "type": "application/json",
            "hreflang": "en",
            "title": "string",
            "role": "string"
          },
          {
            "role": "string",
            "title": "string",
            "lang": "string",
            "value": "string"
          }
        ],
        "schema": {
          "$ref": "string"
        },
        "minOccurs": 1,
        "maxOccurs": 0,
        "valuePassing": [
          "byValue",
          "byReference"
        ]
      },
      "additionalProp2": {
        "title": "string",
        "description": "string",
        "keywords": [
          "string"
        ],
        "metadata": [
          {
            "href": "string",
            "rel": "service",
            "type": "application/json",
            "hreflang": "en",
            "title": "string",
            "role": "string"
          },
          {
            "role": "string",
            "title": "string",
            "lang": "string",
            "value": "string"
          }
        ],
        "schema": {
          "$ref": "string"
        },
        "minOccurs": 1,
        "maxOccurs": 0,
        "valuePassing": [
          "byValue",
          "byReference"
        ]
      },
      "additionalProp3": {
        "title": "string",
        "description": "string",
        "keywords": [
          "string"
        ],
        "metadata": [
          {
            "href": "string",
            "rel": "service",
            "type": "application/json",
            "hreflang": "en",
            "title": "string",
            "role": "string"
          },
          {
            "role": "string",
            "title": "string",
            "lang": "string",
            "value": "string"
          }
        ],
        "schema": {
          "$ref": "string"
        },
        "minOccurs": 1,
        "maxOccurs": 0,
        "valuePassing": [
          "byValue",
          "byReference"
        ]
      }
    },
    "outputs": {
      "additionalProp1": {
        "title": "string",
        "description": "string",
        "keywords": [
          "string"
        ],
        "metadata": [
          {
            "href": "string",
            "rel": "service",
            "type": "application/json",
            "hreflang": "en",
            "title": "string",
            "role": "string"
          },
          {
            "role": "string",
            "title": "string",
            "lang": "string",
            "value": "string"
          }
        ],
        "schema": {
          "$ref": "string"
        }
      },
      "additionalProp2": {
        "title": "string",
        "description": "string",
        "keywords": [
          "string"
        ],
        "metadata": [
          {
            "href": "string",
            "rel": "service",
            "type": "application/json",
            "hreflang": "en",
            "title": "string",
            "role": "string"
          },
          {
            "role": "string",
            "title": "string",
            "lang": "string",
            "value": "string"
          }
        ],
        "schema": {
          "$ref": "string"
        }
      },
      "additionalProp3": {
        "title": "string",
        "description": "string",
        "keywords": [
          "string"
        ],
        "metadata": [
          {
            "href": "string",
            "rel": "service",
            "type": "application/json",
            "hreflang": "en",
            "title": "string",
            "role": "string"
          },
          {
            "role": "string",
            "title": "string",
            "lang": "string",
            "value": "string"
          }
        ],
        "schema": {
          "$ref": "string"
        }
      }
    }
  },
  "executionUnit": {
    "type": "docker",
    "image": "mydocker/ndvi:latest",
    "deployment": "local",
    "config": {
      "cpuMin": 2,
      "cpuMax": 5,
      "memoryMin": 1,
      "memoryMax": 3
    }
  }
}

which, of course, also fails to deploy correctly.

@james-hinton
Copy link
Contributor

I am unsure if I can comment on the Swagger bug.

However, I have updated the water-bodies.cwl to now use Terradue's latest example. 3394f3b

Packaged within that commit is a fair amount of refactoring too.

@rconway , I have refactored a lot of the IAM BB and have references sections of that within this Processing BB to try to avoid duplication. It's probably worth you having a look through the commit that I have just referenced

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

No branches or pull requests

2 participants