wmo-im / wis2box

WIS2 in a box is a reference implementation of a WMO WIS2 Node
https://docs.wis2box.wis.wmo.int
Apache License 2.0
37 stars 15 forks source link

wis2box-api breaks too easily #672

Open david-i-berry opened 2 months ago

david-i-berry commented 2 months ago

If a collection or process is misconfigured in the pygeoapi-config.yml the entrypoint.sh script fails and the wis2box-api container fails to start. This is due to https://github.com/wmo-im/wis2box-api/blob/9032a79981098ac368baab3dd9eae1d636677c5c/docker/entrypoint.sh#L61 and the generation of the openapi-config.yml file.

This makes it challenging for users to maintain their collections (and any process plugins), with the container broken on restart if an error is made. This is unnecessary and could be avoided by providing a default openapi-config.yml and updating the openapi-config.yml manually. Instructions are provided as part of pygeoapi: https://docs.pygeoapi.io/en/stable/administration.html#creating-the-openapi-document and this could be part of the system configuration instructions / steps.

Proposed solution:

  1. Include default openapi-config.yml document in the repository / container image.
  2. Remove generation of openapi-config.yml from the entrypoint.sh.
  3. Include instructions on updating the openapi-config.yml file in the wis2box documentation (incl. validation).
  4. Update management container to update the openapi-config.yml when a new collection is added via the metadata editor.
tomkralidis commented 2 months ago

@david-i-berry do we have an example of a misconfigured collection or process? We can also look into the root cause of such misconfiguration.

Having said this, canning the OpenAPI document is a common pattern for deployments whose configurations only change on a release.

david-i-berry commented 1 month ago

@tomkralidis @maaikelimper bumping this issue again.

By canning do you mean throwing away or having a pre canned version of the file? I was interpreting canning as throwing away.

tomkralidis commented 1 month ago

Sorry @david-i-berry pre canned (as opposed to binning :) )