Skip to content
Snippets Groups Projects
Commit ad7b18a7 authored by Clayton, Brandon Scott's avatar Clayton, Brandon Scott
Browse files

update docker docs

parent 61bdf12b
No related branches found
No related tags found
1 merge request!791Docker readme
# Using [Docker](https://docs.docker.com/install/)
*nshmp-haz* is available as a public image from
[Docker hub](https://hub.docker.com/r/usgs/nshmp-haz) with tags:
*nshmp-haz* is available as a public image from the
[GitLab registry](https://code.usgs.gov/ghsc/nshmp/nshmp-haz/container_registry/69) with tags:
* `latest`: Refers to the latest updates from the main or production branch
* `development-latest`: Refers to forks of the repository.
* `staging-latest`: Latest updates associated with the
* `latest`,`staging-latest`: Latest updates associated with the
[main](https://code.usgs.gov/ghsc/nshmp/nshmp-haz/-/tree/main) branch
* `production-latest`: Latest stable release associated with the
[production](https://code.usgs.gov/ghsc/nshmp/nshmp-haz/-/tree/production) branch
* `production-latest`: Latest stable release associated with a
[tag](https://code.usgs.gov/ghsc/nshmp/nshmp-haz/-/tags)
To ensure you have the latest *nshmp-haz* update associated with a specific tag,
always first pull the image from Docker:
```bash
docker pull usgs/nshmp-haz:<tag>
docker pull code.usgs.gov:5001/ghsc/nshmp/nshmp-haz/nshmp-haz:<tag>
```
> Replace `<tag>` with one of the above tags.
......@@ -22,7 +20,7 @@ docker pull usgs/nshmp-haz:<tag>
Example:
```bash
docker pull usgs/nshmp-haz:production-latest
docker pull code.usgs.gov:5001/ghsc/nshmp/nshmp-haz/nshmp-haz:latest
```
## Docker Memory on Mac
......@@ -35,7 +33,7 @@ to a minimum of 4 GB.
```bash
# Pull docker image
docker pull usgs/nshmp-haz:latest
docker pull code.usgs.gov:5001/ghsc/nshmp/nshmp-haz/nshmp-haz:latest
# Run docker image
docker run \
......@@ -45,7 +43,7 @@ docker run \
--volume /absolute/path/to/sites/file:/app/sites.<geojson | csv> \
--volume /absolute/path/to/config/file:/app/config.json \
--volume /absolute/path/to/output:/app/output \
usgs/nshmp-haz
code.usgs.gov:5001/ghsc/nshmp/nshmp-haz/nshmp-haz
```
Where:
......@@ -78,7 +76,7 @@ assumption a GeoJSON [site](./Site-Specification.md) file exists named `sites.ge
git clone https://code.usgs.gov/ghsc/nshmp/nshms/nshm-hawaii.git
# Pull image
docker pull usgs/nshmp-haz:latest
docker pull code.usgs.gov:5001/ghsc/nshmp/nshmp-haz/nshmp-haz:latest
# Run nshmp-haz HazardCalc
docker run \
......@@ -86,7 +84,7 @@ docker run \
--volume "$(pwd)/nshm-hawaii:/app/model" \
--volume "$(pwd)/sites.geojson:/app/sites.geojson" \
--volume "$(pwd)/hawaii-hazard-output:/app/output" \
usgs/nshmp-haz
code.usgs.gov:5001/ghsc/nshmp/nshmp-haz/nshmp-haz
```
### [`DisaggCalc`](../../src/main/java/gov/usgs/earthquake/nshmp/DisaggCalc.java) Example
......@@ -100,7 +98,7 @@ assumption a GeoJSON [site](./Site-Specification.md) file exists named `sites.ge
git clone https://code.usgs.gov/ghsc/nshmp/nshms/nshm-hawaii.git
# Pull image
docker pull usgs/nshmp-haz:latest
docker pull code.usgs.gov:5001/ghsc/nshmp/nshmp-haz/nshmp-haz:latest
# Run nshmp-haz DisaggCalc
docker run \
......@@ -109,7 +107,7 @@ docker run \
--volume "$(pwd)/nshm-hawaii:/app/model" \
--volume "$(pwd)/sites.geojson:/app/sites.geojson" \
--volume "$(pwd)/hawaii-disagg-output:/app/output" \
usgs/nshmp-haz:latest
code.usgs.gov:5001/ghsc/nshmp/nshmp-haz/nshmp-haz
```
### [`RateCalc`](../../src/main/java/gov/usgs/earthquake/nshmp/RateCalc.java) Example
......@@ -123,7 +121,7 @@ assumption a GeoJSON [site](./Site-Specification.md) file exists named `sites.ge
git clone https://code.usgs.gov/ghsc/nshmp/nshms/nshm-hawaii.git
# Pull image
docker pull usgs/nshmp-haz:latest
docker pull code.usgs.gov:5001/ghsc/nshmp/nshmp-haz/nshmp-haz:latest
# Run nshmp-haz RateCalc
docker run \
......@@ -131,7 +129,7 @@ docker run \
--volume "$(pwd)/nshm-hawaii:/app/model" \
--volume "$(pwd)/sites.geojson:/app/sites.geojson" \
--volume "$(pwd)/hawaii-rate-output:/app/output" \
usgs/nshmp-haz
code.usgs.gov:5001/ghsc/nshmp/nshmp-haz/nshmp-haz:latest
```
## Run Customization
......@@ -143,13 +141,13 @@ be set with the environment flag (-e, -env):
docker run \
--env JAVA_MEMORY=<MEMORY> \
...
usgs/nshmp-haz
code.usgs.gov:5001/ghsc/nshmp/nshmp-haz/nshmp-haz
# Example
docker run \
--env JAVA_MEMORY="12g" \
...
usgs/nshmp-haz
code.usgs.gov:5001/ghsc/nshmp/nshmp-haz/nshmp-haz
```
Where:
......@@ -195,23 +193,20 @@ Open browser to [http://localhost:8080/](http://localhost:8080/).
### Run from Container Registry
A public Docker image is avaialable from [Docker hub](https://hub.docker.com/r/usgs/nshmp-haz-ws).
A public Docker image is avaialable from the
[Gitlab registry](https://code.usgs.gov/ghsc/nshmp/nshmp-haz/container_registry/68) with tags:
There are 4 main tags:
* `latest`: Refers to the latest updates from the main or production branch
* `development-latest`: Refers to forks of the repository.
* `staging-latest`: Refers to the
* `latest`,`staging-latest`: Refers to the
[main](https://code.usgs.gov/ghsc/nshmp/nshmp-haz/-/tree/main) branch and is the latest updates
* `production-latest`: Refers to the
[production](https://code.usgs.gov/ghsc/nshmp/nshmp-haz/-/tree/production) branch and is stable
* `production-latest`: Refers to the latest
[tag](https://code.usgs.gov/ghsc/nshmp/nshmp-haz/-/tags) and is stable
```bash
# Pull image
docker pull usgs/nshmp-haz-ws:latest
docker pull code.usgs.gov:5001/ghsc/nshmp/nshmp-haz/nshmp-haz-ws:latest
# Run
docker run -p 8080:8080 -v "/path/to/model:/model" usgs/nshmp-haz-ws
docker run -p 8080:8080 -v "/path/to/model:/model" code.usgs.gov:5001/ghsc/nshmp/nshmp-haz/nshmp-haz-ws
```
Web service runs on [http://localhost:8080/](http://localhost:8080/)
......@@ -222,14 +217,14 @@ The hazard model is read in via Docker volumes.
```bash
# Pull image
docker pull usgs/nshmp-haz-ws:latest
docker pull code.usgs.gov:5001/ghsc/nshmp/nshmp-haz/nshmp-haz-ws:latest
# Download NSHM CONUS
cd ..
git clone https://code.usgs.gov/ghsc/nshmp/nshms/nshm-conus
# Run web services
docker run -p 8080:8080 -v "$(pwd):/model" usgs/nshmp-haz-ws
docker run -p 8080:8080 -v "$(pwd):/model" code.usgs.gov:5001/ghsc/nshmp/nshmp-haz/nshmp-haz-ws
```
Open browser to [http://localhost:8080/](http://localhost:8080/).
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment