diff --git a/README.md b/README.md index f8bd860..833acb7 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,8 @@ mkdir config cp waveform-controller/config.EXAMPLE/controller.env.EXAMPLE config/controller.env cp waveform-controller/config.EXAMPLE/exporter.env.EXAMPLE config/exporter.env cp waveform-controller/config.EXAMPLE/hasher.env.EXAMPLE config/hasher.env +cp waveform-controller/config.EXAMPLE/monitoring.env.EXAMPLE config/monitoring.env +cp waveform-controller/config.EXAMPLE/lgtm.env.EXAMPLE config/lgtm.env ``` From the new config files, remove the comments telling you not to put secrets in it, as instructed. @@ -118,13 +120,22 @@ messages. mkdir waveform-export ``` +##### Create docker network +If not already done, create the docker network used for bridging the Emap +portal with the local LGTM (grafana) instance: + +`docker network create emap-portal-grafana` + ##### run it! Build and start the hasher, controller and exporter with docker. +(the `--profile lgtm` brings up the local telemetry collector, +which is optional and soon to be replaced +with a GAE-level lgtm instance) ``` cd waveform-controller -docker compose build -docker compose up -d +docker compose -f docker-compose.yml -f docker-compose.lgtm.yml --profile lgtm build +docker compose -f docker-compose.yml -f docker-compose.lgtm.yml --profile lgtm up -d ``` For more complex deployment scenarios, such as where there is existing data you need to preserve, diff --git a/config.EXAMPLE/lgtm.env.EXAMPLE b/config.EXAMPLE/lgtm.env.EXAMPLE new file mode 100644 index 0000000..cacffef --- /dev/null +++ b/config.EXAMPLE/lgtm.env.EXAMPLE @@ -0,0 +1,12 @@ +# This is an EXAMPLE file, do not put real secrets in here. +# Copy it to ../config/lgtm.env and then DELETE THIS COMMENT. + +# Change the URL hostname for each deployment, to match the hostname +# that the browser sees when accessing this site. Eg. the GAE hostname. +# The URL path should not routinely be changed, as it needs to match +# what the reverse proxy (nginx) is serving us on. +GF_SERVER_ROOT_URL="%(protocol)s://localhost:7100/local-grafana/" + +GF_SECURITY_ADMIN_USER=admin +# please set to something secure +GF_SECURITY_ADMIN_PASSWORD=admin diff --git a/docker-compose.lgtm.yml b/docker-compose.lgtm.yml index 4dbade2..23e2e5c 100644 --- a/docker-compose.lgtm.yml +++ b/docker-compose.lgtm.yml @@ -18,6 +18,18 @@ services: restart: unless-stopped profiles: - lgtm + env_file: + - ../config/lgtm.env + environment: + GF_SERVER_SERVE_FROM_SUB_PATH: "true" + + # Grafana is only accessible on localhost or through password-protected + # Emap portal, so some non-admin access is fine. + GF_AUTH_ANONYMOUS_ENABLED: "true" + GF_AUTH_ANONYMOUS_ORG_ROLE: "Editor" + networks: + - default + - emap-portal-grafana ports: # Grafana UI - "127.0.0.1:3000:3000" @@ -25,13 +37,14 @@ services: - "127.0.0.1:4317:4317" # OTLP HTTP (OpenTelemetry default) - "127.0.0.1:4318:4318" - # Optional: query backends directly (Grafana already has them as datasources) - - "127.0.0.1:3200:3200" # Tempo - - "127.0.0.1:4040:4040" # Pyroscope - - "127.0.0.1:9090:9090" # Prometheus / Mimir volumes: # https://github.com/grafana/docker-otel-lgtm#persist-data-across-container-instantiation - lgtm-data:/data volumes: lgtm-data: + +networks: + # allow the emap-portal to connect to us + emap-portal-grafana: + external: true diff --git a/docs/deployment.md b/docs/deployment.md index c35bf33..2a7f8ba 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -110,7 +110,31 @@ When the core service comes back up, it would continue to update the non-wavefor ### Waveform controller/exporter (ie. this repo) -You may need to delete files in the host directory `waveform-export`, which +#### Bring down all waveform containers and rebuild +``` +docker compose -f docker-compose.yml -f docker-compose.lgtm.yml --profile lgtm down +# check out desired code (example) +git checkout my_branch +git pull +# rebuild +docker compose -f docker-compose.yml -f docker-compose.lgtm.yml --profile lgtm build +``` + +#### Reconfigure + +Check all example config files in `config.EXAMPLE`. This shows what config files are expected to be present +in this version of the code. + +Copy any that don't exist in `../config` as per the instructions in each file. + +Then make sure that any new/deleted variables are adjusted as appropriate. + +You could run this command for each file: +`vimdiff config.EXAMPLE/exporter.env.EXAMPLE ../config/exporter.env` + +#### Reset data + +To force re-processing, you would need to delete files in the host directory `waveform-export`, which is bind mounted by the `waveform-controller` and `waveform-exporter` containers. Snakemake won't regenerate files if the timestamps of upstream @@ -135,7 +159,8 @@ Bring up any Emap services that we brought down: Emap repo: `emap docker up -d` Bring up the waveform controller/export if you brought them down. -Waveform repo: `docker compose up -d` +Waveform repo: `docker compose -f docker-compose.yml -f docker-compose.lgtm.yml --profile lgtm up -d` + ### Replay old HL7 data