Skip to content

Installation

Philip Maechling edited this page Jul 8, 2021 · 17 revisions

Introduction

We have created Docker versions of UCVM velocity models and posted these on dockerhub.

Terms

We call files with executable commands "images". We have posted UCVM images onto dockerhub When we startup and image, and run the image, we call the running image a "container". The container includes SCEC's scientific software (UCV), as well as the operating system and other files needed to run the software.

Potential Benefits of using Docker

An important benefit of the Docker version of UCVM model is they can be run, using Docker, on most modern computers. UCVM is designed to run on Linux systems, but through the use of Docker, UCVM can run on Mac, and Windows as well.

Challenges using Docker

In order to use the Docker version of UCVM, users must (1) be comfortable using UCVM from the command line. Once the UCVM container is running, Users issues standard command line UCVM queries, such as "ucvm_query".

In addition, users must be comfortable invoking the container on their system. There is an expected directory structure, specificall, there should be a "/target" subdirectory in the location where the command is issued. Also, the Docker invocation includes parameters (--rm and -it) with single and double dashes, environment variable references $(pwd), and operating system level commands (e.g. mount, bind). Although the invocation looks complex, once the container is running, it works much like a previous UCVM installations.

Setting up the Directory Structure

The UCVM docker installation assumes a specific directory structure when the container innovation command is issued. The UCVM docker installation uses a subdirectory "/target" as the directory where input and output files are exchanged, between the container and the users local computer.

Users should identify a directory on their local computer where they would like to run Docker commands. As an example, on my Mac, my username is "maechlin" and the home directory for this user is /Users/maechlin

I have created a /Users/maechlin/mydocker subdirectory. I cd into this directory, and create a subdirectory called /target, which results in /Users/maechlin/mydocker/target.

I will use this /Users/maechlin/mydocker/target subdirectory as the file exchange subdirectory.

Starting Docker

Starting Docker Container:

docker run --rm -it -mount type=bind,source="$(pwd)"/target,destination=/app/target sceccode/ucvm_ivlsu:0702155

Shell Indicator Changes:

When the container starts running on your local computer, you should expect to see a change in the shell that is presented to the users in the terminal used to start the container. This changes in shell is an indication that the container is running for users to run UCVM commands. An example of this is shown below, indicating how the command line changes on my computer, when the container starts to run.

(base) maechlin@Philip-James-MacBook mydocker % docker run --rm -it --mount type=bind,source="$(pwd)"/target,destination=/app/target sceccode/ucvm_ivlsu:07021555
bash-4.2# 
bash-4.2# pwd
/app/target

When the container start, the users is located in the /app/target directory. This will map to the local computer /target directory created earlier.

Simple tests

Instructions for a simple test of the container. Using the terminal window in which the docker container is running, simple test this way:

bash-4.2# pwd
/app/target
cp /app/basic_query.txt .
cp /app/test_latlons.txt
cat basic_query.txt
ucvm_query -f /app/ucvm/conf/ucvm.conf -m ivlsu < test_latlons.txt > test_results.log

Users need to change the -m [ivlsu,cvclsu,cvms,cvms5,...etc] to the model abbreviation they want to query.

User commands

More Information

https://github.com/sceccode/ucvm_docker

Clone this wiki locally