Deploying to a local development environment

The following instructions should help with the deployment of a HeartAI development environment to a local machine. Please feel welcome to coordinate with HeartAI administrators and developers to deploy a development environment to your local machine.

Development environment overview

The HeartAI development environment is designed to be modular, with developers deploying corresponding components to support their development objectives and use-cases. This typically includes integrated development framework components, such as Git, Git LFS, Docker Engine, and Docker Compose, such that the developer may interact with the HeartAI source respository. These integrated deployment components also support pre-declared software module packaging and deployment and a variety of backing services such as network, database, and identity services. The developer may require only a limited use of integrated HeartAI components if they are simply using these core functionalities. The developer may also wish to develop corresponding specific software components, such as service-level, application, or analytics software, which are deployable with relation to their corresponding component. For example, service-level deployments typically require a Java Development Kit (JDK) such as OpenJKD, to support development with the and Scala hybrid object-functional programming language, with also build management through the sbt build tool.

Development environment deployment

The following sections provide instructions corresponding to development environment deployment components. The developer should feel welcome to contact HeartAI administrators for any guidance with deploying HeartAI to a local development environment.

HeartAI GitHub repository

The HeartAI GitHub repository is configured as a private repository. Please coordinate with HeartAI administrators for access to the HeartAI repository.

This repository will appear as a 404 page-not-found if the developer does not have access to the HeartAI GitHub repository.

Linux support

HeartAI primarily supports Linux as a development environment and the following deployment instructions have been tested with the following Linux distributions:

HeartAI administrators and developers should read and understand the following policy when working with corporate or personal devices to develop HeartAI:

For professional development in potentially sensitive or operational environments, the recommended operating system is Red Hat Enterprise Linux. For casual development on personal devices, where there is no access to these environments, the recommended operating system is Fedora.

Recommended development machine configuration

The following specifications provide recommended configuration options for development machines. The deployment of HeartAI services primarily relies on memory availability, and the device configuration should prioritise a higher memory specification where available.

Device component Minimum specification Typical specification Advanced specification
CPU 2 vCPU 4 vCPU >= 8 vCPU
GPU Integrated GPU Integrated GPU Dedicated GPU
Memory 8 GB 32 GB >= 64 GB
Storage 128 GB SSD 256 GB SSD >= 1 TB SSD

Cloning the HeartAI repository

If this is the initial deployment of HeartAI to a new development environment, the developer may clone the HeartAI repository to their local machine. In a suitable location of the developer’s local machine, the following command will download and HeartAI repository:

git clone https://github.com/Lukah0173/HeartAI.git

Managing the HeartAI repository

The following commands are generally useful for managing the HeartAI repository. The commands are usually executed from the HeartAI root directory but in certain instances may be performed in specific locations. Developers should be familiar with at least these commands and may wish to consider additional resources for advanced usage.

GitHub implementation

HeartAI source code, task and project management, and associated processes are administered through the Git version control software and the GitHub software development framework. Further information about the HeartAI implementation of GitHub may be found with following documentation:

  • Creating a new branch:
git branch [branch-name]
  • Checking out a branch
git checkout [branch-name]
  • Fetching updates from origin:
git fetch
  • Merging current branch origin updates to the current branch:
git merge origin/[branch-name]
  • Merging master branch origin updates to the current branch:
git merge origin/master
  • Performing a fetch and merge of the current branch:
git pull
  • Stage local repository updates:
git add .
  • Commit staged local repository updates:
git commit -m [commit-message]
  • Push local repository commits:
git push

Deploying integrated HeartAI services

Integrated HeartAI services refers to the pre-configured development environment components that support development activity. These include the software and processes to manage the HeartAI source code repository with technologies such as Git and Git LFS, and deployment orchestrator software such as Docker Engine and Docker Compose. In addition, a variety of integrated backing services are deployable, including network, database, and identity services.

Prerequisites

The following software are primary dependencies for the deployment and management of integrated HeartAI services:

Prerequisite Description
Git Source version control software for the management of the HeartAI source code repository. Enables developers to coordinate with HeartAI source code changes and apply their own changes to the repository.
Git LFS Extension to the Git source version control software. Allows the management of large files within the HeartAI repository, such as data objects, cache files, and pre-trained analytical models. Provided through GitHub integration with Microsoft Azure cloud storage.
Docker Engine Deployment and management server for the orchestration of Docker images. The HeartAI source code respository provides a variety of pre-configured Dockerfile declarations that the developer can readily build and deploy to their local machine environment. Docker Engine provides the general orchestration for these images.
Docker Compose Extension functionalities for Docker Engine, including higher-level deployment orchestrations through a simplified declaration language. The additional capabilities provided by Docker Compose are the primary approach for deploying both HeartAI integrated development services and specific development software components.

Deploying integrated development services

  • Apply the following command in the HeartAI root directory:
source hai-start.sh

This will process the following shell script. The purpose of this script is to:

  1. Deploy integrated service components with orchestration through Docker Compose.
  2. Wait until the Keycloak server is ready and then initialise the pre-configured local development environment Keycloak realm.
echo "Initialising environment for HeartAI version v0.33.26"

docker-compose -f deploy/development/docker-compose-services.yml up -d

HTTPD=000
until [ "$HTTPD" == "200" ]; do
  sleep 5
  HTTPD=$(curl -A "Web Check" -sL --connect-timeout 3 -w "%{http_code}\n" "http://localhost:9990" -o /dev/null)
  echo 'Initialise Keycloak environment...'
done
source deploy/development/keycloak/shell/createDevRealm.sh
Docker image repository timeout

Occasionally the deployment script may timeout when attempting to contact Docker image repositories. In this situation, cancel the deployment process by Ctrl + c in the shell, and reattempt the deployment operation.

The following sections provide further commands useful for managing HeartAI integrated development service components:

Development environment integrations

HeartAI enhances development environment deployments with the integration of infrastructural frameworks and backing services. These are deployed as containerised that are orchestrated with Docker Compose. These managed components support the development of HeartAI by providing integrated, lightweight, and supportive development environment.

Development integration Description Development endpoint URL
Traefik Software-defined networking (SDN) orchestrator http://localhost:8080/
Jaeger Distributed tracing framework http://jaeger.heartai.net.localhost/
whoami Lightweight Go webserver to display OS information through HTTP http://whoami.heartai.net.localhost/
Keycloak Integrated identity and access management platform http://keycloak.heartai.net.localhost/
Apache ZooKeeper Distribution and synchronisation coordinator tcp:2181
Apache Kafka Event-streaming platform tcp:9092
PostgreSQL Relational data server tcp:5432, jdbc:5432
Microsoft SQL Server Relational data server tcp:1433, jdbc:1433
Adminer Management tool for JDBC data servers http://adminer.heartai.net.localhost/
pgAdmin Management tool for PostgreSQL data servers http://pgadmin.heartai.net.localhost/
HAPI FHIR JPA Server 100%-compliant FHIR server http://fhir.heartai.net.localhost/

Corresponding files for development environment deployments with Docker Compose are found at the following directory path:

deploy/development/

Development integration: Traefik

Traefik provides internal edge routing and network management for the HeartAI development environment.

To access Traefik:

Deployment declaration

The following YAML file shows the development environment declaration for a deployment of Traefik:

traefik:
  image: traefik:v2.1
  container_name: heartai-traefik
  command:
    - '--entryPoints.http.address=:80'
    - '--entryPoints.https.address=:443'
    - '--entryPoints.mssql.address=:1433'
    - '--entryPoints.zookeeper.address=:2181'
    - '--entryPoints.postgres.address=:5432'
    - '--entryPoints.metrics.address=:8082'
    - '--entryPoints.kafka.address=:9092'
    - '--tracing.serviceName=traefik'
    - '--providers.docker'
    - '--providers.docker.defaultRule=Host("heartai.net.localhost")'
    - '--api.insecure=true'
    - '--api=true'
    - '--api.dashboard=true'
    - '--ping.entryPoint=http'
    - '--accesslog=true'
    - '--accessLog.bufferingSize=0'
    - '--accesslog.format=json'
    - '--accesslog.fields.defaultmode=keep'
    - '--accesslog.fields.names.ClientUsername=keep'
    - '--accesslog.fields.headers.defaultmode=keep'
    - '--tracing.serviceName=traefik'
    - '--tracing.spanNameLimit=250'
    - '--tracing.jaeger=true'
    - '--tracing.jaeger.samplingServerURL=http://jaegertracing:5778/sampling'
    - '--tracing.jaeger.samplingType=const'
    - '--tracing.jaeger.samplingParam=1'
    - '--tracing.jaeger.localAgentHostPort=127.0.0.1:6831'
    - '--tracing.jaeger.gen128Bit'
    - '--tracing.jaeger.propagation=jaeger'
    - '--tracing.jaeger.traceContextHeaderName=uber-trace-id'
    - '--tracing.jaeger.collector.endpoint=http://jaegertracing:14268/api/traces?format=jaeger.thrift'
  restart: always
  environment:
    TZ: Australia/Adelaide
  volumes:
    - "/var/run/docker.sock:/var/run/docker.sock:ro"
  networks:
    heartai:
  ports:
    - "80:80"
    - "8080:8080"
  privileged: true

Deployment example

The following image shows the Traefik dashboard located at the default endpoint URL:

heartai-development-local-deployment-traefik.png

Development integration: Jaeger

Jaeger is an interoperable distributed tracing framework.

To access Jaeger:

Deployment declaration

The following YAML file declares a deployment of Jaeger:

jaegertracing:
  image: jaegertracing/all-in-one:latest
  container_name: heartai-jaeger
  labels:
    - "traefik.enable=true"
    - "traefik.http.services.jaeger.loadbalancer.server.port=16686"
    - "traefik.http.routers.jaeger.rule=Host(`jaeger.heartai.net.localhost`)"
    - "traefik.http.routers.jaeger.service=jaeger"
    - "traefik.http.routers.jaeger.entrypoints=http"
    - "traefik.docker.network=heartai"
  restart: always
  networks:
    heartai:
  ports:
    - 9411:9411
    - 16686:16686
  privileged: true

Deployment example

The following image shows the Jaeger dashboard located at the default endpoint URL:

heartai-development-local-deployment-jaeger.png

Development integration: whoami

The whoami service is a lightweight Go webserver that displays OS information through HTTP. This service is useful for performing a basic health check that integrated service deployment was successful. Generally, the developer should perform extensive testing.

Testing integrated development services

Further testing examples for integrated development services may be found with the following documentation:

To access whoami:

Deployment declaration

The following YAML file declares a deployment of the whoami service:

whoami:
  image: containous/whoami
  container_name: heartai-whoami
  labels:
    - "traefik.enable=true"
    - "traefik.http.services.whoami.loadbalancer.server.port=80"
    - "traefik.http.routers.whoami.rule=Host(`whoami.heartai.net.localhost`)"
    - "traefik.http.routers.whoami.service=whoami"
    - "traefik.http.routers.whoami.entrypoints=http"
    - "traefik.docker.network=heartai"
  restart: always
  networks:
    heartai:
  privileged: true

Deployment examples

The following command shows using cURL to send a HTTP request to the whoami server:

[[email protected] HeartAI]$ curl -v http://whoami.heartai.net.localhost
*   Trying ::1:80...
* Connected to whoami.heartai.net.localhost (::1) port 80 (#0)
> GET / HTTP/1.1
> Host: whoami.heartai.net.localhost
> User-Agent: curl/7.69.1
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Content-Length: 462
< Content-Type: text/plain; charset=utf-8
< Date: Mon, 25 Apr 2022 11:18:53 GMT
< 
Hostname: 748dbe01d857
IP: 127.0.0.1
IP: 172.31.0.4
RemoteAddr: 172.31.0.1:48170
GET / HTTP/1.1
Host: whoami.heartai.net.localhost
User-Agent: curl/7.69.1
Accept: */*
Accept-Encoding: gzip
Uber-Trace-Id: 255c45144c3fe4437ca758d0e3577286:3f3bab99440a6d89:7ca758d0e3577286:1
X-Forwarded-For: 172.31.0.1
X-Forwarded-Host: whoami.heartai.net.localhost
X-Forwarded-Port: 80
X-Forwarded-Proto: http
X-Forwarded-Server: 8add9fb0f466
X-Real-Ip: 172.31.0.1

* Connection #0 to host whoami.heartai.net.localhost left intact

The following image shows sending a HTTP request to the wmoami server using a web browser:

heartai-development-local-deployment-whoami.png

Development integration: Keycloak

Keycloak is an integrated identity and access management platform:

To access Keycloak:

Deployment declaration

The following YAML file declares a deployment of Keycloak:

keycloak:
  image: quay.io/keycloak/keycloak:16.1.1
  container_name: heartai-keycloak
  labels:
    - "traefik.enable=true"
    - "traefik.http.services.keycloak.loadbalancer.server.port=9990"
    - "traefik.http.routers.keycloak.rule=Host(`keycloak.heartai.net.localhost`)"
    - "traefik.http.routers.keycloak.service=keycloak"
    - "traefik.http.routers.keycloak.entrypoints=http"
    - "traefik.docker.network=heartai"
  restart: always
  environment:
    TZ: Australia/Adelaide
    DB_VENDOR: h2
    KEYCLOAK_USER: heartai
    KEYCLOAK_PASSWORD: heartai
  networks:
    heartai:
  ports:
    - "9990:9990"
  command: [ "-Djboss.http.port=9990" ]
  privileged: true

Deployment examples

The following image shows the Keycloak dashboard located at the default endpoint URL:

heartai-development-local-deployment-keycloak.png

The following image shows the Keycloak administration console:

heartai-development-local-deployment-keycloak-2.png

Development integration: Apache ZooKeeper

Apache ZooKeeper is a distribution and synchronisation coordinator, used particularly to orchestrate the development environment Apache Kafka instance.

To access ZooKeeper:

  • tcp:2181

Deployment declaration

The following YAML file declares a deployment of Apache ZooKeeper:

zookeeper:
  image: confluentinc/cp-zookeeper:latest
  container_name: heartai-zookeeper
  labels:
    - "traefik.enable=true"
    - "traefik.tcp.routers.zookeeper.rule=HostSNI(`*`)"
    - "traefik.tcp.routers.zookeeper.entrypoints=zookeeper"
    - "traefik.tcp.routers.zookeeper.service=zookeeper"
    - "traefik.tcp.services.zookeeper.loadbalancer.server.port=2181"
    - "traefik.docker.network=heartai"
  restart: always
  environment:
    ZOOKEEPER_CLIENT_PORT: 2181
    ZOOKEEPER_TICK_TIME: 1000
  networks:
    heartai:
  ports:
    - "2181:2181"
  volumes:
    - zookeeper-data-volume:/var/lib/zookeeper/data
    - zookeeper-logs-volume:/var/lib/zookeeper/log
  privileged: true

Development integration: Apache Kafka

Apache Kafka is an open-source distributed event-streaming platform.

To access Apache Kafka:

  • tcp:9092

Deployment declaration

The following YAML file declares a deployment of Apache Kafka:

kafka:
  image: confluentinc/cp-kafka:6.1.0
  container_name: heartai-kafka
  labels:
    - "traefik.enable=true"
    - "traefik.tcp.routers.kafka.rule=HostSNI(`*`)"
    - "traefik.tcp.routers.kafka.entrypoints=kafka"
    - "traefik.tcp.routers.kafka.service=kafka"
    - "traefik.tcp.services.kafka.loadbalancer.server.port=9092"
    - "traefik.docker.network=heartai"
  restart: always
  depends_on:
    - zookeeper
  environment:
    KAFKA_BROKER_ID: 1
    KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
    KAFKA_LISTENERS: PLAINTEXT_HOST://:9092
    KAFKA_ADVERTISED_LISTENERS: PLAINTEXT_HOST://localhost:9092
    KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT_HOST:PLAINTEXT
    KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT_HOST
    KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
    LOG_CLEANER_ENABLE: "false"
  volumes:
    - kafka-volume:/var/lib/kafka/data
  networks:
    heartai:
  ports:
    - "9092:9092"
  privileged: true

Development integration: PostgreSQL

PostgreSQL is an open-source and powerful relational data server.

To access PostgreSQL:

  • tcp:5432
  • jdbc:5432

Deployment declaration

The following YAML file declares a deployment of PostgreSQL:

postgres:
  image: postgres:latest
  container_name: heartai-postgres
  labels:
    - "traefik.enable=true"
    - "traefik.tcp.routers.postgres.rule=HostSNI(`*`)"
    - "traefik.tcp.routers.postgres.entrypoints=postgres"
    - "traefik.tcp.routers.postgres.service=postgres"
    - "traefik.tcp.services.postgres.loadbalancer.server.port=5432"
    - "traefik.docker.network=heartai"
  restart: always
  environment:
    TZ: Australia/Adelaide
    POSTGRES_DB: heartai
    POSTGRES_USER: heartai
    POSTGRES_PASSWORD: heartai
    POSTGRES_ROOT_PASSWORD: heartai_root
    PGDATA: /var/lib/postgresql/data/pgdata
  volumes:
    - "./postgres/postgres.conf:/var/lib/postgresql/conf/postgresql.conf"
    - "postgres-volume:/var/lib/postgresql/data/pgdata"
  networks:
    heartai:
  ports:
    - "5432:5432"
  command: -c 'config_file=/var/lib/postgresql/conf/postgresql.conf'
  privileged: true

Development integration: Microsoft SQL Server

Microsoft SQL Server is the primary Microsoft relational data server, deployed here with a development-version licence.

To access Microsoft SQL Server:

  • tcp:1433
  • jdbc:1433

Deployment declaration

The following YAML file declares a deployment of Microsoft SQL Server:

mssql:
  image: mcr.microsoft.com/mssql/server
  container_name: heartai-mssql
  labels:
    - "traefik.enable=true"
    - "traefik.tcp.routers.mssql.rule=HostSNI(`*`)"
    - "traefik.tcp.routers.mssql.entrypoints=mssql"
    - "traefik.tcp.routers.mssql.service=mssql"
    - "traefik.tcp.services.mssql.loadbalancer.server.port=1433"
    - "traefik.docker.network=heartai"
  restart: always
  environment:
    TZ: "Australia/Adelaide"
    ACCEPT_EULA: Y
    SA_PASSWORD: heartai-MSSQL
    MSSQL_PID: Developer
    MSSQL_AGENT_ENABLED: "false"
  networks:
    heartai:
  ports:
    - "1433:1433"
  privileged: true

Development integration: Adminer

Adminer is a lightweight database management tool for databases that support JDBC drivers.

To access Adminer:

Deployment declaration

The following YAML file declares a deployment of Adminer:

adminer:
  image: adminer
  container_name: heartai-adminer
  labels:
    - "traefik.enable=true"
    - "traefik.http.services.adminer.loadbalancer.server.port=8080"
    - "traefik.http.routers.adminer.rule=host(`adminer.heartai.net.localhost`)"
    - "traefik.http.routers.adminer.service=adminer"
    - "traefik.http.routers.adminer.entrypoints=http"
    - "traefik.docker.network=heartai"
  restart: always
  environment:
    TZ: "Australia/Adelaide"
  networks:
    heartai:
  privileged: true

Development integration: pgAdmin

A pgAdmin instance is available to manage the development PostgreSQL data server.

To access pgAdmin:

Input development credentials:

Email Address: [email protected]
Password: heartai
  • If prompted for a password to the data server: heartai.

Deployment declaration

The following YAML file declares a deployment of pgAdmin

pgadmin:
  image: dpage/pgadmin4
  container_name: heartai-pgadmin
  labels:
    - "traefik.enable=true"
    - "traefik.http.services.pgadmin.loadbalancer.server.port=80"
    - "traefik.http.routers.pgadmin.rule=host(`pgadmin.heartai.net.localhost`)"
    - "traefik.http.routers.pgadmin.service=pgadmin"
    - "traefik.http.routers.pgadmin.entrypoints=http"
    - "traefik.docker.network=heartai"
  restart: always
  depends_on:
    - postgres
  environment:
    TZ: Australia/Adelaide
    PGADMIN_DEFAULT_EMAIL: [email protected]
    PGADMIN_DEFAULT_PASSWORD: heartai
  volumes:
    - "./pgadmin/servers.json:/pgadmin4/servers.json"
  networks:
    heartai:
  privileged: true

Deployment examples

The following image shows the pgAdmin dashboard located at the default endpoint URL:

heartai-development-local-deployment-pgadmin.png

The following image shows the pgAdmin overview dashboard:

heartai-development-local-deployment-pgadmin-2.png

The following image shows the pgAdmin server dashboard:

heartai-development-local-deployment-pgadmin-3.png

Development integration: HAPI FHIR JPA Server

A HAPI FHIR JPA Server instance is available to develop clients of the HAPI FHIR server implementation.

To access HAPI FHIR JPA Server:

Testing integrated development services

  • Active Docker processes can be displayed with docker ps.
[[email protected] HeartAI]$ docker ps
ef1d504075f8        confluentinc/cp-kafka:6.1.0        "/etc/confluent/dock…"   6 weeks ago         Up 2 weeks                      0.0.0.0:9092->9092/tcp                                                                                      heartai-kafka
ed2cde017a93        dpage/pgadmin4                     "/entrypoint.sh"         6 weeks ago         Up 2 weeks                      80/tcp, 443/tcp                                                                                             heartai-pgadmin
8446c76f0e0f        hapiproject/hapi:latest            "/usr/bin/java -jar …"   6 weeks ago         Up 2 weeks                      0.0.0.0:5500->8080/tcp                                                                                      heartai-hapi-fhir
d334fb4df81c        confluentinc/cp-zookeeper:latest   "/etc/confluent/dock…"   6 weeks ago         Up 2 weeks                      2888/tcp, 0.0.0.0:2181->2181/tcp, 3888/tcp                                                                  heartai-zookeeper
748dbe01d857        containous/whoami                  "/whoami"                6 weeks ago         Up 2 weeks                      80/tcp                                                                                                      heartai-whoami
8add9fb0f466        traefik:v2.1                       "/entrypoint.sh --en…"   6 weeks ago         Up 2 weeks                      0.0.0.0:80->80/tcp, 0.0.0.0:8080->8080/tcp                                                                  heartai-traefik
aec65978fde2        jaegertracing/all-in-one:latest    "/go/bin/all-in-one-…"   6 weeks ago         Up 2 weeks                      5775/udp, 5778/tcp, 14250/tcp, 0.0.0.0:9411->9411/tcp, 6831-6832/udp, 14268/tcp, 0.0.0.0:16686->16686/tcp   heartai-jaeger
f91057005415        postgres:latest                    "docker-entrypoint.s…"   6 weeks ago         Up 2 weeks                      0.0.0.0:5432->5432/tcp                                                                                      heartai-postgres
9ed2af1330e5        adminer                            "entrypoint.sh docke…"   6 weeks ago         Up 2 weeks                      8080/tcp                                                                                                    heartai-adminer
77eb7603853c        quay.io/keycloak/keycloak:16.1.1   "/opt/jboss/tools/do…"   6 weeks ago         Up 2 weeks                      8443/tcp, 0.0.0.0:9990->8080/tcp                                                                            heartai-keycloak
4c25c4f34ef0        mcr.microsoft.com/mssql/server     "/opt/mssql/bin/perm…"   6 weeks ago         Up 2 weeks                      0.0.0.0:1433->1433/tcp    
  • A successful deployment of Docker managed whoami service is testable sending by a HTTP request to the service:
[[email protected] HeartAI]$ curl -v http://whoami.heartai.net.localhost
*   Trying ::1:80...
* Connected to whoami.heartai.net.localhost (::1) port 80 (#0)
> GET / HTTP/1.1
> Host: whoami.heartai.net.localhost
> User-Agent: curl/7.69.1
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Content-Length: 462
< Content-Type: text/plain; charset=utf-8
< Date: Mon, 25 Apr 2022 11:18:53 GMT
< 
Hostname: 748dbe01d857
IP: 127.0.0.1
IP: 172.31.0.4
RemoteAddr: 172.31.0.1:48170
GET / HTTP/1.1
Host: whoami.heartai.net.localhost
User-Agent: curl/7.69.1
Accept: */*
Accept-Encoding: gzip
Uber-Trace-Id: 255c45144c3fe4437ca758d0e3577286:3f3bab99440a6d89:7ca758d0e3577286:1
X-Forwarded-For: 172.31.0.1
X-Forwarded-Host: whoami.heartai.net.localhost
X-Forwarded-Port: 80
X-Forwarded-Proto: http
X-Forwarded-Server: 8add9fb0f466
X-Real-Ip: 172.31.0.1

* Connection #0 to host whoami.heartai.net.localhost left intact

Stopping integrated development services

  • Deactivate any active HeartAI services by pressing Enter or Ctrl + c in any active HeartAI sbt shells.

  • In the HeartAI directory, shutdown the Docker Compose orchestration:

source hai-stop.sh
  • Stop all active Docker containers (if all containers are already stopped, please ignore the error message):
docker stop $(docker ps -aq)

Updating integrated development services

Fast-forwarded update

Often it’s not necessary to stop and redeploy HeartAI development environments to perform an update. This is particularly true in cases where only HeartAI services and applications have been updated, and not the development environment itself. In these instances it’s more direct to perform the following Git operations without reprovisioning the development environment.

  • In the HeartAI directory, retrieve the current master commit:
git fetch
git merge origin/master
  • In the HeartAI directory, retrieve the current branch commit:
git pull

Clearing integrated development databases

To clear the local databases:

docker system prune --volumes
docker volume prune

Full reset of Docker environment

  • Stop all containers
docker stop `docker ps -qa`
  • Remove all containers
docker rm `docker ps -qa`
  • Remove all images
docker rmi -f `docker images -qa `
  • Remove all volumes
docker volume rm $(docker volume ls -qf)
  • Remove all networks
docker network rm `docker network ls -q`
  • Shell script for environment reset
source deploy/development/reset-docker-environment.sh

Deployment declaration

The following YAML file declares a deployment of HAPI FHIR JPA Server:

fhir:
  image: hapiproject/hapi:latest
  container_name: heartai-hapi-fhir
  labels:
    - "traefik.enable=true"
    - "traefik.http.services.fhir.loadbalancer.server.port=8080"
    - "traefik.http.routers.fhir.rule=host(`fhir.heartai.net.localhost`)"
    - "traefik.http.routers.fhir.service=fhir"
    - "traefik.http.routers.fhir.entrypoints=http"
    - "traefik.docker.network=heartai"
  restart: always
  environment:
    TZ: Australia/Adelaide
  networks:
    heartai:
  ports:
    - "5500:8080"
  privileged: true

Local deployment components

With the deployment of the above HeartAI integrated development components, the developer may proceed to deploy specific HeartAI local development environment components, such as service-level, application, and analytics components.

Local deployment of HeartAI services

Local deployment of HeartAI applications

Local deployment of HeartAI analytics