Skip to content

Commit d87dc34

Browse files
committed
update instructions add auto-restart to Docker Compose
1 parent 84f91d8 commit d87dc34

File tree

3 files changed

+46
-6
lines changed

3 files changed

+46
-6
lines changed

README.md

+42-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ source bin/activate
2828

2929
# clone codebase and install
3030
git clone https://github.com/ECCC-MSC/msc-wis2node.git
31-
cd msc-wis2node
31+
cd msc-wis2node/msc-wis2node-management
3232
python3 setup.py install
3333

3434
# install sarracenia configurations
@@ -55,9 +55,9 @@ vim local.env # update accordingly
5555
# MSC_WIS2NODE_BROKER_USERNAME: username of the MQTT broker to publish to=admin
5656
# MSC_WIS2NODE_BROKER_PASSWORD: password of the MQTT broker to publish to
5757
# MSC_WIS2NODE_MSC_DATAMART_AMQP: URL to MSC Datamart notification service
58-
# MSC_WIS2NODE_DATASET_CONFIG: filepath where MSC dataset definitions are managed
5958
# MSC_WIS2NODE_DISCOVERY_METADATA_ZIP_URL: URL to SSC GitLab zipfile of MSC discovery metadata
6059
# MSC_WIS2NODE_TOPIC_PREFIX: base topic prefix for publication (i.e. origin/a/wis2/ca-eccc-msc)
60+
# MSC_WIS2NODE_CACHE: optional memcache instance
6161

6262
source local.env
6363

@@ -80,7 +80,46 @@ msc-wis2node dataset delete-metadata --metadata-id 12345
8080

8181
### Docker
8282

83-
Instructions to run msc-wis2node via Docker can be found in the [`docker`](docker) directory.
83+
The Docker setup uses Docker and Docker Compose to manage the following services:
84+
85+
- **msc-wis2node-cache**: memcache caching for data update detection (optional)
86+
- **msc-wis2node-management**: management service to subscribe to MSC Datamart/HPFX and re-publish to WIS2
87+
88+
See [`msc-wis2node.env`](msc-wis2node.env) for default environment variable settings.
89+
90+
To adjust service ports, edit [`docker-compose.override.yml`](docker-compose.override.yml) accordingly.
91+
92+
The [`Makefile`](Makefile) in the root directory provides options to manage the Docker Compose setup.
93+
94+
```bash
95+
# build all images
96+
make build
97+
98+
# build all images (no cache)
99+
make force-build
100+
101+
# start all containers
102+
make up
103+
104+
# start all containers in dev mode
105+
make dev
106+
107+
# view all container logs in realtime
108+
make logs
109+
110+
# login to the msc-wis2node-management container
111+
make login
112+
113+
# restart all containers
114+
make restart
115+
116+
# shutdown all containers
117+
make down
118+
119+
# remove all volumes
120+
make rm
121+
```
122+
84123

85124
## Development
86125

docker-compose.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ services:
2323
container_name: msc-wis2node-cache
2424
env_file:
2525
- msc-wis2node.env
26+
restart: unless-stopped
2627
msc-wis2node-management:
2728
image: msc-wis2node-management
2829
container_name: msc-wis2node
2930
build:
3031
context: msc-wis2node-management/
3132
env_file:
3233
- msc-wis2node.env
33-
volumes:
34-
- ./datasets.yml:/opt/msc-wis2node/conf/datasets.yml
34+
restart: unless-stopped

msc-wis2node.env

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ export MSC_WIS2NODE_BROKER_PORT=8883
33
export MSC_WIS2NODE_BROKER_USERNAME=username
44
export MSC_WIS2NODE_BROKER_PASSWORD=password
55
export MSC_WIS2NODE_MSC_DATAMART_AMQP=amqps://dd.weather.gc.ca
6-
export MSC_WIS2NODE_DATASET_CONFIG=/opt/msc-wis2node/conf/datasets.yml
76
export MSC_WIS2NODE_DISCOVERY_METADATA_ZIP_URL=https://example.org/discovery-metadata.zip
87
export MSC_WIS2NODE_CACHE=msc-wis2node-cache:11211
8+
export MSC_WIS2NODE_CACHE_EXPIRY_SECONDS=86400
99
export MSC_WIS2NODE_CENTRE_ID=ca-eccc-msc
1010
export MSC_WIS2NODE_TOPIC_PREFIX=origin/a/wis2
11+
export MSC_WIS2NODE_WIS2_GDC=https://wis2-gdc.weather.gc.ca/collections/wis2-discovery-metadata

0 commit comments

Comments
 (0)