Skip to content

Commit

Permalink
Merge branch 'main' into new-api-workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
maaikelimper committed Dec 26, 2023
2 parents b6e52a0 + 190ad7d commit 77c92b1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
22 changes: 17 additions & 5 deletions docs/source/user/setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ The discovery metadata is provided in the form of a YAML file.
If you used the ``python3 wis2box-create-config.py`` command to initialize your wis2box, you will find two initial the discovery metadata files in
the directory you specified for your configuration files, under the ``metadata/discovery/`` directory:

* ``metadata-synop.yml``: contains the discovery metadata for the ``synop`` dataset
* ``metadata-temp.yml``: contains the discovery metadata for the ``temp`` dataset
* ``metadata-synop-centreid.yml``: contains the discovery metadata for the ``synop`` dataset
* ``metadata-temp-centreid.yml``: contains the discovery metadata for the ``temp`` dataset

Where ``centreid`` is the centre-id you specified during the configuration step.

Please review the content of these files and edit them as needed.

Expand Down Expand Up @@ -152,11 +154,11 @@ Login to the wis2box-management container
The first step is to add your collection to the wis2box API, using the discovery metadata file you created above.

For example to add the data collection defined in ``metadata/discovery/metadata-synop.yml`` in the directory you specified for your configuration files:
For example to add the data collection defined in ``metadata/discovery/metadata-synop-centreid.yml`` in the directory you specified for your configuration files:

.. code-block:: bash
wis2box data add-collection /data/wis2box/metadata/discovery/metadata-synop.yml
wis2box data add-collection /data/wis2box/metadata/discovery/metadata-synop-centreid.yml
.. note::

If you see an error like ``ValueError: No plugins for XXX defined in data mappings``, exit the wis2box-management container and edit the ``data-mappings.yml`` file
Expand All @@ -174,7 +176,7 @@ The second step is to publish discovery metadata and cache its content in the wi

.. code-block:: bash
wis2box metadata discovery publish /data/wis2box/metadata/discovery/metadata-synop.yml
wis2box metadata discovery publish /data/wis2box/metadata/discovery/metadata-synop-centreid.yml
This command publishes an MQTT message with information about your dataset to the WIS2 Global Discovery Catalogue. Repeat this command whenever you have to provide updated metadata about your dataset.

Expand Down Expand Up @@ -223,6 +225,9 @@ The wis2box-webapp can be accessed by visiting the URL you specified during the

Please note only data for stations that have been added to the wis2box will be ingested and result in WIS2 notifications being published.

Bulk inserting stations from CSV
--------------------------------

You can also bulk insert a set of stations from a CSV file, by defining the stations in ``metadata/stations/station_list.csv`` in your wis2box host directory and running the following command:

.. code-block:: bash
Expand All @@ -249,6 +254,13 @@ If you want to add a topic to a single station, you can use the following comman
python3 wis2box-ctl.py login
wis2box metadata station add-topic --wsi <station-id> <topic-id>
If you want to add a topic to all stations from a specific territory, for example Italy, you can use the following command:

.. code-block:: bash
python3 wis2box-ctl.py login
wis2box metadata station add-topic --territory-name Italy <topic-id>
The next is the :ref:`data-ingest`.

.. _`wis2box Releases`: https://github.com/wmo-im/wis2box/releases
Expand Down
2 changes: 1 addition & 1 deletion wis2box-ctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def make(args) -> None:
print("ERROR: wis2box.env file does not exist. Please create one manually or by running `python3 wis2box-create-config.py`")
exit(1)
run(args, split(
'docker plugin install grafana/loki-docker-driver:latest --alias loki --grant-all-permissions > /dev/null 2>&1'))
'docker plugin install grafana/loki-docker-driver:latest --alias loki --grant-all-permissions'))
run(args, split(
'docker plugin enable loki'))
if containers:
Expand Down

0 comments on commit 77c92b1

Please sign in to comment.