Skip to content

Commit

Permalink
Merge branch 'main' into PLAT-663-run-tests-sh-bug-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelloosen authored Feb 10, 2023
2 parents 08dc394 + 5d6bbe0 commit fa95e7a
Show file tree
Hide file tree
Showing 30 changed files with 544 additions and 570 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ jobs:
run: ./get-cli.sh

- name: Test binaries
run: ./platform-linux help
run: ./instant-linux help

- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
./platform-linux
./platform-macos
./platform.exe
./instant-linux
./instant-macos
./instant.exe
./config.yml
./banner.txt
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,6 @@ typings/
platform-linux
platform.exe
platform-macos
instant-linux
instant.exe
instant-macos
25 changes: 10 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@
1. Initialise Docker Swarm mode: `docker swarm init`
1. Run `go cli` binary to launch the project:

- **Linux**. From terminal run: `./platform-linux`
- Mac. From terminal run: `./platform-macos`
- **Linux**. From terminal run: `./instant-linux` with your selected arguments. A list of available arguments can be found in the help menu by running `./instant-linux help`
- Mac. From terminal run: `./instant-macos` with your selected arguments. A list of available arguments can be found in the help menu by running `./instant-macos help`
> Warning: Mac has an issue with the binary as it views the file as a security risk. See [this article](https://www.lifewire.com/fix-developer-cannot-be-verified-error-5183898) to bypass warning
- Windows. Double click: `platform.exe`
1. Choose your options and deploy!
- Windows. Double click: `platform.exe` (Windows users will need to use a release version below 2.0.0)

## Quick Start for devs (remote cluster)

Expand All @@ -30,17 +29,13 @@ To set up a remote cluster environment, see [readme](https://github.com/jembi/cl

> Each Package contains a `metadata.json` file which lists the configurable Env vars and their default values
1. Run `go cli` binary to launch the project (*Make sure to add the `DOCKER_HOST` variable indicating your **lead Swarm manager***, i.e. DOCKER_HOST=ssh://{lead_ip} ./platform-linux):
1. Run `go cli` binary to launch the project (*Make sure to add the `DOCKER_HOST` variable indicating your **lead Swarm manager***, i.e. DOCKER_HOST=ssh://{lead_ip} ./instant-linux):

1. Check the current cli version in `./get-cli.sh` and run to download binaries
- **Linux**. From terminal run: `./platform-linux`
- Mac. From terminal run: `./platform-macos`
> Warning: Mac has an issue with the binary as it views the file as a security risk
- Windows. Double click: `platform.exe`

1. Choose the **Custom Setup** option
1. Specify your environment variable file (or type them all out :| )
1. Add your package IDs, etc. and deploy!
1. Check the current cli version in `./get-cli.sh` and run to download the binaries. This script can be run with the OS as the first parameter to download only the binary for your prefered OS.
- **Linux**. From terminal run: `./instant-linux` with your selected arguments. A list of available arguments can be found in the help menu by running `./instant-linux help`
- Mac. From terminal run: `./instant-macos` with your selected arguments. A list of available arguments can be found in the help menu by running `./instant-macos help`
> Warning: Mac has an issue with the binary as it views the file as a security risk. See [this article](https://www.lifewire.com/fix-developer-cannot-be-verified-error-5183898) to bypass warning
- Windows. Double click: `platform.exe` (Windows users will need to use a release version below 2.0.0)

## Go Cli Dev

Expand All @@ -56,7 +51,7 @@ The Go Cli runs all services from the `jembi/platform` docker image. When develo
./build-image.sh
```

As you add new packages to the platform remember to list them in `config.yml` file. This config file controls what packages the Go Cli can launch from the UI.
As you add new packages to the platform remember to list them in `config.yaml` file. This config file controls what packages the GO CLI can launch.

For logging all output to a file, ensure that you have created the file and it has the required permissions to be written to.
The default log file with it's path is set in `.env.local` in `BASHLOG_FILE_PATH`.
Expand Down
25 changes: 25 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
projectName: platform
image: jembi/platform
logPath: /tmp/logs

packages:
- interoperability-layer-openhim
- reverse-proxy-nginx
- fhir-datastore-hapi-fhir
- message-bus-kafka
- analytics-datastore-elastic-search
- dashboard-visualiser-kibana
- data-mapper-logstash
- dashboard-visualiser-jsreport
- client-registry-santempi
- message-bus-helper-hapi-proxy
- job-scheduler-ofelia
- kafka-mapper-consumer
- kafka-unbundler-consumer
- analytics-datastore-clickhouse
- dashboard-visualiser-superset
- monitoring
- mpi-mediator
- client-registry-jempi
- identity-access-manager-keycloak
- openhim-mapping-mediator
46 changes: 0 additions & 46 deletions config.yml

This file was deleted.

4 changes: 2 additions & 2 deletions documentation/disaster-recovery-process/hapi-fhir-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ After running the preliminary steps, run the following commands on the node host
docker exec -t <postgres_leader_container_id> pg_ctl start -D /bitnami/postgresql/data
```
8. Do a `down` of `fhir-datastore-hapi-fhir` using the CLI binary\
Example: `./platform-linux down fhir-datastore-hapi-fhir env-file=.env.*`
Example: `./instant-linux package down -n=fhir-datastore-hapi-fhir --env-file=.env.*`
9. Wait for the `down` operation to complete
10. Do an `init` of `fhir-datastore-hapi-fhir` using the CLI binary\
Example: `./platform-linux init fhir-datastore-hapi-fhir env-file=.env.*`
Example: `./instant-linux package init -n=fhir-datastore-hapi-fhir --env-file=.env.*`
Postgres should now be recovered
Expand Down
2 changes: 1 addition & 1 deletion fhir-datastore-hapi-fhir/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ To start up Hapi FHIR and ensure that the backups can be made, ensure that you h

Preliminary steps:

1. Do a `destroy` of `fhir-datastore-hapi-fhir` using the CLI binary (./platform-linux for linux)
1. Do a `destroy` of `fhir-datastore-hapi-fhir` using the CLI binary (./instant-linux for linux)
1. Make sure the Postgres volumes on nodes other than the swarm leader have been removed as well! You will need to ssh into each server and manually remove them.
1. Do an `init` of `fhir-datastore-hapi-fhir` using the CLI binary

Expand Down
24 changes: 12 additions & 12 deletions get-cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,30 @@ cli_version=${2:-latest}
case ${option} in
linux)
echo "Downloading linux binary version: ${cli_version}"
curl -L https://github.com/openhie/package-starter-kit/releases/download/"$cli_version"/gocli-linux -o platform-linux
chmod +x ./platform-linux
curl -L https://github.com/openhie/package-starter-kit/releases/download/"$cli_version"/instant-linux -o instant-linux
chmod +x ./instant-linux
exit 0
;;
macos)
echo "Downloading macos binary version: ${cli_version}"
curl -L https://github.com/openhie/package-starter-kit/releases/download/"$cli_version"/gocli-macos -o platform-macos
chmod +x ./platform-macos
curl -L https://github.com/openhie/package-starter-kit/releases/download/"$cli_version"/instant-macos -o instant-macos
chmod +x ./instant-macos
exit 0
;;
windows)
echo "Downloading windows binary version: ${cli_version}"
curl -L https://github.com/openhie/package-starter-kit/releases/download/"$cli_version"/gocli.exe -o platform.exe
chmod +x ./platform.exe
curl -L https://github.com/openhie/package-starter-kit/releases/download/"$cli_version"/instant.exe -o instant.exe
chmod +x ./instant.exe
exit 0
;;
all)
echo "Downloading all binaries, version: ${cli_version}"
curl -L https://github.com/openhie/package-starter-kit/releases/download/"$cli_version"/gocli-linux -o platform-linux
curl -L https://github.com/openhie/package-starter-kit/releases/download/"$cli_version"/gocli-macos -o platform-macos
curl -L https://github.com/openhie/package-starter-kit/releases/download/"$cli_version"/gocli.exe -o platform.exe
chmod +x ./platform-linux
chmod +x ./platform-macos
chmod +x ./platform.exe
curl -L https://github.com/openhie/package-starter-kit/releases/download/"$cli_version"/instant-linux -o instant-linux
curl -L https://github.com/openhie/package-starter-kit/releases/download/"$cli_version"/instant-macos -o instant-macos
curl -L https://github.com/openhie/package-starter-kit/releases/download/"$cli_version"/instant.exe -o instant.exe
chmod +x ./instant-linux
chmod +x ./instant-macos
chmod +x ./instant.exe
exit 0
;;
--help)
Expand Down
38 changes: 19 additions & 19 deletions test/cucumber/features/cluster-mode/clickhouse.cluster.feature
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
Feature: Analytics Datastore Clickhouse?
Does the Analytics Datastore Clickhouse package work as expected

Scenario: Init Analytics Datastore Clickhouse
Given I use parameters "init analytics-datastore-clickhouse --dev --env-file=.env.cluster"
When I launch the platform with params
Then The service "analytics-datastore-clickhouse-01" should be started with 1 replica
And The service "analytics-datastore-clickhouse-02" should be started with 1 replica
And The service "analytics-datastore-clickhouse-03" should be started with 1 replica
And The service "analytics-datastore-clickhouse-04" should be started with 1 replica
And The service "clickhouse-config-importer" should be removed
And There should be 4 services
Scenario: Init Analytics Datastore Clickhouse
Given I use parameters "package init -n=analytics-datastore-clickhouse --dev --env-file=.env.cluster"
When I launch the platform with params
Then The service "analytics-datastore-clickhouse-01" should be started with 1 replica
And The service "analytics-datastore-clickhouse-02" should be started with 1 replica
And The service "analytics-datastore-clickhouse-03" should be started with 1 replica
And The service "analytics-datastore-clickhouse-04" should be started with 1 replica
And The service "clickhouse-config-importer" should be removed
And There should be 4 services

Scenario: Destroy Analytics Datastore Clickhouse
Given I use parameters "destroy analytics-datastore-clickhouse --dev --env-file=.env.cluster"
When I launch the platform with params
Then The service "analytics-datastore-clickhouse-01" should be removed
And The service "analytics-datastore-clickhouse-02" should be removed
And The service "analytics-datastore-clickhouse-03" should be removed
And The service "analytics-datastore-clickhouse-04" should be removed
And There should be 0 service
And There should be 0 volume
And There should be 0 config
Scenario: Destroy Analytics Datastore Clickhouse
Given I use parameters "package destroy -n=analytics-datastore-clickhouse --dev --env-file=.env.cluster"
When I launch the platform with params
Then The service "analytics-datastore-clickhouse-01" should be removed
And The service "analytics-datastore-clickhouse-02" should be removed
And The service "analytics-datastore-clickhouse-03" should be removed
And The service "analytics-datastore-clickhouse-04" should be removed
And There should be 0 service
And There should be 0 volume
And There should be 0 config
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
Feature: Analytics Datastore Elasticsearch - Dashboard Visualiser Kibana - Data Mapper Logstash ?
Does the ELK stack work as expected

Scenario: Init Dashboard Visualiser Kibana
Given I use parameters "init dashboard-visualiser-kibana --dev --env-file=.env.cluster"
When I launch the platform with params
Then The service "analytics-datastore-elastic-search-01" should be started with 1 replica
And The service "analytics-datastore-elastic-search-02" should be started with 1 replica
And The service "analytics-datastore-elastic-search-03" should be started with 1 replica
And The service "dashboard-visualiser-kibana" should be started with 1 replica
And The service "elastic-search-config-importer" should be removed
And The service "kibana-config-importer" should be removed
And There should be 4 services
And The service "dashboard-visualiser-kibana" should have healthy containers
Scenario: Init Dashboard Visualiser Kibana
Given I use parameters "package init -n=dashboard-visualiser-kibana --dev --env-file=.env.cluster"
When I launch the platform with params
Then The service "analytics-datastore-elastic-search-01" should be started with 1 replica
And The service "analytics-datastore-elastic-search-02" should be started with 1 replica
And The service "analytics-datastore-elastic-search-03" should be started with 1 replica
And The service "dashboard-visualiser-kibana" should be started with 1 replica
And The service "elastic-search-config-importer" should be removed
And The service "kibana-config-importer" should be removed
And There should be 4 services
And The service "dashboard-visualiser-kibana" should have healthy containers

Scenario: Init Data Mapper Logstash
Given I use parameters "init data-mapper-logstash --dev --only --env-file=.env.cluster"
When I launch the platform with params
And The service "data-mapper-logstash" should be started with 3 replicas
And There should be 5 services
And The service "data-mapper-logstash" should have healthy containers

Scenario: Destroy ELK stack
Given I use parameters "destroy dashboard-visualiser-kibana data-mapper-logstash --dev --env-file=.env.cluster"
When I launch the platform with params
Then The service "analytics-datastore-elastic-search-01" should be removed
And The service "analytics-datastore-elastic-search-02" should be removed
And The service "analytics-datastore-elastic-search-03" should be removed
And The service "dashboard-visualiser-kibana" should be removed
And The service "data-mapper-logstash" should be removed
And There should be 0 service
And There should be 0 volume
And There should be 0 config
Scenario: Init Data Mapper Logstash
Given I use parameters "package init -n=data-mapper-logstash --dev --only --env-file=.env.cluster"
When I launch the platform with params
And The service "data-mapper-logstash" should be started with 3 replicas
And There should be 5 services
And The service "data-mapper-logstash" should have healthy containers

Scenario: Destroy ELK stack
Given I use parameters "package destroy -n=dashboard-visualiser-kibana,data-mapper-logstash --dev --env-file=.env.cluster"
When I launch the platform with params
Then The service "analytics-datastore-elastic-search-01" should be removed
And The service "analytics-datastore-elastic-search-02" should be removed
And The service "analytics-datastore-elastic-search-03" should be removed
And The service "dashboard-visualiser-kibana" should be removed
And The service "data-mapper-logstash" should be removed
And There should be 0 service
And There should be 0 volume
And There should be 0 config
50 changes: 25 additions & 25 deletions test/cucumber/features/cluster-mode/hapi-fhir.cluster.feature
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
Feature: Fhir Datastore HAPI-FHIR?
Does the Fhir Datastore HAPI-FHIR package work as expected

Scenario: Init Fhir Datastore HAPI-FHIR
Given I use parameters "init fhir-datastore-hapi-fhir --dev --env-file=.env.cluster"
When I launch the platform with params
Then The service "postgres-1" should be started with 1 replica
And The service "postgres-2" should be started with 1 replica
And The service "postgres-3" should be started with 1 replica
And The service "hapi-fhir" should be started with 3 replicas
And There should be 4 services
And The service "hapi-fhir" should have healthy containers
Scenario: Init Fhir Datastore HAPI-FHIR
Given I use parameters "package init -n=fhir-datastore-hapi-fhir --dev --env-file=.env.cluster"
When I launch the platform with params
Then The service "postgres-1" should be started with 1 replica
And The service "postgres-2" should be started with 1 replica
And The service "postgres-3" should be started with 1 replica
And The service "hapi-fhir" should be started with 3 replicas
And There should be 4 services
And The service "hapi-fhir" should have healthy containers

Scenario: Init Message Bus Helper Hapi Proxy
Given I use parameters "init message-bus-helper-hapi-proxy --only --dev --env-file=.env.cluster"
When I launch the platform with params
Then The service "hapi-proxy" should be started with 3 replicas
And There should be 5 services
Scenario: Init Message Bus Helper Hapi Proxy
Given I use parameters "package init -n=message-bus-helper-hapi-proxy --only --dev --env-file=.env.cluster"
When I launch the platform with params
Then The service "hapi-proxy" should be started with 3 replicas
And There should be 5 services

Scenario: Destroy Fhir Datastore HAPI-FHIR
Given I use parameters "destroy fhir-datastore-hapi-fhir message-bus-helper-hapi-proxy --only --dev --env-file=.env.cluster"
When I launch the platform with params
Then The service "postgres-1" should be removed
And The service "postgres-2" should be removed
And The service "postgres-3" should be removed
And The service "hapi-fhir" should be removed
And The service "hapi-proxy" should be removed
And There should be 0 service
And There should be 0 volume
And There should be 0 config
Scenario: Destroy Fhir Datastore HAPI-FHIR
Given I use parameters "package destroy -n=fhir-datastore-hapi-fhir,message-bus-helper-hapi-proxy --only --dev --env-file=.env.cluster"
When I launch the platform with params
Then The service "postgres-1" should be removed
And The service "postgres-2" should be removed
And The service "postgres-3" should be removed
And The service "hapi-fhir" should be removed
And The service "hapi-proxy" should be removed
And There should be 0 service
And There should be 0 volume
And There should be 0 config
Loading

0 comments on commit fa95e7a

Please sign in to comment.