diff --git a/README.md b/README.md index acd184c..4997c77 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ source bin/activate # clone codebase and install git clone https://github.com/ECCC-MSC/msc-wis2node.git -cd msc-wis2node +cd msc-wis2node/msc-wis2node-management python3 setup.py install # install sarracenia configurations @@ -55,9 +55,9 @@ vim local.env # update accordingly # MSC_WIS2NODE_BROKER_USERNAME: username of the MQTT broker to publish to=admin # MSC_WIS2NODE_BROKER_PASSWORD: password of the MQTT broker to publish to # MSC_WIS2NODE_MSC_DATAMART_AMQP: URL to MSC Datamart notification service -# MSC_WIS2NODE_DATASET_CONFIG: filepath where MSC dataset definitions are managed # MSC_WIS2NODE_DISCOVERY_METADATA_ZIP_URL: URL to SSC GitLab zipfile of MSC discovery metadata # MSC_WIS2NODE_TOPIC_PREFIX: base topic prefix for publication (i.e. origin/a/wis2/ca-eccc-msc) +# MSC_WIS2NODE_CACHE: optional memcache instance source local.env @@ -80,7 +80,46 @@ msc-wis2node dataset delete-metadata --metadata-id 12345 ### Docker -Instructions to run msc-wis2node via Docker can be found in the [`docker`](docker) directory. +The Docker setup uses Docker and Docker Compose to manage the following services: + +- **msc-wis2node-cache**: memcache caching for data update detection (optional) +- **msc-wis2node-management**: management service to subscribe to MSC Datamart/HPFX and re-publish to WIS2 + +See [`msc-wis2node.env`](msc-wis2node.env) for default environment variable settings. + +To adjust service ports, edit [`docker-compose.override.yml`](docker-compose.override.yml) accordingly. + +The [`Makefile`](Makefile) in the root directory provides options to manage the Docker Compose setup. + +```bash +# build all images +make build + +# build all images (no cache) +make force-build + +# start all containers +make up + +# start all containers in dev mode +make dev + +# view all container logs in realtime +make logs + +# login to the msc-wis2node-management container +make login + +# restart all containers +make restart + +# shutdown all containers +make down + +# remove all volumes +make rm +``` + ## Development diff --git a/docker-compose.yml b/docker-compose.yml index 44663ba..2bdf803 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,6 +23,7 @@ services: container_name: msc-wis2node-cache env_file: - msc-wis2node.env + restart: unless-stopped msc-wis2node-management: image: msc-wis2node-management container_name: msc-wis2node @@ -30,5 +31,4 @@ services: context: msc-wis2node-management/ env_file: - msc-wis2node.env - volumes: - - ./datasets.yml:/opt/msc-wis2node/conf/datasets.yml + restart: unless-stopped diff --git a/msc-wis2node.env b/msc-wis2node.env index 583c0b6..a4bebfa 100644 --- a/msc-wis2node.env +++ b/msc-wis2node.env @@ -3,8 +3,9 @@ export MSC_WIS2NODE_BROKER_PORT=8883 export MSC_WIS2NODE_BROKER_USERNAME=username export MSC_WIS2NODE_BROKER_PASSWORD=password export MSC_WIS2NODE_MSC_DATAMART_AMQP=amqps://dd.weather.gc.ca -export MSC_WIS2NODE_DATASET_CONFIG=/opt/msc-wis2node/conf/datasets.yml export MSC_WIS2NODE_DISCOVERY_METADATA_ZIP_URL=https://example.org/discovery-metadata.zip export MSC_WIS2NODE_CACHE=msc-wis2node-cache:11211 +export MSC_WIS2NODE_CACHE_EXPIRY_SECONDS=86400 export MSC_WIS2NODE_CENTRE_ID=ca-eccc-msc export MSC_WIS2NODE_TOPIC_PREFIX=origin/a/wis2 +export MSC_WIS2NODE_WIS2_GDC=https://wis2-gdc.weather.gc.ca/collections/wis2-discovery-metadata