From 5f8d82ffd2aab182103bd374449cb43c58e2f1cd Mon Sep 17 00:00:00 2001 From: Sahil Malhotra Date: Mon, 15 Nov 2021 12:26:55 -0500 Subject: [PATCH 01/20] docker dev env files moverd from DRLS-Docker repo --- .dockerignore | 7 + .env | 2 + .gitignore | 2 + DockerSetupGuideForMacOS.md | 256 ++++++++++++++++++++++++++++++++++++ Dockerfile | 2 + Dockerfile.dev | 2 + Dockerfile.tmpl | 43 ++++++ docker-compose-dev.yml | 102 ++++++++++++++ docker-compose.yml | 65 +++++++++ docker-sync.yml | 22 ++++ porter.yaml | 44 +++++++ 11 files changed, 547 insertions(+) create mode 100644 .dockerignore create mode 100644 .env create mode 100644 .gitignore create mode 100644 DockerSetupGuideForMacOS.md create mode 100644 Dockerfile create mode 100644 Dockerfile.dev create mode 100644 Dockerfile.tmpl create mode 100644 docker-compose-dev.yml create mode 100644 docker-compose.yml create mode 100644 docker-sync.yml create mode 100644 porter.yaml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..d1e5aa48 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +# See https://docs.docker.com/engine/reference/builder/#dockerignore-file +# Put files here that you don't want copied into your bundle's invocation image +.gitignore +Dockerfile.tmpl + +.cnab/ +.docker-sync/ \ No newline at end of file diff --git a/.env b/.env new file mode 100644 index 00000000..f656f1bd --- /dev/null +++ b/.env @@ -0,0 +1,2 @@ +VSAC_API_KEY=f6486e93-5f75-481c-a5c1-b6395d7a217d +# COMPOSE_PROJECT_NAME=Prod-DRLS \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..9963e1c4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.cnab/ +.docker-sync/ \ No newline at end of file diff --git a/DockerSetupGuideForMacOS.md b/DockerSetupGuideForMacOS.md new file mode 100644 index 00000000..679c7764 --- /dev/null +++ b/DockerSetupGuideForMacOS.md @@ -0,0 +1,256 @@ +# DRLS-Docker-The Ultimate Guide to Running DRLS (Prior Auth workflow) for Local Development +Repository to host root docker bundle config files for local development and publishing + + +## Purpose of this guide + +This document details the installation process for the dockerized version of the **Documentation Requirements Lookup Service (DRLS)** system for Local Development, complete with file synchronization and server reloading. To achieve this functionality, this guide takes advantage of the docker-sync tool. Be aware that each component of DRLS has its own README where you will find more detailed documentation. This document **is not designed to replace those individual READMEs**. + +This document **is designed to take you through the entire set up process for DRLS using docker containers**. It is a standalone guide that does not depend on any supplementary DRLS documentation. + +This guide will take you through the development environment setup for each of the following DRLS components: +1. [Coverage Requirements Discovery (CRD)](https://github.com/HL7-DaVinci/CRD) +2. [(Test) EHR FHIR Service](https://github.com/HL7-DaVinci/test-ehr) +3. [Documents, Templates, and Rules (DTR) SMART on FHIR app](https://github.com/HL7-DaVinci/dtr) +4. [Clinical Decision Support (CDS) Library](https://github.com/HL7-DaVinci/CDS-Library) +5. [CRD Request Generator](https://github.com/HL7-DaVinci/crd-request-generator) +6. Keycloak + + +## Prerequisites + +Your computer must have these minimum requirements: +- Running MacOS + + > The docker synchronization strategy used by docker-sync in this guide is designed for MacOs use. The same configuration will likely not work on Windows as the synchronization strategy used by docker-sync on windows can not handle more than 30 sync files at a time. Reference documentaion: https://docker-sync.readthedocs.io/en/latest/advanced/sync-strategies.html# + +- x86_64 (64-bit) or equivalent processor + * Follow these instructions to verify your machine's compliance: https://www.macobserver.com/tips/how-to/mac-32-bit-64-bit/ +- At least 8 GB of RAM +- At least 256 GB of storage +- Internet access +- [Chrome browser](https://www.google.com/chrome/) +- [Git installed](https://www.atlassian.com/git/tutorials/install-git) + +Additionally, you must have credentials (api key) access for the **[Value Set Authority Center (VSAC)](https://vsac.nlm.nih.gov/)**. Later on you will add these credentials to your development environment, as they are required for allowing DRLS to pull down updates to value sets that are housed in VSAC. If you don't already have VSAC credentials, you should [create them using UMLS](https://www.nlm.nih.gov/research/umls/index.html). + +## Install core tools + +### Installing core tools on MacOS + +#### Install Docker Desktop for Mac + +1. Download the **stable** version of **[Docker for Mac](https://www.docker.com/products/docker-desktop)** and follow the steps in the installer. +2. Once the installation is complete, you should see a Docker icon on your Mac's menu bar (top of the screen). Click the icon and verify that **Docker Desktop is running.** +3. Configure Docker to have access to enough resources. To do this, open Docker Desktop and select Settings > Resources. + + The defaults for memory at 2GB and possibly CPU as well are too low to run the entire Prior-Auth workflow. If not enough resources are provided, you may notice containers unexpectedly crashing and stopping. Exact requirements for these resource values will depend on your machine. That said, as a baseline starting point, the system runs relatively smoothly at 15GB memory and 7 CPU Processors on MITRE issued Mac Devices. + +#### Install Ruby + Note: The default ruby that comes with Mac may not install the right package version for docker-sync, it is reccomended to install ruby with a package manager, this guide uses rbenv. + + Reference: https://github.com/rbenv/rbenv + +1. Install rbenv + ```bash + brew install rbenv + ``` + +2. Initialize rbenv and follow instructions (setting system path troubleshooting: https://stackoverflow.com/questions/10940736/rbenv-not-changing-ruby-version) + ```bash + rbenv init + ``` +3. Close Terminal so changes take affect +4. Test rbenv is installed correctly + ```bash + curl -fsSL https://github.com/rbenv/rbenv-installer/raw/main/bin/rbenv-doctor | bash + ``` +5. Install Ruby + ```bash + rbenv install 2.7.2 + ``` +6. Verify that the system is using the correct ruby verions + ```bash + which ruby + /Users/$USER/.rbenv/shims/ruby # Correct + + .... + + which ruby + /usr/bin/ruby # Incorrect, using system default ruby. Path not set correctly, reference step 2 + ``` + + + + +#### Install Docker-sync + +1. Download and Install docker-sync using the following command: + ```bash + gem install docker-sync -v 0.7.0 + ``` +2. Test that the right version is installed + ```bash + docker-sync -v + 0.7.0 # Correct + + ... + + docker-sync -v + 0.1.1 # Incorrect, make sure you have ruby installed and are not using the default system ruby + ``` + + Note: The versioning is important, system default ruby sometimes installs version 0.1.1 if -v tag is not set. The 0.1.1 release will not work for the rest of this guide. + +## Clone DRLS + +1. Create a root directory for the DRLS development work (we will call this `` for the remainder of this setup guide). While this step is not required, having a common root for the DRLS components will make things a lot easier down the line. + ```bash + mkdir + ``` + + `` will be the base directory into which all the other components will be installed. For example, CRD will be cloned to `/crd`. + + Note: If you are using a different project structure from the above description, you will need to change the corresponding repo paths in docker-compose-prior-auth-dev.yml, docker-sync.yml, and docker-compose.yml + +2. Now clone the DRLS component repositories from Github: + ```bash + cd + git clone https://github.com/mcode/CRD.git CRD + git clone https://github.com/mcode/test-ehr.git test-ehr + git clone https://github.com/mcode/crd-request-generator.git crd-request-generator + git clone https://github.com/mcode/dtr.git dtr + git clone https://github.com/mcode/REMS.git REMS + + cd CRD + git clone https://github.com/mcode/CDS-Library.git CDS-Library + ``` + +## Configure DRLS + +### CRD configs + +1. `cd /crd/server/src/main/resources` +2. Edit `application.yml` to include: + ```yaml + spring: + profiles: + active: localDb + + localDb: + path: CDS-Library/CRD-DTR/ + ``` + +### test-ehr configs + +1. `cd /test-ehr/src/main/resources` +2. Edit `fhirServer.docker-dev.properties` to include: + ```bash + client_id = app-token + client_secret= #replaceMeWithYourClientSecret + realm=ClientFhirServer + use_oauth = false + oauth_token = http://host.docker.internal:8180/auth/realms/ClientFhirServer/protocol/openid-connect/token + oauth_authorize = http://localhost:8180/auth/realms/ClientFhirServer/protocol/openid-connect/auth + auth_redirect_host = localhost + ``` + +### crd-request-generator configs + +1. `cd /crd-request-generator/src` +2. Edit `properties.json` to look like this: + ```json + { + "realm": "ClientFhirServer", + "client": "app-login", + "auth": "http://localhost:8180/auth", + "server": "http://localhost:8090", + "ehr_server": "http://localhost:8080/test-ehr/r4", + "ehr_base": "http://localhost:8080/test-ehr/r4", + "cds_service": "http://localhost:8090/r4/cds-services", + "order_sign": "order-sign-crd", + "order_select": "order-select-crd", + "user": "alice", + "password": "alice", + "public_keys": "http://localhost:3001/public_keys" + } + ``` + +### dtr configs + +***None*** + +### REMS configs + +***None*** + + +### Add VSAC credentials to your development environment + +> At this point, you should have credentials to access VSAC. If not, please refer to [Prerequisites](#prerequisites) for how to create these credentials and return here after you have confirmed you can access VSAC. +> To download the full ValueSets, your VSAC account will need to be added to the CMS-DRLS author group on https://vsac.nlm.nih.gov/. You will need to request membership access from an admin. If this is not configured, you will get `org.hl7.davinci.endpoint.vsac.errors.VSACValueSetNotFoundException: ValueSet 2.16.840.1.113762.1.4.1219.62 Not Found` errors. + +> While this step is optional, we **highly recommend** that you do it so that DRLS will have the ability to dynamically load value sets from VSAC. + +You can see a list of your pre-existing environment variables on your Mac by running `env` in your Terminal. To add to `env`: +1. Add VSAC API key to .env file in DRLS-Docker Repository +2. `cd ~/` +3. Open `.bash_profile` and add the following lines at the very bottom: + ```bash + export VSAC_API_KEY=vsac_api_key + ``` +4. Save `.bash_profile` and complete the update to `env`: + ```bash + source .bash_profile + ``` + +> Be aware that if you have chosen to skip this step, you will be required to manually provide your VSAC credentials at http://localhost:8090/data and hit **Reload Data** every time you want DRLS to use new or updated value sets. + +## Run DRLS + +### Start docker-sync application +Note: Initial set up will take several minutes and spin up fans with high resource use, be patient, future boots will be much quicker, quieter, and less resource intensive + +```bash + docker-sync-stack start # This is the equivalent of running docker-sync start followed by docker-compose up +``` + +### Stop docker-sync application and remove all containers/volumes +```bash + docker-sync-stack clean # This is the equivalent of running docker-sync clean followed by docker-compose down + docker volume prune +``` + +### Useful docker-sync-commands +Reference: https://docker-sync.readthedocs.io/en/latest/getting-started/commands.html + +## Verify DRLS is working + +### Register the test-ehr + +1. Go to http://localhost:3005/register. + - Client Id: **app-login** + - Fhir Server (iss): **http://localhost:8080/test-ehr/r4** +2. Click **Submit** + +### The fun part: Generate a test request + +1. Go to http://localhost:3000/ehr-server/reqgen. +2. Click **Patient Select** button in upper left. +3. Find **William Oster** in the list of patients and click the dropdown menu next to his name. +4. Select **E0470** in the dropdown menu. +5. Click anywhere in the row for William Oster. +6. Click **Submit** at the bottom of the page. +7. After several seconds you should receive a response in the form of two **CDS cards**: + - **Respiratory Assist Device** + - **Positive Airway Pressure Device** +8. Select **Order Form** on one of those CDS cards. +9. If you are asked for login credentials, use **alice** for username and **alice** for password. +10. A webpage should open in a new tab, and after a few seconds, a questionnaire should appear. +11. Fill out questionnaire and hit next +12. Submit Prior Authorization Request to http://localhost:9015/fhir + +Congratulations! DRLS is fully installed and ready for you to use! + +## Troubleshooting docker-sync +Reference: https://docker-sync.readthedocs.io/en/latest/troubleshooting/sync-stopping.html diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..e932c2b3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,2 @@ +FROM ubuntu:latest +WORKDIR /rems diff --git a/Dockerfile.dev b/Dockerfile.dev new file mode 100644 index 00000000..e932c2b3 --- /dev/null +++ b/Dockerfile.dev @@ -0,0 +1,2 @@ +FROM ubuntu:latest +WORKDIR /rems diff --git a/Dockerfile.tmpl b/Dockerfile.tmpl new file mode 100644 index 00000000..eed3678e --- /dev/null +++ b/Dockerfile.tmpl @@ -0,0 +1,43 @@ +# Docker file specifying MITRE SSL certificates for a Full Stack CNAB invocation image +FROM ubuntu:latest + +ARG BUNDLE_DIR +ARG DEBIAN_FRONTEND=noninteractive +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && apt-get install -y ca-certificates && apt-get install -y curl + +RUN curl http://pki.mitre.org/MITRE%20BA%20ROOT.crt >> /etc/ssl/certs/ca-certificates.crt && \ + curl http://pki.mitre.org/MITRE%20BA%20NPE%20CA-3.crt >> /etc/ssl/certs/ca-certificates.crt && \ + curl http://pki.mitre.org/MITRE%20BA%20NPE%20CA-4.crt >> /etc/ssl/certs/ca-certificates.crt && \ + update-ca-certificates + +WORKDIR /pki +COPY Zscaler_Root_CA.pem . +RUN cat Zscaler_Root_CA.pem >> /etc/ssl/certs/ca-certificates.crt + + + +# Install Git from Source to get around TLS errors with Zscaler, +# explicitly using openssl instead of gnutls +# RUN cp /etc/apt/sources.list /etc/apt/sources.list~ +RUN sed -i -- 's/# deb-src/deb-src/' /etc/apt/sources.list +RUN apt-get update && \ + apt-get install build-essential fakeroot dpkg-dev -y && \ + apt-get install git-man -y && \ + apt-get -f build-dep git -y && \ + apt-get install libcurl4-openssl-dev -y + +WORKDIR /sourcegit + +RUN apt-get source git && \ + cd git-2.*.*/ && \ + sed -i -- 's/libcurl4-gnutls-dev/libcurl4-openssl-dev/' ./debian/control && \ + sed -i -- '/TEST\s*=\s*test/d' ./debian/rules && \ + dpkg-buildpackage -rfakeroot -b -uc -us && \ + dpkg -i ../git_*ubuntu*.deb + +COPY ./.cnab/app/porter.yaml ${BUNDLE_DIR}/porter.yaml +COPY ./docker-compose.yml ${BUNDLE_DIR} +COPY ./.env ${BUNDLE_DIR} +# COPY ../test-ehr/src/main/resources/ClientFhirServerRealm.json ${BUNDLE_DIR}/resources/ClientFhirServerRealm.json \ No newline at end of file diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml new file mode 100644 index 00000000..66a69300 --- /dev/null +++ b/docker-compose-dev.yml @@ -0,0 +1,102 @@ +version: '3.6' +services: + keycloak: + container_name: keycloak + # command: ["-Djboss.http.port=8180"] + ports: + - '8180:8080' + environment: + - KEYCLOAK_USER=admin + - KEYCLOAK_PASSWORD=admin + - DB_VENDOR=h2 + - KEYCLOAK_IMPORT=/resources/ClientFhirServerRealm.json + volumes: + - keycloak-data:/opt/jboss/keycloak/standalone/data/ + - '../test-ehr/src/main/resources/ClientFhirServerRealm.json:/resources/ClientFhirServerRealm.json' + image: hkong2/keycloak + + # Create crd container + test-ehr: # Name of our service + container_name: test-ehr + ports: # Port binding to host from docker container + - '8080:8080' # Bind port 3000 of host to 3000 of container + environment: + - DOCKER_DEV_PROFILE=true + build: + context: ../test-ehr + dockerfile: Dockerfile.dev + volumes: + - test-ehr-sync:/test-ehr:nocopy # nocopy is important + - /test-ehr/.gradle + - /test-ehr/build + - /test-ehr/target + - /test-ehr/bin + + + # Create crd container + crd: # Name of our service + build: + context: ../CRD + dockerfile: Dockerfile.dev + container_name: crd + ports: # Port binding to host from docker container + - "8090:8090" # Bind port 3000 of host to 3000 of container + environment: + VSAC_API_KEY: ${VSAC_API_KEY} + volumes: + - crd-sync:/CRD:nocopy # nocopy is important + - /CRD/.gradle + + + # Create crd container + crd-request-generator: # Name of our service + build: + context: ../crd-request-generator + dockerfile: Dockerfile.dev + container_name: crd-request-generator + ports: # Port binding to host from docker container + - "3000:3000" # Bind port 3000 of host to 3000 of container + - "3001:3001" + volumes: + - crd-request-generator-sync:/home/node/app:nocopy # nocopy is important + - /home/node/app/node_modules + - /home/node/app/db-data + + + # Create crd container + dtr: # Name of our service + build: + context: ../dtr + dockerfile: Dockerfile.dev + container_name: dtr + ports: # Port binding to host from docker container + - "3005:3005" # Bind port 3000 of host to 3000 of container + volumes: + - dtr-sync:/home/node/app:nocopy # nocopy is important + - /home/node/app/node_modules + - /home/node/app/databaseData + + + # Create crd container + rems: # Name of our service + build: + context: '.' + dockerfile: Dockerfile.dev + container_name: rems + ports: # Port binding to host from docker container + - "9015:9015" # Bind port 3000 of host to 3000 of container + volumes: + - rems-sync:/REMS:nocopy # nocopy is important + +volumes: + keycloak-data: + test-ehr-sync: + external: true + crd-sync: + external: true + crd-request-generator-sync: + external: true + dtr-sync: + external: true + rems-sync: + external: true \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..5a8ed1f1 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,65 @@ +version: '3.6' +services: + keycloak: + container_name: prod-keycloak + # command: ["-Djboss.http.port=8180"] + ports: + - '8180:8080' + environment: + - KEYCLOAK_USER=admin + - KEYCLOAK_PASSWORD=admin + - DB_VENDOR=h2 + # - KEYCLOAK_IMPORT=/resources/ClientFhirServerRealm.json + volumes: + - keycloak-data:/opt/jboss/keycloak/standalone/data/ + # - './resources/ClientFhirServerRealm.json:/resources/ClientFhirServerRealm.json' + image: hkong2/keycloak + + # Create crd container + test-ehr: # Name of our service + container_name: prod-test-ehr + ports: # Port binding to host from docker container + - '8080:8080' # Bind port 3000 of host to 3000 of container + image: logicahealth/ehr-app + environment: + - DOCKER_DEV_PROFILE=true + + + + # Create crd container + crd: # Name of our service + image: logicahealth/davinci-crd + container_name: prod-crd + ports: # Port binding to host from docker container + - "8090:8090" # Bind port 3000 of host to 3000 of container + environment: + VSAC_API_KEY: ${VSAC_API_KEY} + + + # Create crd container + crd-request-generator: # Name of our service + image: logicahealth/davinci-crd-request-generator + container_name: prod-crd-request-generator + ports: # Port binding to host from docker container + - "3000:3000" # Bind port 3000 of host to 3000 of container + - "3001:3001" + + + # Create crd container + dtr: # Name of our service + image: logicahealth/davinci-dtr + container_name: prod-dtr + ports: # Port binding to host from docker container + - "3005:3005" # Bind port 3000 of host to 3000 of container + + # # Create crd container + # rems: # Name of our service + # image: logicahealth/ + # container_name: prod-rems + # ports: # Port binding to host from docker container + # - "9015:9015" # Bind port 3000 of host to 3000 of container + + + +volumes: + keycloak-data: diff --git a/docker-sync.yml b/docker-sync.yml new file mode 100644 index 00000000..ebfa68f1 --- /dev/null +++ b/docker-sync.yml @@ -0,0 +1,22 @@ +version: "2" +options: + compose-file-path: './docker-compose-dev.yml' +syncs: + test-ehr-sync: + src: ../test-ehr + sync_excludes: ['.gradle', 'build', 'target', 'bin'] + + crd-sync: + src: '../CRD' + sync_excludes: ['.gradle', 'server/.gradle', 'server/bin', 'server/build'] + + crd-request-generator-sync: + src: '../crd-request-generator' + sync_excludes: ['node_modules', 'build'] + + dtr-sync: + src: '../dtr' + sync_excludes: ['node_modules', 'databaseData'] + + rems-sync: + src: '.' \ No newline at end of file diff --git a/porter.yaml b/porter.yaml new file mode 100644 index 00000000..6c73feca --- /dev/null +++ b/porter.yaml @@ -0,0 +1,44 @@ +name: drls_pas_workflow +version: 0.0.2 +description: Prior Authorization Workflow +registry: smalhotra01234 + +dockerfile: Dockerfile.tmpl + +required: + - docker + +mixins: + - docker + - docker-compose + +credentials: + - name: DOCKER_USERNAME + env: DOCKER_USERNAME + - name: DOCKER_PASSWORD + env: DOCKER_PASSWORD + +build: + - docker: + description: "Docker build" + outputs: + - name: invocationImage + +install: + - docker-compose: + description: Docker Compose up + arguments: + - up + +ps: + - docker-compose: + description: Docker Compose ps + arguments: + - ps + +uninstall: + - docker-compose: + description: Docker Compose down + arguments: + - down + - --remove-orphans \ No newline at end of file From 3172b4be90448c67690da5341b66604aef344fb9 Mon Sep 17 00:00:00 2001 From: Sahil Malhotra Date: Tue, 16 Nov 2021 11:12:40 -0500 Subject: [PATCH 02/20] production dockerizes set up --- .env | 4 +- ...MacOS.md => DockerDevSetupGuideForMacOS.md | 57 +++++- DockerProdSetupGuideForMacOS.md | 176 ++++++++++++++++++ Dockerfile | 4 +- Dockerfile.dev | 4 +- docker-compose-dev.yml | 44 ++--- docker-compose.yml | 39 ++-- docker-sync.yml | 14 +- dockerRunner.sh | 22 +++ 9 files changed, 302 insertions(+), 62 deletions(-) rename DockerSetupGuideForMacOS.md => DockerDevSetupGuideForMacOS.md (82%) create mode 100644 DockerProdSetupGuideForMacOS.md create mode 100755 dockerRunner.sh diff --git a/.env b/.env index f656f1bd..0b949a6d 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ -VSAC_API_KEY=f6486e93-5f75-481c-a5c1-b6395d7a217d -# COMPOSE_PROJECT_NAME=Prod-DRLS \ No newline at end of file +VSAC_API_KEY= #Replace me with api key +COMPOSE_PROJECT_NAME=REMS_DEV \ No newline at end of file diff --git a/DockerSetupGuideForMacOS.md b/DockerDevSetupGuideForMacOS.md similarity index 82% rename from DockerSetupGuideForMacOS.md rename to DockerDevSetupGuideForMacOS.md index 679c7764..2d52b7fc 100644 --- a/DockerSetupGuideForMacOS.md +++ b/DockerDevSetupGuideForMacOS.md @@ -4,17 +4,40 @@ Repository to host root docker bundle config files for local development and pub ## Purpose of this guide -This document details the installation process for the dockerized version of the **Documentation Requirements Lookup Service (DRLS)** system for Local Development, complete with file synchronization and server reloading. To achieve this functionality, this guide takes advantage of the docker-sync tool. Be aware that each component of DRLS has its own README where you will find more detailed documentation. This document **is not designed to replace those individual READMEs**. +This document details the installation process for the dockerized version of the **Documentation Requirements Lookup Service (DRLS) REMS Workflow** system for Local Development, complete with file synchronization and server reloading. To achieve this functionality, this guide takes advantage of the docker-sync tool. Be aware that each component of DRLS has its own README where you will find more detailed documentation. This document **is not designed to replace those individual READMEs**. This document **is designed to take you through the entire set up process for DRLS using docker containers**. It is a standalone guide that does not depend on any supplementary DRLS documentation. This guide will take you through the development environment setup for each of the following DRLS components: -1. [Coverage Requirements Discovery (CRD)](https://github.com/HL7-DaVinci/CRD) +1. [Coverage Requirements Discovery (CRD)](https://github.com/mcode/CRD) 2. [(Test) EHR FHIR Service](https://github.com/HL7-DaVinci/test-ehr) -3. [Documents, Templates, and Rules (DTR) SMART on FHIR app](https://github.com/HL7-DaVinci/dtr) -4. [Clinical Decision Support (CDS) Library](https://github.com/HL7-DaVinci/CDS-Library) -5. [CRD Request Generator](https://github.com/HL7-DaVinci/crd-request-generator) -6. Keycloak +3. [Documents, Templates, and Rules (DTR) SMART on FHIR app](https://github.com/mcode/dtr) +4. [Clinical Decision Support (CDS) Library](https://github.com/mcode/CDS-Library) +5. [CRD Request Generator](https://github.com/mcode/crd-request-generator) +6. [REMS](https://github.com/mcode/REMS.git) +7. Keycloak + +## Table of Contents +- [Prerequisites](#prerequisites) +- [Install core tools](#install-core-tools) + * [Installing core tools on MacOS](#installing-core-tools-on-macos) + + [Install Docker Desktop for Mac](#install-docker-desktop-for-mac) + + [Install Ruby](#install-ruby) + + [Install Docker-sync](#install-docker-sync) +- [Clone DRLS REMS](#clone-drls) +- [Configure DRLS REMS](#configure-drls) + * [CRD configs](#crd-configs) + * [test-ehr configs](#test-ehr-configs) + * [crd-request-generator configs](#crd-request-generator-configs) + * [dtr configs](#dtr-configs) + * [rems configs](#rems-configs) + + * [Add VSAC credentials to your development environment](#add-vsac-credentials-to-your-development-environment) +- [Run DRLS REMS](#run-drls) + * [Start Docker Sync](#start-docker-sync-application) + * [Stop Docker Sync](#stop-docker-sync-application-and-remove-all-containers/volumes) + * [Useful Docker Sync Commands](#useful-docker-sync-commands) +- [Verify DRLS is working](#verify-drls-is-working) ## Prerequisites @@ -122,7 +145,7 @@ Additionally, you must have credentials (api key) access for the **[Value Set Au git clone https://github.com/mcode/dtr.git dtr git clone https://github.com/mcode/REMS.git REMS - cd CRD + cd CRD/server git clone https://github.com/mcode/CDS-Library.git CDS-Library ``` @@ -193,7 +216,7 @@ Additionally, you must have credentials (api key) access for the **[Value Set Au > While this step is optional, we **highly recommend** that you do it so that DRLS will have the ability to dynamically load value sets from VSAC. You can see a list of your pre-existing environment variables on your Mac by running `env` in your Terminal. To add to `env`: -1. Add VSAC API key to .env file in DRLS-Docker Repository +1. Set "VSAC_API_KEY" in the .env file in the REMS Repository (if following option 1) 2. `cd ~/` 3. Open `.bash_profile` and add the following lines at the very bottom: ```bash @@ -206,6 +229,22 @@ You can see a list of your pre-existing environment variables on your Mac by run > Be aware that if you have chosen to skip this step, you will be required to manually provide your VSAC credentials at http://localhost:8090/data and hit **Reload Data** every time you want DRLS to use new or updated value sets. +### Add Compose Project Name + +You can see a list of your pre-existing environment variables on your Mac by running `env` in your Terminal. To add to `env`: +1. Set "COMPOSE_PROJECT_NAME" as "rems_dev" in the .env file in the REMS Repository +2. `cd ~/` +3. Open `.bash_profile` and add the following lines at the very bottom: + ```bash + export COMPOSE_PROJECT_NAME=rems_dev + ``` +4. Save `.bash_profile` and complete the update to `env`: + ```bash + source .bash_profile + ``` + + + ## Run DRLS ### Start docker-sync application @@ -221,7 +260,7 @@ Note: Initial set up will take several minutes and spin up fans with high resour docker volume prune ``` -### Useful docker-sync-commands +### Useful docker-sync commands Reference: https://docker-sync.readthedocs.io/en/latest/getting-started/commands.html ## Verify DRLS is working diff --git a/DockerProdSetupGuideForMacOS.md b/DockerProdSetupGuideForMacOS.md new file mode 100644 index 00000000..9d66dc3b --- /dev/null +++ b/DockerProdSetupGuideForMacOS.md @@ -0,0 +1,176 @@ +# DRLS-Docker-The Ultimate Guide to Running DRLS (Prior Auth workflow) for Local Development +Repository to host root docker bundle config files for local development and publishing + + +## Purpose of this guide + +This document details the installation process for the dockerized version of the **Documentation Requirements Lookup Service (DRLS) REMS Workflow** system for Production. There are two approaches to doing this: Option 1 utilizes Docker Compose, which comes with Docker Dektop, and requires the corresponding docker-compose.yml file from the REMS repository. Option 2 utilizes Porter, which requires a seperate installation in addition to Docker Desktop but does not require the use of any local files. + +This document **is designed to take you through the entire set up process for DRLS using docker containers**. It is a standalone guide that does not depend on any supplementary DRLS documentation. + +This guide will take you through the development environment setup for each of the following DRLS components: +1. [Coverage Requirements Discovery (CRD)](https://github.com/mcode/CRD) +2. [(Test) EHR FHIR Service](https://github.com/HL7-DaVinci/test-ehr) +3. [Documents, Templates, and Rules (DTR) SMART on FHIR app](https://github.com/mcode/dtr) +4. [Clinical Decision Support (CDS) Library](https://github.com/mcode/CDS-Library) +5. [CRD Request Generator](https://github.com/mcode/crd-request-generator) +6. [REMS](https://github.com/mcode/REMS.git) +7. Keycloak + + + + +## Prerequisites + +Your computer must have these minimum requirements: +- Running MacOS + + > The docker synchronization strategy used by docker-sync in this guide is designed for MacOs use. The same configuration will likely not work on Windows as the synchronization strategy used by docker-sync on windows can not handle more than 30 sync files at a time. Reference documentaion: https://docker-sync.readthedocs.io/en/latest/advanced/sync-strategies.html# + +- x86_64 (64-bit) or equivalent processor + * Follow these instructions to verify your machine's compliance: https://www.macobserver.com/tips/how-to/mac-32-bit-64-bit/ +- At least 8 GB of RAM +- At least 256 GB of storage +- Internet access +- [Chrome browser](https://www.google.com/chrome/) +- [Git installed](https://www.atlassian.com/git/tutorials/install-git) + +Additionally, you must have credentials (api key) access for the **[Value Set Authority Center (VSAC)](https://vsac.nlm.nih.gov/)**. Later on you will add these credentials to your development environment, as they are required for allowing DRLS to pull down updates to value sets that are housed in VSAC. If you don't already have VSAC credentials, you should [create them using UMLS](https://www.nlm.nih.gov/research/umls/index.html). + +## Install core tools + +### Installing core tools on MacOS + +#### Install Docker Desktop for Mac + +1. Download the **stable** version of **[Docker for Mac](https://www.docker.com/products/docker-desktop)** and follow the steps in the installer. +2. Once the installation is complete, you should see a Docker icon on your Mac's menu bar (top of the screen). Click the icon and verify that **Docker Desktop is running.** +3. Configure Docker to have access to enough resources. To do this, open Docker Desktop and select Settings > Resources. + + The defaults for memory at 2GB and possibly CPU as well are too low to run the entire Prior-Auth workflow. If not enough resources are provided, you may notice containers unexpectedly crashing and stopping. Exact requirements for these resource values will depend on your machine. That said, as a baseline starting point, the system runs relatively smoothly at 15GB memory and 7 CPU Processors on MITRE issued Mac Devices. + +#### Install Porter + +-- To DO + +## Clone REMS repository (Option 1 Only) + + +1. clone the REMS repositories from Github: + ```bash + git clone https://github.com/mcode/REMS.git REMS + git clone https://github.com/mcode/test-ehr.git test-ehr + + ``` + + Alternatively, you can download just the docker-compose.yml file from the REMS reposiotry and src/main/resources/ClientFhirServerRealm.json since those are all that are needed for option 1. + +### Add VSAC credentials to your development environment + +> At this point, you should have credentials to access VSAC. If not, please refer to [Prerequisites](#prerequisites) for how to create these credentials and return here after you have confirmed you can access VSAC. +> To download the full ValueSets, your VSAC account will need to be added to the CMS-DRLS author group on https://vsac.nlm.nih.gov/. You will need to request membership access from an admin. If this is not configured, you will get `org.hl7.davinci.endpoint.vsac.errors.VSACValueSetNotFoundException: ValueSet 2.16.840.1.113762.1.4.1219.62 Not Found` errors. + +> While this step is optional, we **highly recommend** that you do it so that DRLS will have the ability to dynamically load value sets from VSAC. + +You can see a list of your pre-existing environment variables on your Mac by running `env` in your Terminal. To add to `env`: +1. Set "VSAC_API_KEY" in the .env file in the REMS Repository (if following option 1) +2. `cd ~/` +3. Open `.bash_profile` and add the following lines at the very bottom: + ```bash + export VSAC_API_KEY=vsac_api_key + ``` +4. Save `.bash_profile` and complete the update to `env`: + ```bash + source .bash_profile + ``` + +> Be aware that if you have chosen to skip this step, you will be required to manually provide your VSAC credentials at http://localhost:8090/data and hit **Reload Data** every time you want DRLS to use new or updated value sets. + +### Add Compose Project Name + +You can see a list of your pre-existing environment variables on your Mac by running `env` in your Terminal. To add to `env`: +1. Set "COMPOSE_PROJECT_NAME" as "REMS_PROD" in the .env file in the REMS Repository (if follwing option 1) +2. `cd ~/` +3. Open `.bash_profile` and add the following lines at the very bottom: + ```bash + export COMPOSE_PROJECT_NAME=REMS_PROD + ``` +4. Save `.bash_profile` and complete the update to `env`: + ```bash + source .bash_profile + ``` + + +## Run DRLS +### Option 1 - Docker Compose +#### Start docker compose application + +```bash + cd REMS # Need to execute commands in directory with corresponding docker-compose.yml file located in the REMS repository + docker-compose up +``` + +#### Stop docker-compose application and remove all containers/volumes +```bash + docker-compose down + docker volume prune +``` + +### Option 2 - Porter Install +#### Install and Run Porter application + +```bash + porter install # Note, the project will keep running in the background when you "ctrl + c" out of process. To stop running all together, use the uninstall command below +``` + +#### Stop Running Porter +```bash + porter uninstall +``` + + +## Verify DRLS is working + +### Register the test-ehr + +1. Go to http://localhost:3005/register. + - Client Id: **app-login** + - Fhir Server (iss): **http://localhost:8080/test-ehr/r4** +2. Click **Submit** + +### Upload ClientFhirServerRealm.json to keycloak + +ToDo + +### The fun part: Generate a test request + +1. Go to http://localhost:3000/ehr-server/reqgen. +2. Click **Patient Select** button in upper left. +3. Find **William Oster** in the list of patients and click the dropdown menu next to his name. +4. Select **E0470** in the dropdown menu. +5. Click anywhere in the row for William Oster. +6. Click **Submit** at the bottom of the page. +7. After several seconds you should receive a response in the form of two **CDS cards**: + - **Respiratory Assist Device** + - **Positive Airway Pressure Device** +8. Select **Order Form** on one of those CDS cards. +9. If you are asked for login credentials, use **alice** for username and **alice** for password. +10. A webpage should open in a new tab, and after a few seconds, a questionnaire should appear. +11. Fill out questionnaire and hit next +12. Submit Prior Authorization Request to http://localhost:9015/fhir + +Congratulations! DRLS is fully installed and ready for you to use! + +## Troubleshooting docker-sync +Reference: https://docker-sync.readthedocs.io/en/latest/troubleshooting/sync-stopping.html diff --git a/Dockerfile b/Dockerfile index e932c2b3..eb43c9ce 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,2 +1,4 @@ FROM ubuntu:latest -WORKDIR /rems +WORKDIR /REMS +COPY . . +CMD ./dockerRunner.sh \ No newline at end of file diff --git a/Dockerfile.dev b/Dockerfile.dev index e932c2b3..eb43c9ce 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -1,2 +1,4 @@ FROM ubuntu:latest -WORKDIR /rems +WORKDIR /REMS +COPY . . +CMD ./dockerRunner.sh \ No newline at end of file diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml index 66a69300..da1c2c22 100644 --- a/docker-compose-dev.yml +++ b/docker-compose-dev.yml @@ -1,7 +1,7 @@ version: '3.6' services: keycloak: - container_name: keycloak + container_name: REMS_DEV_keycloak # command: ["-Djboss.http.port=8180"] ports: - '8180:8080' @@ -15,9 +15,9 @@ services: - '../test-ehr/src/main/resources/ClientFhirServerRealm.json:/resources/ClientFhirServerRealm.json' image: hkong2/keycloak - # Create crd container + # Create test ehr container test-ehr: # Name of our service - container_name: test-ehr + container_name: REMS_DEV_test-ehr ports: # Port binding to host from docker container - '8080:8080' # Bind port 3000 of host to 3000 of container environment: @@ -26,7 +26,7 @@ services: context: ../test-ehr dockerfile: Dockerfile.dev volumes: - - test-ehr-sync:/test-ehr:nocopy # nocopy is important + - REMS_DEV_test-ehr-sync:/test-ehr:nocopy # nocopy is important - /test-ehr/.gradle - /test-ehr/build - /test-ehr/target @@ -38,65 +38,65 @@ services: build: context: ../CRD dockerfile: Dockerfile.dev - container_name: crd + container_name: REMS_DEV_crd ports: # Port binding to host from docker container - "8090:8090" # Bind port 3000 of host to 3000 of container environment: VSAC_API_KEY: ${VSAC_API_KEY} volumes: - - crd-sync:/CRD:nocopy # nocopy is important + - REMS_DEV_crd-sync:/CRD:nocopy # nocopy is important - /CRD/.gradle - # Create crd container + # Create crd request generator container crd-request-generator: # Name of our service build: context: ../crd-request-generator dockerfile: Dockerfile.dev - container_name: crd-request-generator + container_name: REMS_DEV_crd-request-generator ports: # Port binding to host from docker container - "3000:3000" # Bind port 3000 of host to 3000 of container - "3001:3001" volumes: - - crd-request-generator-sync:/home/node/app:nocopy # nocopy is important + - REMS_DEV_crd-request-generator-sync:/home/node/app:nocopy # nocopy is important - /home/node/app/node_modules - - /home/node/app/db-data + - /home/node/app/databaseData - # Create crd container + # Create dtr container dtr: # Name of our service build: context: ../dtr dockerfile: Dockerfile.dev - container_name: dtr + container_name: REMS_DEV_dtr ports: # Port binding to host from docker container - "3005:3005" # Bind port 3000 of host to 3000 of container volumes: - - dtr-sync:/home/node/app:nocopy # nocopy is important + - REMS_DEV_dtr-sync:/home/node/app:nocopy # nocopy is important - /home/node/app/node_modules - - /home/node/app/databaseData + # - /home/node/app/databaseData - # Create crd container + # Create rems container rems: # Name of our service build: context: '.' dockerfile: Dockerfile.dev - container_name: rems + container_name: REMS_DEV_rems ports: # Port binding to host from docker container - "9015:9015" # Bind port 3000 of host to 3000 of container volumes: - - rems-sync:/REMS:nocopy # nocopy is important + - REMS_DEV_rems-sync:/REMS:nocopy # nocopy is important volumes: keycloak-data: - test-ehr-sync: + REMS_DEV_test-ehr-sync: external: true - crd-sync: + REMS_DEV_crd-sync: external: true - crd-request-generator-sync: + REMS_DEV_crd-request-generator-sync: external: true - dtr-sync: + REMS_DEV_dtr-sync: external: true - rems-sync: + REMS_DEV_rems-sync: external: true \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 5a8ed1f1..3c2afb43 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '3.6' services: keycloak: - container_name: prod-keycloak + container_name: REMS_PROD_keycloak # command: ["-Djboss.http.port=8180"] ports: - '8180:8080' @@ -15,49 +15,48 @@ services: # - './resources/ClientFhirServerRealm.json:/resources/ClientFhirServerRealm.json' image: hkong2/keycloak - # Create crd container + # Create test-ehr container test-ehr: # Name of our service - container_name: prod-test-ehr + container_name: REMS_PROD_test-ehr ports: # Port binding to host from docker container - '8080:8080' # Bind port 3000 of host to 3000 of container - image: logicahealth/ehr-app + image: smalhotra01234/rems_prod_test-ehr environment: - DOCKER_DEV_PROFILE=true - - + # Create crd container crd: # Name of our service - image: logicahealth/davinci-crd - container_name: prod-crd + image: smalhotra01234/rems_prod_crd + container_name: REMS_PROD_crd ports: # Port binding to host from docker container - "8090:8090" # Bind port 3000 of host to 3000 of container environment: VSAC_API_KEY: ${VSAC_API_KEY} - # Create crd container + # Create crd request generator container crd-request-generator: # Name of our service - image: logicahealth/davinci-crd-request-generator - container_name: prod-crd-request-generator + image: smalhotra01234/rems_prod_crd-request-generator + container_name: REMS_PROD_crd-request-generator ports: # Port binding to host from docker container - "3000:3000" # Bind port 3000 of host to 3000 of container - "3001:3001" - # Create crd container + # Create dtr container dtr: # Name of our service - image: logicahealth/davinci-dtr - container_name: prod-dtr + image: smalhotra01234/rems_prod_dtr + container_name: REMS_PROD_dtr ports: # Port binding to host from docker container - "3005:3005" # Bind port 3000 of host to 3000 of container - # # Create crd container - # rems: # Name of our service - # image: logicahealth/ - # container_name: prod-rems - # ports: # Port binding to host from docker container - # - "9015:9015" # Bind port 3000 of host to 3000 of container + # # Create rems container + rems: # Name of our service + image: smalhotra01234/rems_prod_rems + container_name: REMS_PROD_rems + ports: # Port binding to host from docker container + - "9015:9015" # Bind port 3000 of host to 3000 of container diff --git a/docker-sync.yml b/docker-sync.yml index ebfa68f1..fd2d1da7 100644 --- a/docker-sync.yml +++ b/docker-sync.yml @@ -2,21 +2,21 @@ version: "2" options: compose-file-path: './docker-compose-dev.yml' syncs: - test-ehr-sync: + REMS_DEV_test-ehr-sync: src: ../test-ehr sync_excludes: ['.gradle', 'build', 'target', 'bin'] - crd-sync: + REMS_DEV_crd-sync: src: '../CRD' sync_excludes: ['.gradle', 'server/.gradle', 'server/bin', 'server/build'] - crd-request-generator-sync: + REMS_DEV_crd-request-generator-sync: src: '../crd-request-generator' - sync_excludes: ['node_modules', 'build'] + sync_excludes: ['node_modules', 'build', 'databaseData'] - dtr-sync: + REMS_DEV_dtr-sync: src: '../dtr' - sync_excludes: ['node_modules', 'databaseData'] + sync_excludes: ['node_modules'] - rems-sync: + REMS_DEV_rems-sync: src: '.' \ No newline at end of file diff --git a/dockerRunner.sh b/dockerRunner.sh new file mode 100755 index 00000000..ab38bc8d --- /dev/null +++ b/dockerRunner.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# Handle closing application on signal interrupt (ctrl + c) +# trap "kill $LOAD_DATA_PID $CONTINUOUS_BUILD_PID $SERVER_PID; gradle --stop; exit" INT + +# Set environment variables +export DOCKER_DEV_PROFILE="true" + +echo "REMS Server is Booting Up..." +echo "REMS Server Is Running..." + +while true +do + echo "REMS Server will say this string every 5 minutes..." + sleep 5m +done + +# Handle application background process exiting +# wait $CONTINUOUS_BUILD_PID $SERVER_PID $LOAD_DATA_PID +# EXIT_CODE=$? +# echo "application exited with exit code $EXIT_CODE..." + From 5cd1f79035f84b59a3ac9db5789bc2eea8c9d2c2 Mon Sep 17 00:00:00 2001 From: Sahil Malhotra Date: Tue, 16 Nov 2021 17:10:58 -0500 Subject: [PATCH 03/20] production docker --- .dockerignore | 2 - .env | 4 +- .gitignore | 3 +- DockerDevSetupGuideForMacOS.md | 8 +-- DockerProdSetupGuideForMacOS.md | 100 +++++++++++++++++++++----------- Dockerfile.tmpl | 2 +- README.md | 1 + docker-compose-dev.yml | 34 +++++------ docker-compose-porter.yml | 64 ++++++++++++++++++++ docker-compose.yml | 24 ++++---- docker-sync.yml | 12 ++-- porter.yaml | 22 ++++--- 12 files changed, 188 insertions(+), 88 deletions(-) create mode 100644 docker-compose-porter.yml diff --git a/.dockerignore b/.dockerignore index d1e5aa48..7b85d678 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,6 +2,4 @@ # Put files here that you don't want copied into your bundle's invocation image .gitignore Dockerfile.tmpl - -.cnab/ .docker-sync/ \ No newline at end of file diff --git a/.env b/.env index 0b949a6d..1c66d9c3 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ -VSAC_API_KEY= #Replace me with api key -COMPOSE_PROJECT_NAME=REMS_DEV \ No newline at end of file +VSAC_API_KEY=#Replace_me_with_your_api_key +COMPOSE_PROJECT_NAME=rems_dev \ No newline at end of file diff --git a/.gitignore b/.gitignore index 9963e1c4..86f4bdf7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .cnab/ -.docker-sync/ \ No newline at end of file +.docker-sync/ +Zscaler_Root_CA.pem \ No newline at end of file diff --git a/DockerDevSetupGuideForMacOS.md b/DockerDevSetupGuideForMacOS.md index 2d52b7fc..250a5e8a 100644 --- a/DockerDevSetupGuideForMacOS.md +++ b/DockerDevSetupGuideForMacOS.md @@ -24,8 +24,8 @@ This guide will take you through the development environment setup for each of t + [Install Docker Desktop for Mac](#install-docker-desktop-for-mac) + [Install Ruby](#install-ruby) + [Install Docker-sync](#install-docker-sync) -- [Clone DRLS REMS](#clone-drls) -- [Configure DRLS REMS](#configure-drls) +- [Clone DRLS REMS](#clone-drls-rems) +- [Configure DRLS REMS](#configure-drls-rems) * [CRD configs](#crd-configs) * [test-ehr configs](#test-ehr-configs) * [crd-request-generator configs](#crd-request-generator-configs) @@ -125,7 +125,7 @@ Additionally, you must have credentials (api key) access for the **[Value Set Au Note: The versioning is important, system default ruby sometimes installs version 0.1.1 if -v tag is not set. The 0.1.1 release will not work for the rest of this guide. -## Clone DRLS +## Clone DRLS REMS 1. Create a root directory for the DRLS development work (we will call this `` for the remainder of this setup guide). While this step is not required, having a common root for the DRLS components will make things a lot easier down the line. ```bash @@ -149,7 +149,7 @@ Additionally, you must have credentials (api key) access for the **[Value Set Au git clone https://github.com/mcode/CDS-Library.git CDS-Library ``` -## Configure DRLS +## Configure DRLS REMS ### CRD configs diff --git a/DockerProdSetupGuideForMacOS.md b/DockerProdSetupGuideForMacOS.md index 9d66dc3b..bf136571 100644 --- a/DockerProdSetupGuideForMacOS.md +++ b/DockerProdSetupGuideForMacOS.md @@ -4,7 +4,11 @@ Repository to host root docker bundle config files for local development and pub ## Purpose of this guide -This document details the installation process for the dockerized version of the **Documentation Requirements Lookup Service (DRLS) REMS Workflow** system for Production. There are two approaches to doing this: Option 1 utilizes Docker Compose, which comes with Docker Dektop, and requires the corresponding docker-compose.yml file from the REMS repository. Option 2 utilizes Porter, which requires a seperate installation in addition to Docker Desktop but does not require the use of any local files. +This document details the installation process for the dockerized version of the **Documentation Requirements Lookup Service (DRLS) REMS Workflow** system for Production. There are two approaches to doing this: + +Option 1 utilizes Docker Compose, which comes with Docker Dektop, and requires the corresponding docker-compose.yml file from the REMS repository. + +Option 2 utilizes Porter, which requires a seperate installation in addition to Docker Desktop but does not require the use of any local files. This document **is designed to take you through the entire set up process for DRLS using docker containers**. It is a standalone guide that does not depend on any supplementary DRLS documentation. @@ -17,18 +21,20 @@ This guide will take you through the development environment setup for each of t 6. [REMS](https://github.com/mcode/REMS.git) 7. Keycloak - + + [Install Porter (Option 2 only)](#install-porter-(option-2-only)) +- [Clone REMS repository(Option 1 Only)](#clone-rems-repository-(option-1-only)) +- [Configure DRLS REMS](#configure-drls-rems) + * [Add VSAC credentials to environment (Option 1 only)](#add-vsac-credentials-to-environment-(option-1-only)) + * [Add Compose Project Name to environment (Option 1 only)](#add-compose-project-name-to-environment-(option-1-only)) +- [Run DRLS REMS](#run-drls-rems) + * [Option 1 - Docker Compose](#option-1---docker-compose) + * [Option 2 - Porter Install](#option-2---porter-install) +- [Verify DRLS is working](#verify-drls-is-working) ## Prerequisites @@ -60,23 +66,38 @@ Additionally, you must have credentials (api key) access for the **[Value Set Au The defaults for memory at 2GB and possibly CPU as well are too low to run the entire Prior-Auth workflow. If not enough resources are provided, you may notice containers unexpectedly crashing and stopping. Exact requirements for these resource values will depend on your machine. That said, as a baseline starting point, the system runs relatively smoothly at 15GB memory and 7 CPU Processors on MITRE issued Mac Devices. -#### Install Porter +#### Install Porter (Option 2 Only) --- To DO +1. Download and install porter with the following commands: + ```bash + curl -L https://cdn.porter.sh/latest/install-mac.sh | bash + ``` +2. Open `.bash_profile` and add the following lines at the very bottom: + ```bash + export PATH=$PATH:~/.porter + ``` +4. Save `.bash_profile` and complete the update to `env`: + ```bash + source .bash_profile + ``` +5. Install required Porter plugins + ```bash + porter mixins install docker + porter mixins install docker-compose + ``` ## Clone REMS repository (Option 1 Only) - 1. clone the REMS repositories from Github: ```bash - git clone https://github.com/mcode/REMS.git REMS - git clone https://github.com/mcode/test-ehr.git test-ehr - + git clone https://github.com/mcode/REMS.git REMS ``` - Alternatively, you can download just the docker-compose.yml file from the REMS reposiotry and src/main/resources/ClientFhirServerRealm.json since those are all that are needed for option 1. + Alternatively, you can download/copy just the docker-compose.yml file from the REMS reposiotry since that is the only file needed for this set up. + +## Configure DRLS REMS -### Add VSAC credentials to your development environment +### Add VSAC credentials to environment (Option 1 only) > At this point, you should have credentials to access VSAC. If not, please refer to [Prerequisites](#prerequisites) for how to create these credentials and return here after you have confirmed you can access VSAC. > To download the full ValueSets, your VSAC account will need to be added to the CMS-DRLS author group on https://vsac.nlm.nih.gov/. You will need to request membership access from an admin. If this is not configured, you will get `org.hl7.davinci.endpoint.vsac.errors.VSACValueSetNotFoundException: ValueSet 2.16.840.1.113762.1.4.1219.62 Not Found` errors. @@ -84,35 +105,43 @@ Additionally, you must have credentials (api key) access for the **[Value Set Au > While this step is optional, we **highly recommend** that you do it so that DRLS will have the ability to dynamically load value sets from VSAC. You can see a list of your pre-existing environment variables on your Mac by running `env` in your Terminal. To add to `env`: -1. Set "VSAC_API_KEY" in the .env file in the REMS Repository (if following option 1) -2. `cd ~/` -3. Open `.bash_profile` and add the following lines at the very bottom: +1. Set "VSAC_API_KEY" in the .env file in the REMS Repository + +or + +1. `cd ~/` +2. Open `.bash_profile` and add the following lines at the very bottom: ```bash export VSAC_API_KEY=vsac_api_key ``` -4. Save `.bash_profile` and complete the update to `env`: +3. Save `.bash_profile` and complete the update to `env`: ```bash source .bash_profile ``` > Be aware that if you have chosen to skip this step, you will be required to manually provide your VSAC credentials at http://localhost:8090/data and hit **Reload Data** every time you want DRLS to use new or updated value sets. -### Add Compose Project Name +### Add Compose Project Name to environment (Option 1 only) + +Note: The compose project name is to disambiguate between different set ups on the same machine and can be set to any identifier. If you are following both options mentioned in this guide, it is reccomended to change the compose project name for each so that they differ. You can see a list of your pre-existing environment variables on your Mac by running `env` in your Terminal. To add to `env`: -1. Set "COMPOSE_PROJECT_NAME" as "REMS_PROD" in the .env file in the REMS Repository (if follwing option 1) -2. `cd ~/` -3. Open `.bash_profile` and add the following lines at the very bottom: +1. Set "COMPOSE_PROJECT_NAME" as "rems_prod" in the .env file in the REMS Repository + +or + +1. `cd ~/` +2. Open `.bash_profile` and add the following lines at the very bottom: ```bash - export COMPOSE_PROJECT_NAME=REMS_PROD + export COMPOSE_PROJECT_NAME=rems_prod ``` -4. Save `.bash_profile` and complete the update to `env`: +3. Save `.bash_profile` and complete the update to `env`: ```bash source .bash_profile ``` -## Run DRLS +## Run DRLS REMS ### Option 1 - Docker Compose #### Start docker compose application @@ -121,22 +150,25 @@ You can see a list of your pre-existing environment variables on your Mac by run docker-compose up ``` -#### Stop docker-compose application and remove all containers/volumes +#### Stop docker-compose application ```bash - docker-compose down - docker volume prune + docker-compose down # Stops applications + + docker volume prune # Optiional - Removes persisted data ``` ### Option 2 - Porter Install #### Install and Run Porter application ```bash - porter install # Note, the project will keep running in the background when you "ctrl + c" out of process. To stop running all together, use the uninstall command below + porter install --allow-docker-host-access --reference codexrems/fullstack_drls_rems:v0.0.1 # Note, the project will keep running in the background when you "ctrl + c" out of process. To stop running all together, use the uninstall command below ``` #### Stop Running Porter ```bash - porter uninstall + porter uninstall --allow-docker-host-access --reference codexrems/fullstack_drls_rems:v0.0.1 # Stops application servers + + docker volume prune # Optional - Removes persisted data ``` @@ -168,7 +200,7 @@ ToDo 9. If you are asked for login credentials, use **alice** for username and **alice** for password. 10. A webpage should open in a new tab, and after a few seconds, a questionnaire should appear. 11. Fill out questionnaire and hit next -12. Submit Prior Authorization Request to http://localhost:9015/fhir +12. Submit REMS Request to http://localhost:9015/fhir Congratulations! DRLS is fully installed and ready for you to use! diff --git a/Dockerfile.tmpl b/Dockerfile.tmpl index eed3678e..465f1b3a 100644 --- a/Dockerfile.tmpl +++ b/Dockerfile.tmpl @@ -38,6 +38,6 @@ RUN apt-get source git && \ dpkg -i ../git_*ubuntu*.deb COPY ./.cnab/app/porter.yaml ${BUNDLE_DIR}/porter.yaml -COPY ./docker-compose.yml ${BUNDLE_DIR} +COPY ./docker-compose-porter.yml ${BUNDLE_DIR} COPY ./.env ${BUNDLE_DIR} # COPY ../test-ehr/src/main/resources/ClientFhirServerRealm.json ${BUNDLE_DIR}/resources/ClientFhirServerRealm.json \ No newline at end of file diff --git a/README.md b/README.md index 968262e2..78a4ab06 100644 --- a/README.md +++ b/README.md @@ -1 +1,2 @@ # REMS + diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml index da1c2c22..f55caeb2 100644 --- a/docker-compose-dev.yml +++ b/docker-compose-dev.yml @@ -1,7 +1,7 @@ version: '3.6' services: keycloak: - container_name: REMS_DEV_keycloak + container_name: rems_dev_keycloak # command: ["-Djboss.http.port=8180"] ports: - '8180:8080' @@ -17,7 +17,7 @@ services: # Create test ehr container test-ehr: # Name of our service - container_name: REMS_DEV_test-ehr + container_name: rems_dev_test-ehr ports: # Port binding to host from docker container - '8080:8080' # Bind port 3000 of host to 3000 of container environment: @@ -26,7 +26,7 @@ services: context: ../test-ehr dockerfile: Dockerfile.dev volumes: - - REMS_DEV_test-ehr-sync:/test-ehr:nocopy # nocopy is important + - rems_dev_test-ehr-sync:/test-ehr:nocopy # nocopy is important - /test-ehr/.gradle - /test-ehr/build - /test-ehr/target @@ -38,13 +38,13 @@ services: build: context: ../CRD dockerfile: Dockerfile.dev - container_name: REMS_DEV_crd + container_name: rems_dev_crd ports: # Port binding to host from docker container - "8090:8090" # Bind port 3000 of host to 3000 of container environment: VSAC_API_KEY: ${VSAC_API_KEY} volumes: - - REMS_DEV_crd-sync:/CRD:nocopy # nocopy is important + - rems_dev_crd-sync:/CRD:nocopy # nocopy is important - /CRD/.gradle @@ -53,12 +53,12 @@ services: build: context: ../crd-request-generator dockerfile: Dockerfile.dev - container_name: REMS_DEV_crd-request-generator + container_name: rems_dev_crd-request-generator ports: # Port binding to host from docker container - "3000:3000" # Bind port 3000 of host to 3000 of container - "3001:3001" volumes: - - REMS_DEV_crd-request-generator-sync:/home/node/app:nocopy # nocopy is important + - rems_dev_crd-request-generator-sync:/home/node/app:nocopy # nocopy is important - /home/node/app/node_modules - /home/node/app/databaseData @@ -68,13 +68,13 @@ services: build: context: ../dtr dockerfile: Dockerfile.dev - container_name: REMS_DEV_dtr + container_name: rems_dev_dtr ports: # Port binding to host from docker container - "3005:3005" # Bind port 3000 of host to 3000 of container volumes: - - REMS_DEV_dtr-sync:/home/node/app:nocopy # nocopy is important + - rems_dev_dtr-sync:/home/node/app:nocopy # nocopy is important - /home/node/app/node_modules - # - /home/node/app/databaseData + - /home/node/app/databaseData # Create rems container @@ -82,21 +82,21 @@ services: build: context: '.' dockerfile: Dockerfile.dev - container_name: REMS_DEV_rems + container_name: rems_dev_rems ports: # Port binding to host from docker container - "9015:9015" # Bind port 3000 of host to 3000 of container volumes: - - REMS_DEV_rems-sync:/REMS:nocopy # nocopy is important + - rems_dev_rems-sync:/REMS:nocopy # nocopy is important volumes: keycloak-data: - REMS_DEV_test-ehr-sync: + rems_dev_test-ehr-sync: external: true - REMS_DEV_crd-sync: + rems_dev_crd-sync: external: true - REMS_DEV_crd-request-generator-sync: + rems_dev_crd-request-generator-sync: external: true - REMS_DEV_dtr-sync: + rems_dev_dtr-sync: external: true - REMS_DEV_rems-sync: + rems_dev_rems-sync: external: true \ No newline at end of file diff --git a/docker-compose-porter.yml b/docker-compose-porter.yml new file mode 100644 index 00000000..4950537e --- /dev/null +++ b/docker-compose-porter.yml @@ -0,0 +1,64 @@ +version: '3.6' +services: + keycloak: + container_name: rems_porter_keycloak + # command: ["-Djboss.http.port=8180"] + ports: + - '8180:8080' + environment: + - KEYCLOAK_USER=admin + - KEYCLOAK_PASSWORD=admin + - DB_VENDOR=h2 + # - KEYCLOAK_IMPORT=/resources/ClientFhirServerRealm.json + volumes: + - keycloak-data:/opt/jboss/keycloak/standalone/data/ + # - './resources/ClientFhirServerRealm.json:/resources/ClientFhirServerRealm.json' + image: hkong2/keycloak + + # Create test-ehr container + test-ehr: # Name of our service + container_name: rems_porter_test-ehr + ports: # Port binding to host from docker container + - '8080:8080' # Bind port 3000 of host to 3000 of container + image: codexrems/rems_prod_test-ehr + environment: + - DOCKER_DEV_PROFILE=true + + + # Create crd container + crd: # Name of our service + image: codexrems/rems_prod_crd + container_name: rems_porter_crd + ports: # Port binding to host from docker container + - "8090:8090" # Bind port 3000 of host to 3000 of container + environment: + VSAC_API_KEY: ${VSAC_API_KEY} + + + # Create crd request generator container + crd-request-generator: # Name of our service + image: codexrems/rems_prod_crd-request-generator + container_name: rems_porter_crd-request-generator + ports: # Port binding to host from docker container + - "3000:3000" # Bind port 3000 of host to 3000 of container + - "3001:3001" + + + # Create dtr container + dtr: # Name of our service + image: codexrems/rems_prod_dtr + container_name: rems_porter_dtr + ports: # Port binding to host from docker container + - "3005:3005" # Bind port 3000 of host to 3000 of container + + # # Create rems container + rems: # Name of our service + image: codexrems/rems_prod_rems + container_name: rems_porter_rems + ports: # Port binding to host from docker container + - "9015:9015" # Bind port 3000 of host to 3000 of container + + + +volumes: + keycloak-data: diff --git a/docker-compose.yml b/docker-compose.yml index 3c2afb43..7c7b2592 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '3.6' services: keycloak: - container_name: REMS_PROD_keycloak + container_name: rems_prod_keycloak # command: ["-Djboss.http.port=8180"] ports: - '8180:8080' @@ -17,18 +17,18 @@ services: # Create test-ehr container test-ehr: # Name of our service - container_name: REMS_PROD_test-ehr + container_name: rems_prod_test-ehr ports: # Port binding to host from docker container - '8080:8080' # Bind port 3000 of host to 3000 of container - image: smalhotra01234/rems_prod_test-ehr + image: codexrems/rems_prod_test-ehr environment: - DOCKER_DEV_PROFILE=true - + # Create crd container crd: # Name of our service - image: smalhotra01234/rems_prod_crd - container_name: REMS_PROD_crd + image: codexrems/rems_prod_crd + container_name: rems_prod_crd ports: # Port binding to host from docker container - "8090:8090" # Bind port 3000 of host to 3000 of container environment: @@ -37,8 +37,8 @@ services: # Create crd request generator container crd-request-generator: # Name of our service - image: smalhotra01234/rems_prod_crd-request-generator - container_name: REMS_PROD_crd-request-generator + image: codexrems/rems_prod_crd-request-generator + container_name: rems_prod_crd-request-generator ports: # Port binding to host from docker container - "3000:3000" # Bind port 3000 of host to 3000 of container - "3001:3001" @@ -46,15 +46,15 @@ services: # Create dtr container dtr: # Name of our service - image: smalhotra01234/rems_prod_dtr - container_name: REMS_PROD_dtr + image: codexrems/rems_prod_dtr + container_name: rems_prod_dtr ports: # Port binding to host from docker container - "3005:3005" # Bind port 3000 of host to 3000 of container # # Create rems container rems: # Name of our service - image: smalhotra01234/rems_prod_rems - container_name: REMS_PROD_rems + image: codexrems/rems_prod_rems + container_name: rems_prod_rems ports: # Port binding to host from docker container - "9015:9015" # Bind port 3000 of host to 3000 of container diff --git a/docker-sync.yml b/docker-sync.yml index fd2d1da7..80aa060a 100644 --- a/docker-sync.yml +++ b/docker-sync.yml @@ -2,21 +2,21 @@ version: "2" options: compose-file-path: './docker-compose-dev.yml' syncs: - REMS_DEV_test-ehr-sync: + rems_dev_test-ehr-sync: src: ../test-ehr sync_excludes: ['.gradle', 'build', 'target', 'bin'] - REMS_DEV_crd-sync: + rems_dev_crd-sync: src: '../CRD' sync_excludes: ['.gradle', 'server/.gradle', 'server/bin', 'server/build'] - REMS_DEV_crd-request-generator-sync: + rems_dev_crd-request-generator-sync: src: '../crd-request-generator' sync_excludes: ['node_modules', 'build', 'databaseData'] - REMS_DEV_dtr-sync: + rems_dev_dtr-sync: src: '../dtr' - sync_excludes: ['node_modules'] + sync_excludes: ['node_modules', 'databaseData'] - REMS_DEV_rems-sync: + rems_dev_rems-sync: src: '.' \ No newline at end of file diff --git a/porter.yaml b/porter.yaml index 6c73feca..c7efe866 100644 --- a/porter.yaml +++ b/porter.yaml @@ -1,7 +1,7 @@ -name: drls_pas_workflow -version: 0.0.2 -description: Prior Authorization Workflow -registry: smalhotra01234 +name: fullstack_drls_rems +version: 0.0.1 +description: Fullstack DRLS REMS Workflow +registry: codexrems dockerfile: Dockerfile.tmpl @@ -12,11 +12,11 @@ mixins: - docker - docker-compose -credentials: - - name: DOCKER_USERNAME - env: DOCKER_USERNAME - - name: DOCKER_PASSWORD - env: DOCKER_PASSWORD +# credentials: +# - name: DOCKER_USERNAME +# env: DOCKER_USERNAME +# - name: DOCKER_PASSWORD +# env: DOCKER_PASSWORD build: - docker: @@ -28,6 +28,8 @@ install: - docker-compose: description: Docker Compose up arguments: + - -f + - docker-compose-porter.yml - up ps: @@ -40,5 +42,7 @@ uninstall: - docker-compose: description: Docker Compose down arguments: + - -f + - docker-compose-porter.yml - down - --remove-orphans \ No newline at end of file From 056c0e72d70d87283da5911b3d0a1c2c546cc09b Mon Sep 17 00:00:00 2001 From: smalho01 <88040167+smalho01@users.noreply.github.com> Date: Wed, 17 Nov 2021 09:56:47 -0500 Subject: [PATCH 04/20] Update DockerProdSetupGuideForMacOS.md --- DockerProdSetupGuideForMacOS.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/DockerProdSetupGuideForMacOS.md b/DockerProdSetupGuideForMacOS.md index bf136571..e6ef8dea 100644 --- a/DockerProdSetupGuideForMacOS.md +++ b/DockerProdSetupGuideForMacOS.md @@ -41,8 +41,6 @@ This guide will take you through the development environment setup for each of t Your computer must have these minimum requirements: - Running MacOS - - > The docker synchronization strategy used by docker-sync in this guide is designed for MacOs use. The same configuration will likely not work on Windows as the synchronization strategy used by docker-sync on windows can not handle more than 30 sync files at a time. Reference documentaion: https://docker-sync.readthedocs.io/en/latest/advanced/sync-strategies.html# - x86_64 (64-bit) or equivalent processor * Follow these instructions to verify your machine's compliance: https://www.macobserver.com/tips/how-to/mac-32-bit-64-bit/ From 7f0df1561728282d171bdc830ea1b20235a81d08 Mon Sep 17 00:00:00 2001 From: Sahil Malhotra Date: Wed, 17 Nov 2021 12:24:11 -0500 Subject: [PATCH 05/20] update prod set up md file description --- DockerProdSetupGuideForMacOS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DockerProdSetupGuideForMacOS.md b/DockerProdSetupGuideForMacOS.md index bf136571..74db54e6 100644 --- a/DockerProdSetupGuideForMacOS.md +++ b/DockerProdSetupGuideForMacOS.md @@ -152,7 +152,7 @@ or #### Stop docker-compose application ```bash - docker-compose down # Stops applications + docker-compose down # Removes application servers docker volume prune # Optiional - Removes persisted data ``` @@ -166,7 +166,7 @@ or #### Stop Running Porter ```bash - porter uninstall --allow-docker-host-access --reference codexrems/fullstack_drls_rems:v0.0.1 # Stops application servers + porter uninstall --allow-docker-host-access --reference codexrems/fullstack_drls_rems:v0.0.1 # Stops and removes application servers docker volume prune # Optional - Removes persisted data ``` From a04ca739c9129feeb0888372d2060346d87bf2bb Mon Sep 17 00:00:00 2001 From: Sahil Malhotra Date: Wed, 17 Nov 2021 12:25:34 -0500 Subject: [PATCH 06/20] update prod set up md file description --- DockerProdSetupGuideForMacOS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DockerProdSetupGuideForMacOS.md b/DockerProdSetupGuideForMacOS.md index 497cc14d..04bef57c 100644 --- a/DockerProdSetupGuideForMacOS.md +++ b/DockerProdSetupGuideForMacOS.md @@ -152,7 +152,7 @@ or ```bash docker-compose down # Removes application servers - docker volume prune # Optiional - Removes persisted data + docker volume prune # Optional - Removes persisted data ``` ### Option 2 - Porter Install From 9fc4900a4183fa363050e765c2d054ee1b53638c Mon Sep 17 00:00:00 2001 From: Sahil Malhotra Date: Thu, 18 Nov 2021 11:17:14 -0500 Subject: [PATCH 07/20] read me updates --- DockerDevSetupGuideForMacOS.md | 2 +- DockerProdSetupGuideForMacOS.md | 6 +++--- README.md | 15 +++++++++++++++ 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/DockerDevSetupGuideForMacOS.md b/DockerDevSetupGuideForMacOS.md index 250a5e8a..8c93ae33 100644 --- a/DockerDevSetupGuideForMacOS.md +++ b/DockerDevSetupGuideForMacOS.md @@ -67,7 +67,7 @@ Additionally, you must have credentials (api key) access for the **[Value Set Au 2. Once the installation is complete, you should see a Docker icon on your Mac's menu bar (top of the screen). Click the icon and verify that **Docker Desktop is running.** 3. Configure Docker to have access to enough resources. To do this, open Docker Desktop and select Settings > Resources. - The defaults for memory at 2GB and possibly CPU as well are too low to run the entire Prior-Auth workflow. If not enough resources are provided, you may notice containers unexpectedly crashing and stopping. Exact requirements for these resource values will depend on your machine. That said, as a baseline starting point, the system runs relatively smoothly at 15GB memory and 7 CPU Processors on MITRE issued Mac Devices. + The defaults for memory at 2GB and possibly CPU as well are too low to run the entire DRLS REMS workflow. If not enough resources are provided, you may notice containers unexpectedly crashing and stopping. Exact requirements for these resource values will depend on your machine. That said, as a baseline starting point, the system runs relatively smoothly at 15GB memory and 7 CPU Processors on MITRE issued Mac Devices. #### Install Ruby Note: The default ruby that comes with Mac may not install the right package version for docker-sync, it is reccomended to install ruby with a package manager, this guide uses rbenv. diff --git a/DockerProdSetupGuideForMacOS.md b/DockerProdSetupGuideForMacOS.md index 04bef57c..b3290567 100644 --- a/DockerProdSetupGuideForMacOS.md +++ b/DockerProdSetupGuideForMacOS.md @@ -6,9 +6,9 @@ Repository to host root docker bundle config files for local development and pub This document details the installation process for the dockerized version of the **Documentation Requirements Lookup Service (DRLS) REMS Workflow** system for Production. There are two approaches to doing this: -Option 1 utilizes Docker Compose, which comes with Docker Dektop, and requires the corresponding docker-compose.yml file from the REMS repository. +Option 1 utilizes Docker Compose, which comes with Docker Dektop, and requires the corresponding docker-compose.yml file from the REMS repository. This option has minimal technical set up involved and allows for the customization/modification of the dockerized configuration. -Option 2 utilizes Porter, which requires a seperate installation in addition to Docker Desktop but does not require the use of any local files. +Option 2 utilizes Porter, which requires a seperate installation in addition to Docker Desktop but does not require the use of any local files. This option has the least amount of technical set up involved and is recommended for non-tecnical users of DRLS REMS as it **does not** allow for the customization/modification of the dockerized configuration. This document **is designed to take you through the entire set up process for DRLS using docker containers**. It is a standalone guide that does not depend on any supplementary DRLS documentation. @@ -62,7 +62,7 @@ Additionally, you must have credentials (api key) access for the **[Value Set Au 2. Once the installation is complete, you should see a Docker icon on your Mac's menu bar (top of the screen). Click the icon and verify that **Docker Desktop is running.** 3. Configure Docker to have access to enough resources. To do this, open Docker Desktop and select Settings > Resources. - The defaults for memory at 2GB and possibly CPU as well are too low to run the entire Prior-Auth workflow. If not enough resources are provided, you may notice containers unexpectedly crashing and stopping. Exact requirements for these resource values will depend on your machine. That said, as a baseline starting point, the system runs relatively smoothly at 15GB memory and 7 CPU Processors on MITRE issued Mac Devices. + The defaults for memory at 2GB and possibly CPU as well are too low to run the entire DRLS REMS workflow. If not enough resources are provided, you may notice containers unexpectedly crashing and stopping. Exact requirements for these resource values will depend on your machine. That said, as a baseline starting point, the system runs relatively smoothly at 15GB memory and 7 CPU Processors on MITRE issued Mac Devices. #### Install Porter (Option 2 Only) diff --git a/README.md b/README.md index 78a4ab06..9db30d91 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,17 @@ # REMS +## Running fullstack DRLS REMS Dockerized set up + +You can find complete end-to-end fullstack set up guides for DRLS REMS at the following links: + [Developer Environment Set Up](DockerDevSetupGuideForMacOS.md) - Follow this guide if you are a developer and intend on making code changes to the DRLS REMS project. This guide follows a much more technical set up process. + [Production Environement Set Up](DockerProdSetupGuideForMacOS.md) - Follow this guide if you are not planning on making code changes and only want to run the DRLS REMS workflow locally. This guide covers two options for running DRLS REMS, both of which are less techincal than the developer set up. + +## Running REMS server locally +1. Clone the REMS repositories from Github: + ```bash + git clone https://github.com/mcode/REMS.git REMS + ``` +2. Run dockerRunner.sh script + ```bash + ./dockerRunner.sh + ``` \ No newline at end of file From 409e1692909ab67cf6788deae1a9c86c35652be2 Mon Sep 17 00:00:00 2001 From: Sahil Malhotra Date: Thu, 18 Nov 2021 11:21:11 -0500 Subject: [PATCH 08/20] read me updates --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9db30d91..043d470a 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ You can find complete end-to-end fullstack set up guides for DRLS REMS at the following links: [Developer Environment Set Up](DockerDevSetupGuideForMacOS.md) - Follow this guide if you are a developer and intend on making code changes to the DRLS REMS project. This guide follows a much more technical set up process. - [Production Environement Set Up](DockerProdSetupGuideForMacOS.md) - Follow this guide if you are not planning on making code changes and only want to run the DRLS REMS workflow locally. This guide covers two options for running DRLS REMS, both of which are less techincal than the developer set up. + [Production Environement Set Up](DockerProdSetupGuideForMacOS.md) - Follow this guide if you are not a developer and do not intend on making code changes to the DRLS REMS project. This guide covers two options for running DRLS REMS, both of which are less techincal than the developer set up. ## Running REMS server locally 1. Clone the REMS repositories from Github: From ec03330e90a7d0c21ad96ee77ab0cf53faae10b7 Mon Sep 17 00:00:00 2001 From: smalho01 <88040167+smalho01@users.noreply.github.com> Date: Thu, 18 Nov 2021 11:21:51 -0500 Subject: [PATCH 09/20] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 043d470a..50b25c89 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,9 @@ ## Running fullstack DRLS REMS Dockerized set up You can find complete end-to-end fullstack set up guides for DRLS REMS at the following links: + [Developer Environment Set Up](DockerDevSetupGuideForMacOS.md) - Follow this guide if you are a developer and intend on making code changes to the DRLS REMS project. This guide follows a much more technical set up process. + [Production Environement Set Up](DockerProdSetupGuideForMacOS.md) - Follow this guide if you are not a developer and do not intend on making code changes to the DRLS REMS project. This guide covers two options for running DRLS REMS, both of which are less techincal than the developer set up. ## Running REMS server locally @@ -14,4 +16,4 @@ You can find complete end-to-end fullstack set up guides for DRLS REMS at the fo 2. Run dockerRunner.sh script ```bash ./dockerRunner.sh - ``` \ No newline at end of file + ``` From b704f476b079e1627bfc7e50f3fe537117011a41 Mon Sep 17 00:00:00 2001 From: smalho01 <88040167+smalho01@users.noreply.github.com> Date: Thu, 18 Nov 2021 11:22:31 -0500 Subject: [PATCH 10/20] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 50b25c89..72ecde32 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ You can find complete end-to-end fullstack set up guides for DRLS REMS at the following links: - [Developer Environment Set Up](DockerDevSetupGuideForMacOS.md) - Follow this guide if you are a developer and intend on making code changes to the DRLS REMS project. This guide follows a much more technical set up process. +[Developer Environment Set Up](DockerDevSetupGuideForMacOS.md) - Follow this guide if you are a developer and intend on making code changes to the DRLS REMS project. This guide follows a much more technical set up process. - [Production Environement Set Up](DockerProdSetupGuideForMacOS.md) - Follow this guide if you are not a developer and do not intend on making code changes to the DRLS REMS project. This guide covers two options for running DRLS REMS, both of which are less techincal than the developer set up. +[Production Environement Set Up](DockerProdSetupGuideForMacOS.md) - Follow this guide if you are not a developer and do not intend on making code changes to the DRLS REMS project. This guide covers two options for running DRLS REMS, both of which are less techincal than the developer set up. ## Running REMS server locally 1. Clone the REMS repositories from Github: From d665c2198551d7befb2e6cc2df68788bc9633315 Mon Sep 17 00:00:00 2001 From: smalho01 <88040167+smalho01@users.noreply.github.com> Date: Thu, 18 Nov 2021 11:23:16 -0500 Subject: [PATCH 11/20] Update DockerDevSetupGuideForMacOS.md --- DockerDevSetupGuideForMacOS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DockerDevSetupGuideForMacOS.md b/DockerDevSetupGuideForMacOS.md index 8c93ae33..9a011b86 100644 --- a/DockerDevSetupGuideForMacOS.md +++ b/DockerDevSetupGuideForMacOS.md @@ -70,9 +70,9 @@ Additionally, you must have credentials (api key) access for the **[Value Set Au The defaults for memory at 2GB and possibly CPU as well are too low to run the entire DRLS REMS workflow. If not enough resources are provided, you may notice containers unexpectedly crashing and stopping. Exact requirements for these resource values will depend on your machine. That said, as a baseline starting point, the system runs relatively smoothly at 15GB memory and 7 CPU Processors on MITRE issued Mac Devices. #### Install Ruby - Note: The default ruby that comes with Mac may not install the right package version for docker-sync, it is reccomended to install ruby with a package manager, this guide uses rbenv. +Note: The default ruby that comes with Mac may not install the right package version for docker-sync, it is reccomended to install ruby with a package manager, this guide uses rbenv. - Reference: https://github.com/rbenv/rbenv +Reference: https://github.com/rbenv/rbenv 1. Install rbenv ```bash From 6763c379e6dc6127ed7725c6c672708a63650d20 Mon Sep 17 00:00:00 2001 From: smalho01 <88040167+smalho01@users.noreply.github.com> Date: Thu, 18 Nov 2021 11:25:55 -0500 Subject: [PATCH 12/20] Update DockerProdSetupGuideForMacOS.md --- DockerProdSetupGuideForMacOS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DockerProdSetupGuideForMacOS.md b/DockerProdSetupGuideForMacOS.md index b3290567..8a76190d 100644 --- a/DockerProdSetupGuideForMacOS.md +++ b/DockerProdSetupGuideForMacOS.md @@ -10,7 +10,7 @@ Option 1 utilizes Docker Compose, which comes with Docker Dektop, and requires t Option 2 utilizes Porter, which requires a seperate installation in addition to Docker Desktop but does not require the use of any local files. This option has the least amount of technical set up involved and is recommended for non-tecnical users of DRLS REMS as it **does not** allow for the customization/modification of the dockerized configuration. -This document **is designed to take you through the entire set up process for DRLS using docker containers**. It is a standalone guide that does not depend on any supplementary DRLS documentation. +This document **is designed to take you through the entire set up process for DRLS REMS using docker containers**. It is a standalone guide that does not depend on any supplementary DRLS REMS documentation. This guide will take you through the development environment setup for each of the following DRLS components: 1. [Coverage Requirements Discovery (CRD)](https://github.com/mcode/CRD) From e86bece1a7b6cdb2a160dd60b25c35070e2789d3 Mon Sep 17 00:00:00 2001 From: smalho01 <88040167+smalho01@users.noreply.github.com> Date: Thu, 18 Nov 2021 11:27:43 -0500 Subject: [PATCH 13/20] Update DockerProdSetupGuideForMacOS.md --- DockerProdSetupGuideForMacOS.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DockerProdSetupGuideForMacOS.md b/DockerProdSetupGuideForMacOS.md index 8a76190d..b324a0bd 100644 --- a/DockerProdSetupGuideForMacOS.md +++ b/DockerProdSetupGuideForMacOS.md @@ -159,8 +159,9 @@ or #### Install and Run Porter application ```bash - porter install --allow-docker-host-access --reference codexrems/fullstack_drls_rems:v0.0.1 # Note, the project will keep running in the background when you "ctrl + c" out of process. To stop running all together, use the uninstall command below + porter install --allow-docker-host-access --reference codexrems/fullstack_drls_rems:v0.0.1 ``` +Note, the project will keep running in the background when you "ctrl + c" out of process. To stop running all together, use the uninstall command below #### Stop Running Porter ```bash From cce171a3d3e04c433e975f8336ec6cb041497500 Mon Sep 17 00:00:00 2001 From: smalho01 <88040167+smalho01@users.noreply.github.com> Date: Thu, 18 Nov 2021 11:29:17 -0500 Subject: [PATCH 14/20] Update DockerProdSetupGuideForMacOS.md --- DockerProdSetupGuideForMacOS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DockerProdSetupGuideForMacOS.md b/DockerProdSetupGuideForMacOS.md index b324a0bd..a031300e 100644 --- a/DockerProdSetupGuideForMacOS.md +++ b/DockerProdSetupGuideForMacOS.md @@ -161,9 +161,9 @@ or ```bash porter install --allow-docker-host-access --reference codexrems/fullstack_drls_rems:v0.0.1 ``` -Note, the project will keep running in the background when you "ctrl + c" out of process. To stop running all together, use the uninstall command below +Note: The project will keep running in the background when you "ctrl + c" out of the above process. To stop running all together, use the uninstall command below -#### Stop Running Porter +#### Stop Running Porter application and Uninstall ```bash porter uninstall --allow-docker-host-access --reference codexrems/fullstack_drls_rems:v0.0.1 # Stops and removes application servers From abd80a421659ea6bfbe18141563b62649980813c Mon Sep 17 00:00:00 2001 From: smalho01 <88040167+smalho01@users.noreply.github.com> Date: Thu, 18 Nov 2021 11:30:47 -0500 Subject: [PATCH 15/20] Update DockerDevSetupGuideForMacOS.md --- DockerDevSetupGuideForMacOS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DockerDevSetupGuideForMacOS.md b/DockerDevSetupGuideForMacOS.md index 9a011b86..692807ee 100644 --- a/DockerDevSetupGuideForMacOS.md +++ b/DockerDevSetupGuideForMacOS.md @@ -287,7 +287,7 @@ Reference: https://docker-sync.readthedocs.io/en/latest/getting-started/commands 9. If you are asked for login credentials, use **alice** for username and **alice** for password. 10. A webpage should open in a new tab, and after a few seconds, a questionnaire should appear. 11. Fill out questionnaire and hit next -12. Submit Prior Authorization Request to http://localhost:9015/fhir +12. Submit REMS Request to http://localhost:9015/fhir Congratulations! DRLS is fully installed and ready for you to use! From 0898cf6d1e085f20bbe8fff9028191e3bc991b1b Mon Sep 17 00:00:00 2001 From: smalho01 <88040167+smalho01@users.noreply.github.com> Date: Thu, 18 Nov 2021 11:31:35 -0500 Subject: [PATCH 16/20] Update DockerDevSetupGuideForMacOS.md --- DockerDevSetupGuideForMacOS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DockerDevSetupGuideForMacOS.md b/DockerDevSetupGuideForMacOS.md index 692807ee..36e037a9 100644 --- a/DockerDevSetupGuideForMacOS.md +++ b/DockerDevSetupGuideForMacOS.md @@ -1,4 +1,4 @@ -# DRLS-Docker-The Ultimate Guide to Running DRLS (Prior Auth workflow) for Local Development +# DRLS-Docker-The Ultimate Guide to Running DRLS (REMS workflow) for Local Development Repository to host root docker bundle config files for local development and publishing From f819241afec45917a108a10e7ca0a09600fd94b0 Mon Sep 17 00:00:00 2001 From: smalho01 <88040167+smalho01@users.noreply.github.com> Date: Thu, 18 Nov 2021 11:31:55 -0500 Subject: [PATCH 17/20] Update DockerDevSetupGuideForMacOS.md --- DockerDevSetupGuideForMacOS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DockerDevSetupGuideForMacOS.md b/DockerDevSetupGuideForMacOS.md index 36e037a9..ce1f729b 100644 --- a/DockerDevSetupGuideForMacOS.md +++ b/DockerDevSetupGuideForMacOS.md @@ -1,4 +1,4 @@ -# DRLS-Docker-The Ultimate Guide to Running DRLS (REMS workflow) for Local Development +# DRLS-Docker-The Ultimate Guide to Running DRLS REMS for Local Development Repository to host root docker bundle config files for local development and publishing From a67414c773bc160a7b8a500338b046eb8b05f1a6 Mon Sep 17 00:00:00 2001 From: smalho01 <88040167+smalho01@users.noreply.github.com> Date: Thu, 18 Nov 2021 11:33:06 -0500 Subject: [PATCH 18/20] Update DockerProdSetupGuideForMacOS.md --- DockerProdSetupGuideForMacOS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DockerProdSetupGuideForMacOS.md b/DockerProdSetupGuideForMacOS.md index a031300e..02a86820 100644 --- a/DockerProdSetupGuideForMacOS.md +++ b/DockerProdSetupGuideForMacOS.md @@ -1,4 +1,4 @@ -# DRLS-Docker-The Ultimate Guide to Running DRLS (Prior Auth workflow) for Local Development +# DRLS-REMS-Docker-The Ultimate Guide to Running DRLS REMS locally Repository to host root docker bundle config files for local development and publishing From 814006220bc5b816aa32d3c4a1c5258d39a4ad4a Mon Sep 17 00:00:00 2001 From: smalho01 <88040167+smalho01@users.noreply.github.com> Date: Thu, 18 Nov 2021 11:33:29 -0500 Subject: [PATCH 19/20] Update DockerDevSetupGuideForMacOS.md --- DockerDevSetupGuideForMacOS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DockerDevSetupGuideForMacOS.md b/DockerDevSetupGuideForMacOS.md index ce1f729b..15de00db 100644 --- a/DockerDevSetupGuideForMacOS.md +++ b/DockerDevSetupGuideForMacOS.md @@ -1,4 +1,4 @@ -# DRLS-Docker-The Ultimate Guide to Running DRLS REMS for Local Development +# DRLS-REMS-Docker-The Ultimate Guide to Running DRLS REMS for Local Development Repository to host root docker bundle config files for local development and publishing From 91600f96d2aee7b7b4180fa4e97da5a1621c56f2 Mon Sep 17 00:00:00 2001 From: Sahil Malhotra Date: Thu, 18 Nov 2021 12:38:19 -0500 Subject: [PATCH 20/20] changed published image tags to be more concise --- docker-compose-porter.yml | 10 +++++----- docker-compose.yml | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docker-compose-porter.yml b/docker-compose-porter.yml index 4950537e..572df732 100644 --- a/docker-compose-porter.yml +++ b/docker-compose-porter.yml @@ -20,14 +20,14 @@ services: container_name: rems_porter_test-ehr ports: # Port binding to host from docker container - '8080:8080' # Bind port 3000 of host to 3000 of container - image: codexrems/rems_prod_test-ehr + image: codexrems/test-ehr environment: - DOCKER_DEV_PROFILE=true # Create crd container crd: # Name of our service - image: codexrems/rems_prod_crd + image: codexrems/crd container_name: rems_porter_crd ports: # Port binding to host from docker container - "8090:8090" # Bind port 3000 of host to 3000 of container @@ -37,7 +37,7 @@ services: # Create crd request generator container crd-request-generator: # Name of our service - image: codexrems/rems_prod_crd-request-generator + image: codexrems/crd-request-generator container_name: rems_porter_crd-request-generator ports: # Port binding to host from docker container - "3000:3000" # Bind port 3000 of host to 3000 of container @@ -46,14 +46,14 @@ services: # Create dtr container dtr: # Name of our service - image: codexrems/rems_prod_dtr + image: codexrems/dtr container_name: rems_porter_dtr ports: # Port binding to host from docker container - "3005:3005" # Bind port 3000 of host to 3000 of container # # Create rems container rems: # Name of our service - image: codexrems/rems_prod_rems + image: codexrems/rems container_name: rems_porter_rems ports: # Port binding to host from docker container - "9015:9015" # Bind port 3000 of host to 3000 of container diff --git a/docker-compose.yml b/docker-compose.yml index 7c7b2592..6cb7df54 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,14 +20,14 @@ services: container_name: rems_prod_test-ehr ports: # Port binding to host from docker container - '8080:8080' # Bind port 3000 of host to 3000 of container - image: codexrems/rems_prod_test-ehr + image: codexrems/test-ehr environment: - DOCKER_DEV_PROFILE=true # Create crd container crd: # Name of our service - image: codexrems/rems_prod_crd + image: codexrems/crd container_name: rems_prod_crd ports: # Port binding to host from docker container - "8090:8090" # Bind port 3000 of host to 3000 of container @@ -37,7 +37,7 @@ services: # Create crd request generator container crd-request-generator: # Name of our service - image: codexrems/rems_prod_crd-request-generator + image: codexrems/crd-request-generator container_name: rems_prod_crd-request-generator ports: # Port binding to host from docker container - "3000:3000" # Bind port 3000 of host to 3000 of container @@ -46,14 +46,14 @@ services: # Create dtr container dtr: # Name of our service - image: codexrems/rems_prod_dtr + image: codexrems/dtr container_name: rems_prod_dtr ports: # Port binding to host from docker container - "3005:3005" # Bind port 3000 of host to 3000 of container # # Create rems container rems: # Name of our service - image: codexrems/rems_prod_rems + image: codexrems/rems container_name: rems_prod_rems ports: # Port binding to host from docker container - "9015:9015" # Bind port 3000 of host to 3000 of container