Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkralidis committed Aug 21, 2024
1 parent 08f2c20 commit fdc64a9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/source/reference/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Load initial stations:
wis2box metadata station publish-collection --path /data/wis2box/metadata/station/italy.csv --topic-hierarchy it-roma_met_centre.data.core.weather.surface-based-observations.synop
wis2box metadata station publish-collection --path /data/wis2box/metadata/station/algeria.csv --topic-hierarchy dz-alger_met_centre.data.core.weather.surface-based-observations.synop
wis2box metadata station publish-collection --path /data/wis2box/metadata/station/romania.csv --topic-hierarchy ro-rnimh.data.core.weather.surface-based-observations.synop
wis2box metadata station publish-collection --path /data/wis2box/metadata/station/congo.csv --topic-hierarchy cd-brazza_met_centre.data.core.weather.surface-based-observations.synop
wis2box metadata station publish-collection --path /data/wis2box/metadata/station/congo.csv --topic-hierarchy cd-brazza_met_centre.data.recommended.weather.surface-based-observations.synop
wis2box metadata station publish-collection --path /data/wis2box/metadata/station/wmo-test-ship.csv --topic-hierarchy int-wmo-test.data.core.weather.surface-based-observations.ship
wis2box metadata station publish-collection --path /data/wis2box/metadata/station/wmo-test-buoy.csv --topic-hierarchy int-wmo-test.data.core.weather.surface-based-observations.buoy
wis2box metadata station publish-collection --path /data/wis2box/metadata/station/wmo-test-wind-profiler.csv --topic-hierarchy int-wmo-test.data.core.weather.surface-based-observations.wind_profiler
Expand All @@ -79,7 +79,7 @@ Ingest data using the data ingest command to push data to the ``wis2box-incoming
wis2box data ingest --topic-hierarchy it-roma_met_centre.data.core.weather.surface-based-observations.synop --path $WIS2BOX_DATADIR/observations/italy
wis2box data ingest --topic-hierarchy dz-alger_met_centre.data.core.weather.surface-based-observations.synop --path $WIS2BOX_DATADIR/observations/algeria
wis2box data ingest --topic-hierarchy ro-rnimh.data.core.weather.surface-based-observations.synop --path $WIS2BOX_DATADIR/observations/romania
wis2box data ingest --topic-hierarchy cd-brazza_met_centre.data.core.weather.surface-based-observations.synop --path $WIS2BOX_DATADIR/observations/congo
wis2box data ingest --topic-hierarchy cd-brazza_met_centre.data.recommended.weather.surface-based-observations.synop --path $WIS2BOX_DATADIR/observations/congo
wis2box data ingest --topic-hierarchy int-wmo-test.data.core.weather.surface-based-observations.ship --path $WIS2BOX_DATADIR/observations/wmo/ship
wis2box data ingest --topic-hierarchy int-wmo-test.data.core.weather.surface-based-observations.buoy --path $WIS2BOX_DATADIR/observations/wmo/buoy
wis2box data ingest --topic-hierarchy int-wmo-test.data.core.weather.surface-based-observations.wind_profiler --path $WIS2BOX_DATADIR/observations/wmo/wind_profiler
Expand Down
4 changes: 2 additions & 2 deletions docs/source/user/data-ingest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ Select 'browse' on the ``wis2box-incoming`` bucket and select 'Choose or create

For example using a filepath matching the topic hierarchy:

* Topic Hierarchy: ``origin/a/wis2/cd-brazza_met_centre/data/core/weather/surface-based-observations/synop``
* upload data in the path containing: ``cd-brazza_met_centre/data/core/weather/surface-based-observations/synop``
* Topic Hierarchy: ``origin/a/wis2/cd-brazza_met_centre/data/recommended/weather/surface-based-observations/synop``
* upload data in the path containing: ``cd-brazza_met_centre/data/recommended/weather/surface-based-observations/synop``

The error message ``Path validation error: Could not match http://minio:9000/wis2box-incoming/... to dataset, ...`` indicates that a file was stored in a directory that could not be matched to a dataset.

Expand Down
9 changes: 9 additions & 0 deletions wis2box-management/wis2box/metadata/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,15 @@ def publish_discovery_metadata(metadata: Union[dict, str]):
LOGGER.error(msg)
raise RuntimeError(msg)

oar = Records(DOCKER_API_URL)
try:
LOGGER.debug('Checking if record / auth enabled')
r = oar.collection_item('discovery-metadata', record['id']).json()
if r['wis2box'].get('has_auth', False):
record['wis2box']['has_auth'] = True
except Exception:
LOGGER.debug('No auth defined')

LOGGER.debug('Publishing to API')
upsert_collection_item('discovery-metadata', record)

Expand Down

0 comments on commit fdc64a9

Please sign in to comment.