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

update to new images

parent 2a197dda
No related branches found
No related tags found
2 merge requests!743Production Release | nshmp-haz,!741Docker Images
......@@ -14,13 +14,13 @@
# - RETURN_PERIOD: The return period, used in certian programs
#
# Volumes:
# - Model: /app/model
# - Output: /app/output
# - Model: /model
# - Output: /output
#
# docker run \
# --env CLASS_NAME="nshmp-haz class name" \
# --volume "/path/to/model:/app/model" \
# --volume "/path/to/output:/app/output" \
# --volume "/path/to/model:/model" \
# --volume "/path/to/output:/output" \
# usgs/nshmp-haz:production-latest
#
# Build locally:
......@@ -39,8 +39,6 @@ FROM ${BUILD_IMAGE} as builder
ARG CI_PROJECT_URL=null
ARG CI_COMMIT_BRANCH=null
WORKDIR /app
COPY . .
RUN ./gradlew assemble
......@@ -57,19 +55,17 @@ ENV CLASS_NAME "HazardCalc"
ENV IML ""
ENV RETURN_PERIOD ""
ENV CONFIG_FILE "/app/config.json"
ENV CONFIG_FILE "/config.json"
ENV JAVA_MEMORY "8g"
ENV MODEL_PATH "/app/model"
ENV OUTPUT_PATH "/app/output"
ENV MODEL_PATH "/model"
ENV OUTPUT_PATH "/output"
VOLUME [ "${MODEL_PATH}", "${OUTPUT_PATH}" ]
WORKDIR /app
COPY --from=builder /app/build/libs/nshmp-haz.jar .
COPY --from=builder build/libs/nshmp-haz.jar .
COPY scripts scripts
RUN apit-get install -y jq \
RUN apt-get install -y jq \
&& echo "{}" > "${CONFIG_FILE}"
ENTRYPOINT [ "bash", "scripts/docker-entrypoint.sh" ]
......@@ -42,9 +42,9 @@ docker run \
--env CLASS_NAME=<DisaggCalc | HazardCalc | RateCalc> \
--env IML=<NUMBER> \
--env RETURN_PERIOD=<NUMBER> \
--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 \
--volume /absolute/path/to/sites/file:/sites.<geojson | csv> \
--volume /absolute/path/to/config/file:/config.json \
--volume /absolute/path/to/output:/output \
usgs/nshmp-haz
```
......@@ -54,16 +54,16 @@ Where:
* [DisaggCalc](../../src/main/java/gov/usgs/earthquake/nshmp/DisaggCalc.java)
* [HazardCalc](../../src/main/java/gov/usgs/earthquake/nshmp/HazardCalc.java)
* [RateCalc](../../src/main/java/gov/usgs/earthquake/nshmp/RateCalc.java)
* Other arguments (local files mapped to files within the Docker container with `:/app/...`):
* Other arguments (local files mapped to files within the Docker container):
* (required) The absolute path to a [USGS model (NSHM)](./USGS-Models.md)
* Example: `$(pwd)/nshm-hawaii:/app/model`
* Example: `$(pwd)/nshm-hawaii:/model`
* (required) The absolute path to a GeoJSON or CSV [site(s)](./Site-Specification.md) file
* CSV example: `$(pwd)/my-csv-sites.csv:/app/sites.csv`
* GeoJSON example: `$(pwd)/my-geojson-sites.geojson:/app/sites.geojson`
* CSV example: `$(pwd)/my-csv-sites.csv:/sites.csv`
* GeoJSON example: `$(pwd)/my-geojson-sites.geojson:/sites.geojson`
* (required) The absolute path to an output directory
* Example: `$(pwd)/my-hazard-output:/app/output`
* Example: `$(pwd)/my-hazard-output:/output`
* (optional) The absolute path to a [configuration](./Calculation-Configuration.md) file
* Example: `$(pwd)/my-custom-config.json:/app/config.json`
* Example: `$(pwd)/my-custom-config.json:/config.json`
## Examples
......@@ -83,9 +83,9 @@ docker pull usgs/nshmp-haz:latest
# Run nshmp-haz HazardCalc
docker run \
--env CLASS_NAME="HazardCalc" \
--volume "$(pwd)/nshm-hawaii:/app/model" \
--volume "$(pwd)/nshm-hawaii:/model" \
--volume "$(pwd)/sites.geojson" \
--volume "$(pwd)/hawaii-hazard-output:/app/output" \
--volume "$(pwd)/hawaii-hazard-output:/output" \
usgs/nshmp-haz
```
......@@ -106,9 +106,9 @@ docker pull usgs/nshmp-haz:latest
docker run \
--env CLASS_NAME="DisaggCalc" \
--env RETURN_PERIOD=475 \
--volume "$(pwd)/nshm-hawaii:/app/model" \
--volume "$(pwd)/nshm-hawaii:/model" \
--volume "$(pwd)/sites.geojson" \
--volume "$(pwd)/hawaii-disagg-output:/app/output" \
--volume "$(pwd)/hawaii-disagg-output:/output" \
usgs/nshmp-haz:latest
```
......@@ -128,9 +128,9 @@ docker pull usgs/nshmp-haz:latest
# Run nshmp-haz RateCalc
docker run \
--env CLASS_NAME="RateCalc" \
--volume "$(pwd)/nshm-hawaii:/app/model" \
--volume "$(pwd)/nshm-hawaii:/model" \
--volume "$(pwd)/sites.geojson" \
--volume "$(pwd)/hawaii-rate-output:/app/output" \
--volume "$(pwd)/hawaii-rate-output:/output" \
usgs/nshmp-haz
```
......
......@@ -5,11 +5,11 @@
##
main() {
# Get name of sites file
sites_file=$(ls /app/sites.*);
sites_file=$(ls /sites.*);
# Run nshmp-haz
java "-Xmx${JAVA_MEMORY}" \
-cp "/app/nshmp-haz.jar" \
-cp "/nshmp-haz.jar" \
"gov.usgs.earthquake.nshmp.${CLASS_NAME}" \
"${MODEL_PATH}" \
"${sites_file}" \
......
......@@ -13,7 +13,7 @@
#
# Run locally:
# docker run -p 8080:8080
# -v "path/to/models:/models"
# -v "path/to/model:/model"
# nshmp-haz-ws
####
......@@ -31,8 +31,6 @@ ARG builder_workdir
ARG CI_PROJECT_URL=null
ARG CI_COMMIT_BRANCH=null
WORKDIR /app
COPY . .
RUN ./gradlew assemble
......@@ -48,10 +46,8 @@ ENV CONTEXT_PATH="/"
ENV JAVA_OPTS="-Xms2g -Xmx8g"
ENV MODELS_DIRECTORY="/model"
WORKDIR /app
COPY --from=builder /app/build/libs/nshmp-haz.jar .
COPY --from=builder /app/nshms.yml .
COPY --from=builder build/libs/nshmp-haz.jar .
COPY --from=builder nshms.yml .
VOLUME [ "${MODELS_DIRECTORY}" ]
......
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