Docker, VistA, & VA-PALS -- Local Dev & Test Environments

We've wanted for some time now to move towards a more modern development approach that permits programmers to work with disposable replicas of a common environment. Virtual Machines, like the OSEHRA Vagrant instances, are one option, but we've found distribution of the VMs cumbersome. Fortunately, Christopher Edwards & OSEHRA have released Docker images that work to the same end, and Docker Hub makes distributing new versions easy. We've modified one of those images to provide disposable replicas of our VA-PALS environment and OSEHRA is hosting that repository on Docker Hub.

Docker is fundamentally different than a traditional platform for virtual machinesin part because it was never intended to be a platform for virtual machines. However, in a demonstration of the Law Of Unintended Consequences, we're using Docker to distribute and run virtual machines that are easy on the resources of your computer. If you're interested in what's different about Docker, Docker Hub has a nice introduction.

If you want your very own version of our environment, you'll first need to install Docker. If you're using OS X or Windows, start at https://docs.docker.com/engine/installation and download the appropriate installer. If your operating system is Linux, there is an excellent guide at https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu.

Next, you'll need to open a terminal app. Macs come with an app conveniently called Terminal. Windows has the command prompt, among others. I'm working on a Mac, so the snippets in this article taken from my command line have Mac/Linux styling.

You need to pull a Docker image hosted on Docker Hub by OSEHRA and use that image to start a Docker container, which for our purposes will be your virtual machine. This initial download is a bit over 1 GB. From the command line of your terminal:

$ docker pull osehra/va-pals

$ docker run -d --name vapals -h vapals -p 2222:22 -p 8001:8001 -p 8080:8080 -p 8888:8888 -p 9430:9430 -p 9080:9080 -P --entrypoint "/bin/sh" osehra/va-pals -c /home/osehra/bin/start.sh

Unless you get an error message, that's it. Your VM is running and Vista is starting. New versions of the Docker image will be published from time to time. However, snapshots of the state of our development environment will be published daily. These downloads are currently just under 400 MB, which is still big but better than repeatedly downloading the Docker image. This also means you can do some configuring of your container or virtual machine without starting over each time you want an update. You can update your container by connecting and logging into the virtual machine via a shell session.

$ ssh -p 2222 root@localhost

root@localhost's password: docker

The root user's prompt is slightly different: the pound sign. The "osehra" command will switch you to the osehra user under which Vista is installed, and an update script will download the latest snapshot.

[root@vapals ~]# osehra

[osehra@vapals ~]$ bin/update-vista.sh

If you simply want to directly test the web forms we're building for this project, you can switch to your web browser and load the URL http://localhost:9080/see. You should see a list of forms and web resources and assets.

Our first VA-PALS/I-ELCAP form is the background form. Paste and load the URL http://localhost:9080/form?form=sbform&studyid=XX0001 in your browser to see and test the form with a pre-existing patient. You can create a blank patient and further test the form by replacing "XX0001" in the URL with a different study ID. Additional forms will be added as we complete them.

If you want to look at the code for this project, it's in /home/osehra/lib/silver/va-pals. The latest version of VPE is installed, as is Sam Habiel's M Tools, if you'd like to use Eclipse.

Docker handles having your computer go to sleep and wake up quite well. Our shutdown scripts do not execute correctly when you stop the container. The startup scripts are designed to handle that fact, but we have also included a stop script you can run before stopping your container to ensure that Vista shuts down cleanly. It should be run as the osehra user.

[osehra@vapals ~]$ bin/stop.sh

When that script finishes, you can stop your container.

[osehra@vapals ~]$ exit

[root@vapals ~]# exit

$ docker stop vapals

You can easily restart the container.

$ docker start vapals

If you do want to switch to a more recent version of the Docker image itself, stop the container and remove it. Then repeat the first two docker operations.

$ docker container rm vapals

$ docker pull osehra/va-pals

$ docker run -d --name vapals -h vapals -p 2222:22 -p 8001:8001 -p 8080:8080 -p 8888:8888 -p 9430:9430 -p 9080:9080 -P --entrypoint "/bin/sh" osehra/va-pals -c /home/osehra/bin/start.sh

We're excited to be a part of the VA-PALS project, and we look forward to sharing our progress with the OSEHRA open-source community.

File: 

like0

Comments

Docker, VistA, & VA-PALS -- Local Dev & Test Environments

Sam Habiel's picture
I tried it and everything seems to work fine. Thank you Alexis.

--Sam


--Sam Habiel, Pharm.D.

Technical Fellow

Open Source Electronic Health Records Alliance (OSEHRA)

Cell: 206-353-1681



On Mon, Nov 20, 2017 at 3:15 PM, Alexis Carlson <whatisthehumanspirit@gmail.com> wrote:

We've wanted for some time now to move towards a more modern development approach that permits programmers to work with disposable replicas of a common environment. Virtual Machines, like the OSEHRA Vagrant instances, are one option, but we've found distribution of the VMs cumbersome. Fortunately, Christopher Edwards & OSEHRA have released Docker images that work to the same end, and Docker Hub makes distributing new versions easy. We've modified one of those images to provide disposable replicas of our VA-PALS environment and OSEHRA is hosting that repository on Docker Hub.

Docker is fundamentally different than a traditional platform for virtual machinesin part because it was never intended to be a platform for virtual machines. However, in a demonstration of the Law Of Unintended Consequences, we're using Docker to distribute and run virtual machines that are easy on the resources of your computer. If you're interested in what's different about Docker, Docker Hub has a nice introduction.

If you want your very own version of our environment, you'll first need to install Docker. If you're using OS X or Windows, start at https://docs.docker.com/engine/installation and download the appropriate installer. If your operating system is Linux, there is an excellent guide at https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu.

Next, you'll need to open a terminal app. Macs come with an app conveniently called Terminal. Windows has the command prompt, among others. I'm working on a Mac, so the snippets in this article taken from my command line have Mac/Linux styling.

You need to pull a Docker image hosted on Docker Hub by OSEHRA and use that image to start a Docker container, which for our purposes will be your virtual machine. This initial download is a bit over 1 GB. From the command line of your terminal:

$ docker pull osehra/va-pals

$ docker run -d --name vapals -h vapals -p 2222:22 -p 8001:8001 -p 8080:8080 -p 8888:8888 -p 9430:9430 -p 9080:9080 -P --entrypoint "/bin/sh" osehra/va-pals -c /home/osehra/bin/start.sh

Unless you get an error message, that's it. Your VM is running and Vista is starting. New versions of the Docker image will be published from time to time. However, snapshots of the state of our development environment will be published daily. These downloads are currently just under 400 MB, which is still big but better than repeatedly downloading the Docker image. This also means you can do some configuring of your container or virtual machine without starting over each time you want an update. You can update your container by connecting and logging into the virtual machine via a shell session.

$ ssh -p 2222 root@localhost

root@localhost's password: docker

The root user's prompt is slightly different: the pound sign. The "osehra" command will switch you to the osehra user under which Vista is installed, and an update script will download the latest snapshot.

[root@vapals ~]# osehra

[osehra@vapals ~]$ bin/update-vista.sh

If you simply want to directly test the web forms we're building for this project, you can switch to your web browser and load the URL http://localhost:9080/see. You should see a list of forms and web resources and assets.

Our first VA-PALS/I-ELCAP form is the background form. Paste and load the URL http://localhost:9080/form?form=sbform&studyid=XX0001 in your browser ]to see and test the form with a pre-existing patient. You can create a blank patient and further test the form by replacing "XX0001" in the URL with a different study ID. Additional forms will be added as we complete them.

If you want to look at the code for this project, it's in /home/osehra/lib/silver/va-pals. The latest version of VPE is installed, as is Sam Habiel's M Tools, if you'd like to use Eclipse.

Docker handles having your computer go to sleep and wake up quite well. Our shutdown scripts do not execute correctly when you stop the container. The startup scripts are designed to handle that fact, but we have also included a stop script you can run before stopping your container to ensure that Vista shuts down cleanly. It should be run as the osehra user.

[osehra@vapals ~]$ bin/stop.sh

When that script finishes, you can stop your container.

[osehra@vapals ~]$ exit

[root@vapals ~]# exit

$ docker stop vapals

You can easily restart the container.

$ docker start vapals

If you do want to switch to a more recent version of the Docker image itself, stop the container and remove it. Then repeat the first two docker operations.

$ docker container rm vapals

$ docker pull osehra/va-pals

$ docker run -d --name vapals -h vapals -p 2222:22 -p 8001:8001 -p 8080:8080 -p 8888:8888 -p 9430:9430 -p 9080:9080 -P --entrypoint "/bin/sh" osehra/va-pals -c /home/osehra/bin/start.sh

We're excited to be a part of the VA-PALS project, and we look forward to sharing our progress with the OSEHRA open-source community.



Attached files:

web-resources.jpg

background-form.jpg

--
Full post: https://www.osehra.org/post/docker-vista-va-pals-local-dev-test-environments
Manage my subscriptions: https://www.osehra.org/mailinglist
Stop emails for this post: https://www.osehra.org/mailinglist/unsubscribe/6734


like0