Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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,
Expand Down
12 changes: 12 additions & 0 deletions config.EXAMPLE/lgtm.env.EXAMPLE
Original file line number Diff line number Diff line change
@@ -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
21 changes: 17 additions & 4 deletions docker-compose.lgtm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,33 @@ 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"
# OTLP gRPC (OpenTelemetry default)
- "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
29 changes: 27 additions & 2 deletions docs/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
Loading