Commit Graph
44 Commits
Author SHA1 Message Date
alec.turner aa7b64e0b9 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.
2025-04-09 16:09:46 -07:00
alec.turner 7e40668ec2 Merge branch 'release-2.3' into 'main'
Release 2.3

See merge request signalytic/client-external/streamline/streamline-emr!14
2025-04-04 15:02:00 +00:00
alec.turner d6ef28f7b1 Merge branch 'streamline-v2.3' into 'develop'
Streamline v2.3

See merge request signalytic/client-external/streamline/streamline-emr!13
2025-04-03 22:44:08 +00:00
alec.turner d647ac5d6f remove unused and outdated app.conf.dbsync
This file is not currently used and doesn't need to be in the repo. The DB
access info also did not match the current implementation.
2025-04-03 12:18:53 -07:00
alec.turner 15ef569fbc remove unnecessary entries from compose file
- Named volumes were still present (but unused) from a previous commit.
- A network was explicitly defined, but was not necessary as all services are
  added to a default bridge network already.
- Remove host port mapping for redis container as the statistics service
  accesses it directly (not through the host). This is also improves security.
2025-04-03 12:14:14 -07:00
alec.turner 886b364b55 add updated 'start_up.sh' script for streamline-emr docker image
This modified script replaces adds a wait condition on startup before attempting
to interact with the database. This is done with 'mariadb-admin ping' run in a
loop at 1s intervals, ultimately timing out after 30s if unsuccessful. Other
minor updates to the script print additional info the docker logs during
startup.
2025-04-02 15:44:52 -07:00
alec.turner 1348cc95ae Merge branch 'drop-demo-data-from-v2' into 'develop'
drop demo data from v2

See merge request signalytic/client-external/streamline/streamline-emr!9
2025-01-22 16:13:41 +00:00
alec.turner 4e9b4e9331 bump image to v2.1
A new v2.1 image is available in the gitlab registry - the config file is
updated accordingly.
2025-01-22 08:11:18 -08:00
alec.turner 733b01c244 update version to 2.1 and add reset condition for v2.0
v2.0 was built using a demo database that should not have been present. v2.1
uses the same application, but should start with a clean database. This change
bumps the version to 2.1 and resets the database if the currently installed
version is 1.* or 2.0.
2025-01-22 08:09:49 -08:00
alec.turner 9f733bb6c9 add custom install script to clear v1 data
The script `install.sh` largely copies the template from the hosted-app-utils
project, with some key changes:
1. replace template parameters (`{{VAR}}`) with hard-coded values
2. define variables for org, app, install root, etc
3. if old version detected, remove data folder before installing update

The modified script will:
1. delete v1 data
2. update normally when v2 or newer installations are present
2025-01-15 09:13:49 -08:00
alec.turner 5390207ec1 revert org name and update image url
org name is reverted to 'streamline' from 'streamlinehealth'
2025-01-15 08:54:13 -08:00
alec.turner a2ce9248f0 Merge branch 'develop' into 'main'
Release 1

See merge request signalytic/client-external/streamline/streamline-emr!6
2024-12-14 00:37:02 +00:00
alec.turner bf78a493bd Merge branch 'simplified-app-mgmt' into 'develop'
reorganize app packaging and prep for production

See merge request signalytic/client-external/streamline/streamline-emr!5
2024-12-14 00:11:42 +00:00
alec.turner c8c4ac7298 disable dbsync and prep for production
- bump version to 1.0
- disable dbsync
- add reference app.conf file to aid in quickly re-enabling dbsync
- upgrade hosted-app-utils to develop
2024-12-13 16:01:08 -08:00
alec.turner d60c85fa14 updated readme to match latest usage 2024-10-28 15:17:52 -07:00
alec.turner abf1c11d47 update hosted-app-utils to use simplified package management 2024-10-18 14:42:40 -07:00
alec.turner 5222a67855 Integrate with hosted-app-utils
Strip down this repo and allow the hosted-app-utils `package` script to
auto-generate the package.
2024-07-30 08:48:18 -07:00
alec.turner a47c7b3d98 Fix wkhtmltopdf bugs
The wkhtmltopdf library does not work with the latest version of alpine. To
workaround this, a known working image based on an older alpine image is pulled
in and relevant libraries copied to the target image.

The `snappy` package required a few updates to support this, including setting
the wkhtmltopdf binary path explicitly and to enable access to local files
(disabled by default).
2024-05-01 17:03:14 -07:00
alec.turner 5e1cb0d8b4 update db init data to fix triage bug
The table `gender_based_violences` was missing a `triage_id` field, causing an
exception to occur in some cases when selecting the triage button. This change
alters the schema of the table to ensure the column is always present.
2024-04-25 15:12:52 -07:00
alec.turner d26252fc11 update dockerfiles based on latest streamline image
The latest images incorporate all changes previously added by the dockerfiles.
The arm image however is still missing/unreliable from the registry and must be
built independently.
2024-04-25 10:04:06 -07:00
alec.turner 6896f639bd bugfix to monitor script to correct resource usage queries
Two bugs are fixed by this commit. First, a typo in the format string used write
resource usage data to the systemlog caused the systemlog to (correctly) reject
the string as invalid json. The second fix is to handle a case where a .env file
is present, but does not define the APP_CONTAINER variable. In this case the
container name is left empty. This is not an immediate issue, but would become
problematic in the future if additional containers were to be added.
2024-04-11 11:46:23 -07:00
alec.turner e35fc56163 Explicitly set version hash to use 7 characters
While 7 is the default number of characters used to abbreviate a commit hash,
this is not (by default) constant and different instances of the same repo may
generate different version strings as a result. This commit sets this length
explicitly to 7 in both package.sh and build-image scripts.
2024-04-11 11:43:26 -07:00
alec.turner 4a89356390 Import latest app updates from streamline
An updated set of source files and initialization was provided by streamline to
address issues observed during initial testing. These files have been updated in
order to generate a new set of app images.
2024-04-11 11:16:51 -07:00
alec.turner cb4c6b4c1a remove unnecessary check for setup process
autoheal was copied from kenya-emr and was still checking for a setup.pid file
and process. This won't do any harm but also does not add value.
2024-04-03 16:28:04 -07:00
alec.turner 9cbefc841f Simplify application management and align with other docker applications
The notion of application "instances" is dropped in favor of a simpler,
single-instance approach. Default values are provided for all configuration
variables so allow the app to run without additional manual configuration.

A health check and auto-heal script are added to automatically restart the
application in case it becomes unavailable during operation.
2024-03-25 09:34:34 -07:00
alec.turner 6c59b1ab76 bugfixes and cleanup from kenyaemr
- fix monitor script
- fix to allow docker build-image script to run from outside folder
- split instance configuration out of start script
2024-03-14 16:27:56 -07:00
alec.turner 50cb23a4c7 Packaging improvements
- compress images with xz by default (and decompress on install)
- add help menu and command line argument parsing to package.sh
- display packaging status if `pv` command available
2024-03-11 16:29:59 -07:00
alec.turner a424394109 Build modified streamline images
The official image from streamline does not currently work for the arm64
platform. As a temporary measure, the source code and docker build scripts
have been lifted from the official images and are used to build locally.

Some additional modifications are made to reduce overall image size, these
are documented in docker/README.md
2024-03-10 16:17:50 -07:00
alec.turner 2ffc3c408a update readme file with notes on building docker images 2024-03-10 14:59:39 -07:00
alec.turner 63ba4d29c8 Update docker images to modify mysql configuration
Dockerfiles are updated with two key changes:
- use streamline's official images as a base
- replace two files related to mysql configuration

A README.md file is added to the docker folder which details the changes, but
the key difference is to limit binary logs to only the `streamline` database.
This prevents additional system databases from being included, which the
database sync tools do not (yet) support.

An unrelated bugfix corrects the docker-compose image tag, specifying 'latest'
instead of a previously hard-coded version.
2024-03-10 14:51:17 -07:00
alec.turner e88aef18f4 Add image utils and bugfixes from kenya-emr 2024-03-09 14:07:45 -08:00
alec.turner a4bb4f5cf6 Merge branch 'app-packaging' into 'develop'
packaging and installation scripts

Closes #2

See merge request signalytic/client-external/streamline/streamline-emr!1
2024-03-08 23:49:12 +00:00
alec.turner 6a4ab99506 fix minor typos in readme 2024-03-08 15:38:53 -08:00
alec.turner 5072872bdb update readme file to clarify installation, configuration process 2024-03-08 15:32:19 -08:00
alec.turner 41a04e5b2d ensure stop is always called at the end of entry script
interrupts were not properly handled by the entry script, and could leave
containers active. This is fixed by running stop in a cleanup function, called
on exit.
2024-03-08 12:53:35 -08:00
alec.turner 0ef5029931 add version file to package and print version on start 2024-03-08 12:39:18 -08:00
alec.turner a2a9395e39 Make image packaging and installation optional
Eventually, images should not be transferred as part of the application package,
using a more efficient mechanism instead. Other cases may already exist where
packaging without the image is preferrable.

When the `PACKAGE_IMAGES` variable is not set to 1 (default: 1), images will not
be included in the package. The installation script now handles the case where
the `images` folder is missing altogether.
2024-03-08 12:29:40 -08:00
alec.turner 04cbf6b1af Reimplement scripts to support multiple app instances
An additional config file `instances.conf` is added to define instance names and
port numbers. The existing `app.conf` was also modified to include an
`instances` field and to move node id and location under this new object. A
`.env` file is used to manage configuration for each instance.

Additional scripts are added: `start`, `stop`, `monitor` - see docs for
description. The main entry script is also modified such that it will run until
any service stops, then brings down the remaining services and exits.
2024-03-08 12:29:37 -08:00
alec.turner 407baf9727 correction to package format
the package format was slightly off - there should have been a folder in the
root of the archive wrapping the package contents. This is now implemented.
2024-03-06 09:03:03 -08:00
alec.turner 3c3af11360 build separate x86_64/aarch64 packages and explicitly define images 2024-03-05 15:12:55 -08:00
alec.turner 7c528766b0 updates to docker-compose.yml and documentation to allow runtime configuration
Further configuration options are made available to support running multiple
instances of the app on the same machine, including the use of docker sibling
containers. `README.md` and `template.env` are updated accordingly.

The database port is no longer exposed as this is not required to access and
manage the app at this time.
2024-03-01 11:05:50 -08:00
alec.turner 1a4756fda0 correct entry script bug and allow config from env file
- A bug in `entry` caused the script to not change into the directory correctly.
This was corrected by marking the script as bash rather than sh.
- `install.sh` now stops a running service before updating
- `docker-compose.yml` now assigns a consistent container name for the app
- `docker-compose.yml` now uses environment variables or a `.env` file to
  assign container name and port mappings if available
- updated readme file with better instructions
2024-02-29 16:37:12 -08:00
alec.turner ca3d2f5540 Implement basic packaging/install/entry scripts
The packaging script will create a new tar.bz2 archive containing an install
script, a set of docker images, and a root folder with files to be installed.
The root folder includes a systemd service, a docker compose file, an entry
script, and a template config file.

On installation docker images are loaded onto the target system, install files
are copied, then systemd services are installed.
2024-02-28 16:52:07 -08:00
alec.turner 9d20658851 Initial commit 2024-01-30 19:40:54 +00:00