From aa7b64e0b98cbb41218fd4834a9f790f09672949 Mon Sep 17 00:00:00 2001 From: Alec Turner Date: Wed, 9 Apr 2025 16:09:46 -0700 Subject: [PATCH 1/3] remove volumes from statistics service and move environment variables to compose Previously, two volumes were bound to the statistics service. Both are removed here. The first volume was a .env file, whose contents are now moved to the compose file under the 'environment' keyword. The second, enabling persistent storage for the /app folder, also caused the crucial 'fetch_and_update.php' to be overwritten. Persistent storage is not currently necessary within this service. --- src/docker-compose.yml | 14 +++++++++++--- src/resources/statistics.env | 15 --------------- 2 files changed, 11 insertions(+), 18 deletions(-) delete mode 100644 src/resources/statistics.env diff --git a/src/docker-compose.yml b/src/docker-compose.yml index 355df5c7..ee8dc5df 100755 --- a/src/docker-compose.yml +++ b/src/docker-compose.yml @@ -21,9 +21,17 @@ services: image: registry.gitlab.com/signalytic/client-external/streamline/streamline-emr/statistics/arm64:2.3 container_name: streamline-emr-statistics restart: unless-stopped - volumes: - - "${STATISTICS_ENV:-./resources/statistics.env}:/app/statistics.env" - - "${STATISTICS_DATA_DIR:-./statistics_data}:/app" + environment: + SERVER: https://impactdashboard.streamlinehealth.tech/ + SERVER_ENDPOINT: signalytic/receive_data + SERVER_STATUS_URL: signalytic/status + DB_HOST: streamline-emr + DB_DATABASE: streamline + DB_USERNAME: root + DB_PASSWORD: streamline + REDIS_HOST: streamline-emr-redis + REDIS_PORT: 6379 + REDIS_TTL: 432000 depends_on: - streamline-emr - redis diff --git a/src/resources/statistics.env b/src/resources/statistics.env deleted file mode 100644 index ac3444ee..00000000 --- a/src/resources/statistics.env +++ /dev/null @@ -1,15 +0,0 @@ -# server endpoint -SERVER=https://impactdashboard.streamlinehealth.tech/ -SERVER_ENDPOINT=signalytic/receive_data -SERVER_STATUS_URL=signalytic/status - -# Database variables -DB_HOST=streamline-emr -DB_DATABASE=streamline -DB_USERNAME=root -DB_PASSWORD=streamline - -# Redis variables -REDIS_HOST=streamline-emr-redis -REDIS_PORT=6379 -REDIS_TTL=432000 # 5Days \ No newline at end of file From bd0919a538b508983d6aaec405ea9972902bfeca Mon Sep 17 00:00:00 2001 From: root Date: Fri, 11 Apr 2025 17:53:07 +0000 Subject: [PATCH 2/3] update statistics image to v2.4 and bump config version to v2.4 The updated statistics image now pulls data from the database once per day, but attempts to upload hourly to prevent large delays due to poor network connectivity. --- config.json | 2 +- src/docker-compose.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config.json b/config.json index bfe93151..721fbb49 100644 --- a/config.json +++ b/config.json @@ -1,7 +1,7 @@ { "name": "streamline-emr", "org": "streamline", - "version": "2.3", + "version": "2.4", "platforms": [ "linux/arm64" ] diff --git a/src/docker-compose.yml b/src/docker-compose.yml index ee8dc5df..e9959ecf 100755 --- a/src/docker-compose.yml +++ b/src/docker-compose.yml @@ -18,7 +18,7 @@ services: retries: 5 statistics: - image: registry.gitlab.com/signalytic/client-external/streamline/streamline-emr/statistics/arm64:2.3 + image: registry.gitlab.com/signalytic/client-external/streamline/streamline-emr/statistics/arm64:2.4 container_name: streamline-emr-statistics restart: unless-stopped environment: @@ -46,4 +46,4 @@ services: test: ["CMD", "redis-cli", "ping"] interval: 30s timeout: 10s - retries: 3 \ No newline at end of file + retries: 3 From 77bbb74ebdf2c4c4ce656544d79477a5b268c58a Mon Sep 17 00:00:00 2001 From: root Date: Fri, 11 Apr 2025 17:54:39 +0000 Subject: [PATCH 3/3] add helper script build-install-local.sh This helper script is used to build and install an 'app-only' version of the package onto the local system. This is intendend to be used on the VM as a way to quickly test new updates to the configuration files using images already available on the system. This is MUCH faster than packaging with images. --- build-install-local.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 build-install-local.sh diff --git a/build-install-local.sh b/build-install-local.sh new file mode 100755 index 00000000..a50d3ba7 --- /dev/null +++ b/build-install-local.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +LOCATION="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + +# build an app-only package (ie don't include images) and store the package path +echo "building app-only package" +package=$(${LOCATION}/package --app | awk -F'saved package: ' '/^saved package: / {print $2}') +echo "generated package: {package}" + +# use a temp folder for unpacking and make sure to clean up when done +tmp="/tmp/build-install-local-$(date +%s)" +echo "prepping temp folder: {tmp}" +rm -rf $tmp +mkdir -p $tmp +trap 'rm -rf $tmp' EXIT + +# unpack to temp folder +echo "unpacking app package: $package" +tar xf $package -C $tmp + +# install package +echo "installing package" +${tmp}/*/install.sh + +echo "done."