-
Notifications
You must be signed in to change notification settings - Fork 1
Building Docker Image
The scripts in this directory are used to build the BBP Docker image. Start the process, by selecting a working directory on your development computer (a Mac for example), then cloning the bbp_docker git repo to retrieve scripts used in docker build.
On Mac:
$cd /Users/maechlin
$git clone https://github.com/sceccode/bbp_docker.git
cd into new directory
$cd bbp_docker
Retrieve the git repo of the bbp distribution that you want to install in the docker image: Syntax for single branch clone
$git clone --single-branch --branch <branchname> <remote-repo>
$git clone --single-branch --branch dev https://github.com/sceccode/bbp.git
The BBP platform supports earthquake simulations for multiple regions. Each supported region uses region specific, and method specific, greens functions. During our Docker evaluation, we are working with a minimum installation of BBP. This will include GF for southern California regions, and three validation events, Whittier Narrrows, Northridge, and Chino Hills. If this minimun configuration proves useful, we can configure other regions, or potentially more regions in each image. More regions will increase the size of the Docker image. Current, we expect Docker images of 50GB range, which is substantial. Pulling this image from Dockerhub can take up to one hour.
To reduce the Docker build time, we stage several large files in the bbp_docker/ build directory. By staging these files before we run the Docker build, these file are copied into the image during the Docker build process, instead of downloaded over the network.
the staged larges files include:
curl -O https://repo.anaconda.com/archive/Anaconda3-2021.05-Linux-x86_64.sh
curl -O http://hypocenter.usc.edu/research/bbp/versions/19.4.0/labasin500-velocity-model-19.4.0.tar.gz
curl -O http://hypocenter.usc.edu/research/bbp/versions/19.4.0/nr-validation-19.4.0.tar.gz
curl -O http://hypocenter.usc.edu/research/bbp/versions/19.4.0/whittier-validation-19.4.0.tar.gz
curl -O http://hypocenter.usc.edu/research/bbp/versions/19.4.0/chino-hills-validation-19.4.0.tar.gz
In this repo, there is a build_bbp.sh script. This invokes the docker build command. This script gives the output image a name (a tag). The current tag convention is bbp_19_4:MMDDHHMM with the assumption that "later" docker images are prefered over earlier ones. This naming convention should be updated to identify what regions and validation events are included in the image.
$build_bbp.sh
This starts the docker build process. The process completes it will create a new image and write it to the docker repo on the current computer.
On the development computer,
$ docker tag -t sceccode/bbp_19_4:MMDDHHMM
$docker push sceccode/bbp_19_4:MMDDHHMM
The Docker run command requires a parameter to increase the stack size. This is now included in the run_bbp.sh. Two keys were: correct abbreaivation for "stack size". Also, using size=-1 (which is equivalent to unlimited), since the command line doesn't accept the "unlimited" as text. Once the image starts, you can confirm the updated limits with: $ulimit -a