Skip to content

Commit 8fff48a

Browse files
Maaike updates (#467)
* ubuntu 20.04 * wis2box-api health check * additional documentation updates * Update getting-started.rst * Update setup.rst --------- Co-authored-by: Tom Kralidis <tomkralidis@gmail.com>
1 parent aac9c1b commit 8fff48a

File tree

3 files changed

+56
-17
lines changed

3 files changed

+56
-17
lines changed

docker-compose.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ services:
4343
condition: service_healthy
4444
volumes:
4545
- api-config:/data/wis2box/config/pygeoapi/:rw
46+
healthcheck:
47+
test: ["CMD", "curl", "-f", "http://localhost/oapi/admin/resources"]
48+
interval: 5s
49+
retries: 100
4650

4751
minio:
4852
container_name: wis2box-minio
@@ -90,7 +94,7 @@ services:
9094
# soft: -1
9195
# hard: -1
9296
healthcheck:
93-
test: ["CMD", "curl", "http://localhost:9200"]
97+
test: ["CMD", "curl", "-f", "http://localhost:9200"]
9498
interval: 5s
9599
retries: 100
96100

@@ -124,7 +128,7 @@ services:
124128
mosquitto:
125129
condition: service_started
126130
wis2box-api:
127-
condition: service_started
131+
condition: service_healthy
128132
command: ["wis2box", "pubsub" , "subscribe", "--broker", "http://wis2box-minio:9000", "--topic", "wis2box-storage/#"]
129133

130134
wis2box-auth:

docs/source/user/getting-started.rst

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ Getting started
44
===============
55

66
wis2box can be run on any Linux instance (bare metal or cloud hosted VM) with Python, Docker and Docker Compose installed.
7-
8-
The recommended OS is Ubuntu 22.04 LTS.
7+
The recommended OS is Ubuntu 20.04 LTS.
98

109
.. note::
1110

@@ -40,6 +39,20 @@ wis2box requires the following prior to installation:
4039
Docker Engine, 20.10.14 or higher
4140
Docker Compose, 1.29.2
4241

42+
The following commands be used to setup the required software on Ubuntu 20.04 LTS:
43+
44+
.. code-block:: bash
45+
46+
sudo mkdir -m 0755 -p /etc/apt/keyrings
47+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor --yes -o /etc/apt/keyrings/docker.gpg
48+
sudo chmod a+r /etc/apt/keyrings/docker.gpg
49+
sudo echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
50+
sudo apt-get -y update
51+
sudo apt-get install -y docker-ce unzip python3-pip
52+
sudo pip3 install pip --upgrade
53+
sudo pip3 install pyopenssl --upgrade
54+
sudo pip3 install docker-compose==1.29.2 requests==2.26.0 urllib3==1.26.0
55+
4356
The following commands can be used to inspect the available versions of Python, Docker and Docker Compose on your system:
4457

4558
.. code-block:: bash

docs/source/user/setup.rst

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,29 @@ Copy this file to your working directory, and update it to suit your needs.
3131
3232
cp examples/config/wis2box.env dev.env
3333
34-
.. note::
35-
36-
You must map ``WIS2BOX_HOST_DATADIR`` to the absolute path of a directory on your host machine. This path will be mapped to ``/data/wis2box`` inside the wis2box-management container
37-
To enable external data sharing you must set ``WIS2BOX_URL`` to the URL pointing to where your host is exposed on the public network.
38-
3934
.. note::
4035
Please ensure you set ``WIS2BOX_BROKER_PASSWORD`` and ``WIS2BOX_STORAGE_PASSWORD`` to your own unique values.
4136

4237
You will use these passwords to connect to your broker and MinIO storage to help you debug your wis2box services.
4338

4439
Do not share these passwords with external parties.
4540

46-
The next sections assume you use an environment variable for ``WIS2BOX_HOST_DATADIR`` that is set to same value used in ``dev.env``:
41+
.. note::
42+
43+
You must map ``WIS2BOX_HOST_DATADIR`` to the absolute path of a directory on your host machine. This path will be mapped to ``/data/wis2box`` inside the **wis2box-management** container.
44+
To enable external data sharing you must set ``WIS2BOX_URL`` to the URL pointing to where your host is exposed on the public network.
45+
46+
For example you can create a ``wis2box-data`` directory in your home directory as follows:
47+
48+
.. code-block:: bash
49+
50+
mkdir /home/<your-username>/wis2box-data
51+
52+
And you can edit ``dev.env`` to match the location
4753

4854
.. code-block:: bash
4955
50-
export WIS2BOX_HOST_DATADIR=/home/example/wis2box-data
56+
WIS2BOX_HOST_DATADIR=/home/<your-username>/wis2box-data
5157
5258
Data mappings
5359
-------------
@@ -63,13 +69,13 @@ For example, if your incoming data contains ``.bufr4`` files containing synoptic
6369

6470
.. code-block:: bash
6571
66-
cp synop-bufr-mappings.yml ${WIS2BOX_HOST_DATADIR}/data-mappings.yml
72+
cp synop-bufr-mappings.yml ~/wis2box-data/data-mappings.yml
6773
6874
.. note::
6975

7076
The file should be called ``data-mappings.yml`` and should be placed in the directory you defined as ``WIS2BOX_HOST_DATADIR``.
7177

72-
Edit ``${WIS2BOX_HOST_DATADIR}/data-mappings.yml``:
78+
Edit ``~/wis2box-data/data-mappings.yml``:
7379

7480
* Replace ``country`` with your corresponding ISO 3166 alpha-3 country code in lowercase
7581
* Replace ``centre_id`` with the string identifying the centre running your wis2node in lowercase, alphanumeric characters
@@ -160,10 +166,10 @@ You can copy this file to ``metadata/station/station_list.csv`` in your $WIS2BOX
160166

161167
.. code-block:: bash
162168
163-
mkdir -p ${WIS2BOX_HOST_DATADIR}/metadata/station
164-
cp station_list.csv ${WIS2BOX_HOST_DATADIR}/metadata/station
169+
mkdir -p ~/wis2box-data/metadata/station
170+
cp station_list.csv ~/wis2box-data/metadata/station
165171
166-
And edit ``${WIS2BOX_HOST_DATADIR}/metadata/station/station_list.csv`` to include the data for your stations.
172+
And edit ``~/wis2box-data/metadata/station/station_list.csv`` to include the data for your stations.
167173

168174
.. note::
169175

@@ -181,7 +187,13 @@ Discovery metadata records can be defined using the YAML syntax shared via ``WIS
181187

182188
An example is provided in ``surface-weather-observations.yml``. Each dataset requires its own discovery metadata configuration file.
183189

184-
You can copy the file ``surface-weather-observations.yml`` to the directory you defined for ``WIS2BOX_HOST_DATADIR`` and update it to provide the correct discovery metadata for your dataset:
190+
You can copy the file ``surface-weather-observations.yml`` to the directory defined for ``WIS2BOX_HOST_DATADIR``:
191+
192+
.. code-block:: bash
193+
194+
cp examples/config/surface-weather-observations.yml ~/wis2box-data/metadata/station
195+
196+
And update it to provide the correct discovery metadata for your dataset:
185197

186198
* replace ``[country].[centre_id].data.core.weather.surface-based-observations.synop`` with the topic as previously used in ``$WIS2BOX_HOST_DATADIR/data-mappings.yml``
187199
* text provided in ``identification.title`` and ``identification.abstract`` will be displayed in the wis2box user interface
@@ -205,6 +217,16 @@ This might take a while the first time, as Docker images will be downloaded.
205217
The ``wis2box-ctl.py`` program is used as a convenience utility around a set of Docker Compose commands.
206218
You can customize the ports exposed on your host by editing ``docker-compose.override.yml``.
207219

220+
.. note::
221+
222+
If you get the error:
223+
224+
``docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', PermissionError(13, 'Permission denied'))``
225+
226+
Please ensure your username is added to the docker group ``sudo usermod -aG docker <your-username>``.
227+
Logout and log back in so that your group membership is re-evaluated.
228+
229+
208230
Once the command above is completed, check that all services are running (and healthy).
209231

210232
.. code-block:: bash

0 commit comments

Comments
 (0)