MAAP-Project / Community

Issue for MAAP (Zenhub)
2 stars 1 forks source link

Jobs UI: Indicate required fields on Submit page #665

Open rtapella opened 1 year ago

rtapella commented 1 year ago

Jobs UI Usability Test

Indicate required fields on Submit page. e.g. use * as a marker by the field label

Job should fail to submit if all required fields are not filled out

This requires modifying maap-py/ MAAP API

marjo-luc commented 11 months ago

This all depends on the algorithm_config.yaml the users created when registering their algorithms. The job submission UI only knows what's been registered and can't make any assumptions about the inputs, so if none of the inputs in the algorithm_config.yaml are listed as required, then none will be required to submit the job.

I believe being able to specify which inputs are required/optional is a more recent feature pulled in from another MAAP-related project as well, so we may need to provide a refresher to our users to make sure they are all aware.

rtapella commented 11 months ago

Okay. Does the form understand the syntax to specify which fields are required? Like will it show * or something like it when a field is required?

marjo-luc commented 11 months ago

I double-checked this. Looks like we do not have support for the required/optional algorithm input flag, description, nor the default input value in the WPS/WPS-T responses from the MAAP API. When I registered an algorithm using this algorithm config:

algorithm_description: ''
algorithm_name: run-test2-mlucas
algorithm_version: main
build_command: ''
disk_space: 5GB
docker_container_url: mas.dit.maap-project.org/root/maap-workspaces/base_images/vanilla:develop
inputs:
  config: []
  file:
  - default: https://raw.githubusercontent.com/MAAP-Project/dps-unit-test/main/README.md
    description: input file
    name: input_file
    required: true
  positional: []
queue: maap-dps-worker-8gb
repository_url: https://repo.dit.maap-project.org/root/dps-unit-test.git
run_command: dps-unit-test/run-test.sh

the algorithm was successfully registered, but when I execute a describeProcess request from the MAAP API, none of that information (required/optional, default values, algo descriptions) is provided:

<wps:ProcessOfferings xmlns:wps="http://www.opengis.net/wps/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:schemaLocation="http://schemas.opengis.net/wps/2.0/wps.xsd" xmlns:ows="http://www.opengis.net/ows/2.0">
  <wps:ProcessOffering processVersion="1.1.0" jobControlOptions="sync-execute async-execute" outputTransmission="value reference">
    <wps:Process>
      <ows:Title>Algorithm: run-test2-mlucas ; Version: main</ows:Title>
      <ows:Identifier>run-test2-mlucas:main</ows:Identifier>
      <wps:Input minOccurs="1" maxOccurs="1">
        <ows:Title>input_file</ows:Title>
        <ows:Identifier>input_file</ows:Identifier>
        <ns:LiteralData xmlns:ns="http://www.opengis.net/wps/2.0">
          <ns:Format default="true" mimeType="text/plain" />
          <LiteralDataDomain>
            <ows:AnyValue />
            <ows:DataType ows:reference="xs:string" />
          </LiteralDataDomain>
        </ns:LiteralData>
      </wps:Input>
      <wps:Input minOccurs="1" maxOccurs="1">
        <ows:Title>queue_name</ows:Title>
        <ows:Identifier>queue_name</ows:Identifier>
        <ns:LiteralData xmlns:ns="http://www.opengis.net/wps/2.0">
          <ns:Format default="true" mimeType="text/plain" />
          <LiteralDataDomain>
            <wps:Data>
              <wps:LiteralValue>maap-dps-worker-8gb</wps:LiteralValue>
            </wps:Data>
          </LiteralDataDomain>
        </ns:LiteralData>
      </wps:Input>
      <wps:Output />
    </wps:Process>
  </wps:ProcessOffering>
</wps:ProcessOfferings>

It looks like HySDS more or less supports these fields but the info is not passed through the MAAP API because we haven't extended the WPS specs to include that information.

To provide the required/optional flag, description, and input default values, we would need an OGC-related discussion and some updates to the MAAP API WPS-formatted responses.