Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nshmp-haz
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ghsc
National Seismic Hazard Model Project
nshmp-haz
Commits
c640fa9c
Commit
c640fa9c
authored
1 year ago
by
Clayton, Brandon Scott
Browse files
Options
Downloads
Patches
Plain Diff
update to new images
parent
2a197dda
No related branches found
No related tags found
2 merge requests
!743
Production Release | nshmp-haz
,
!741
Docker Images
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Dockerfile
+9
-13
9 additions, 13 deletions
Dockerfile
docs/pages/Using-Docker.md
+15
-15
15 additions, 15 deletions
docs/pages/Using-Docker.md
scripts/docker-entrypoint.sh
+2
-2
2 additions, 2 deletions
scripts/docker-entrypoint.sh
ws.Dockerfile
+3
-7
3 additions, 7 deletions
ws.Dockerfile
with
29 additions
and
37 deletions
Dockerfile
+
9
−
13
View file @
c640fa9c
...
@@ -14,13 +14,13 @@
...
@@ -14,13 +14,13 @@
# - RETURN_PERIOD: The return period, used in certian programs
# - RETURN_PERIOD: The return period, used in certian programs
#
#
# Volumes:
# Volumes:
# - Model:
/app
/model
# - Model: /model
# - Output:
/app
/output
# - Output: /output
#
#
# docker run \
# docker run \
# --env CLASS_NAME="nshmp-haz class name" \
# --env CLASS_NAME="nshmp-haz class name" \
# --volume "/path/to/model:/
app/
model" \
# --volume "/path/to/model:/model" \
# --volume "/path/to/output:/
app/
output" \
# --volume "/path/to/output:/output" \
# usgs/nshmp-haz:production-latest
# usgs/nshmp-haz:production-latest
#
#
# Build locally:
# Build locally:
...
@@ -39,8 +39,6 @@ FROM ${BUILD_IMAGE} as builder
...
@@ -39,8 +39,6 @@ FROM ${BUILD_IMAGE} as builder
ARG
CI_PROJECT_URL=null
ARG
CI_PROJECT_URL=null
ARG
CI_COMMIT_BRANCH=null
ARG
CI_COMMIT_BRANCH=null
WORKDIR
/app
COPY
. .
COPY
. .
RUN
./gradlew assemble
RUN
./gradlew assemble
...
@@ -57,19 +55,17 @@ ENV CLASS_NAME "HazardCalc"
...
@@ -57,19 +55,17 @@ ENV CLASS_NAME "HazardCalc"
ENV
IML ""
ENV
IML ""
ENV
RETURN_PERIOD ""
ENV
RETURN_PERIOD ""
ENV
CONFIG_FILE "/
app/
config.json"
ENV
CONFIG_FILE "/config.json"
ENV
JAVA_MEMORY "8g"
ENV
JAVA_MEMORY "8g"
ENV
MODEL_PATH "/
app/
model"
ENV
MODEL_PATH "/model"
ENV
OUTPUT_PATH "/
app/
output"
ENV
OUTPUT_PATH "/output"
VOLUME
[ "${MODEL_PATH}", "${OUTPUT_PATH}" ]
VOLUME
[ "${MODEL_PATH}", "${OUTPUT_PATH}" ]
WORKDIR
/app
COPY
--from=builder build/libs/nshmp-haz.jar .
COPY
--from=builder /app/build/libs/nshmp-haz.jar .
COPY
scripts scripts
COPY
scripts scripts
RUN
ap
i
t-get
install
-y
jq
\
RUN
apt-get
install
-y
jq
\
&&
echo
"{}"
>
"
${
CONFIG_FILE
}
"
&&
echo
"{}"
>
"
${
CONFIG_FILE
}
"
ENTRYPOINT
[ "bash", "scripts/docker-entrypoint.sh" ]
ENTRYPOINT
[ "bash", "scripts/docker-entrypoint.sh" ]
This diff is collapsed.
Click to expand it.
docs/pages/Using-Docker.md
+
15
−
15
View file @
c640fa9c
...
@@ -42,9 +42,9 @@ docker run \
...
@@ -42,9 +42,9 @@ docker run \
--env
CLASS_NAME
=
<DisaggCalc | HazardCalc | RateCalc>
\
--env
CLASS_NAME
=
<DisaggCalc | HazardCalc | RateCalc>
\
--env
IML
=
<NUMBER>
\
--env
IML
=
<NUMBER>
\
--env
RETURN_PERIOD
=
<NUMBER>
\
--env
RETURN_PERIOD
=
<NUMBER>
\
--volume
/absolute/path/to/sites/file:/
app/
sites.<geojson | csv>
\
--volume
/absolute/path/to/sites/file:/sites.<geojson | csv>
\
--volume
/absolute/path/to/config/file:/
app/
config.json
\
--volume
/absolute/path/to/config/file:/config.json
\
--volume
/absolute/path/to/output:/
app/
output
\
--volume
/absolute/path/to/output:/output
\
usgs/nshmp-haz
usgs/nshmp-haz
```
```
...
@@ -54,16 +54,16 @@ Where:
...
@@ -54,16 +54,16 @@ Where:
*
[
DisaggCalc
](
../../src/main/java/gov/usgs/earthquake/nshmp/DisaggCalc.java
)
*
[
DisaggCalc
](
../../src/main/java/gov/usgs/earthquake/nshmp/DisaggCalc.java
)
*
[
HazardCalc
](
../../src/main/java/gov/usgs/earthquake/nshmp/HazardCalc.java
)
*
[
HazardCalc
](
../../src/main/java/gov/usgs/earthquake/nshmp/HazardCalc.java
)
*
[
RateCalc
](
../../src/main/java/gov/usgs/earthquake/nshmp/RateCalc.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
)
*
(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
*
(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`
*
CSV example:
`$(pwd)/my-csv-sites.csv:/sites.csv`
*
GeoJSON example:
`$(pwd)/my-geojson-sites.geojson:/
app/
sites.geojson`
*
GeoJSON example:
`$(pwd)/my-geojson-sites.geojson:/sites.geojson`
*
(required) The absolute path to an output directory
*
(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
*
(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
## Examples
...
@@ -83,9 +83,9 @@ docker pull usgs/nshmp-haz:latest
...
@@ -83,9 +83,9 @@ docker pull usgs/nshmp-haz:latest
# Run nshmp-haz HazardCalc
# Run nshmp-haz HazardCalc
docker run
\
docker run
\
--env
CLASS_NAME
=
"HazardCalc"
\
--env
CLASS_NAME
=
"HazardCalc"
\
--volume
"
$(
pwd
)
/nshm-hawaii:/
app/
model"
\
--volume
"
$(
pwd
)
/nshm-hawaii:/model"
\
--volume
"
$(
pwd
)
/sites.geojson"
\
--volume
"
$(
pwd
)
/sites.geojson"
\
--volume
"
$(
pwd
)
/hawaii-hazard-output:/
app/
output"
\
--volume
"
$(
pwd
)
/hawaii-hazard-output:/output"
\
usgs/nshmp-haz
usgs/nshmp-haz
```
```
...
@@ -106,9 +106,9 @@ docker pull usgs/nshmp-haz:latest
...
@@ -106,9 +106,9 @@ docker pull usgs/nshmp-haz:latest
docker run
\
docker run
\
--env
CLASS_NAME
=
"DisaggCalc"
\
--env
CLASS_NAME
=
"DisaggCalc"
\
--env
RETURN_PERIOD
=
475
\
--env
RETURN_PERIOD
=
475
\
--volume
"
$(
pwd
)
/nshm-hawaii:/
app/
model"
\
--volume
"
$(
pwd
)
/nshm-hawaii:/model"
\
--volume
"
$(
pwd
)
/sites.geojson"
\
--volume
"
$(
pwd
)
/sites.geojson"
\
--volume
"
$(
pwd
)
/hawaii-disagg-output:/
app/
output"
\
--volume
"
$(
pwd
)
/hawaii-disagg-output:/output"
\
usgs/nshmp-haz:latest
usgs/nshmp-haz:latest
```
```
...
@@ -128,9 +128,9 @@ docker pull usgs/nshmp-haz:latest
...
@@ -128,9 +128,9 @@ docker pull usgs/nshmp-haz:latest
# Run nshmp-haz RateCalc
# Run nshmp-haz RateCalc
docker run
\
docker run
\
--env
CLASS_NAME
=
"RateCalc"
\
--env
CLASS_NAME
=
"RateCalc"
\
--volume
"
$(
pwd
)
/nshm-hawaii:/
app/
model"
\
--volume
"
$(
pwd
)
/nshm-hawaii:/model"
\
--volume
"
$(
pwd
)
/sites.geojson"
\
--volume
"
$(
pwd
)
/sites.geojson"
\
--volume
"
$(
pwd
)
/hawaii-rate-output:/
app/
output"
\
--volume
"
$(
pwd
)
/hawaii-rate-output:/output"
\
usgs/nshmp-haz
usgs/nshmp-haz
```
```
...
...
This diff is collapsed.
Click to expand it.
scripts/docker-entrypoint.sh
+
2
−
2
View file @
c640fa9c
...
@@ -5,11 +5,11 @@
...
@@ -5,11 +5,11 @@
##
##
main
()
{
main
()
{
# Get name of sites file
# Get name of sites file
sites_file
=
$(
ls
/app
/sites.
*
)
;
sites_file
=
$(
ls
/sites.
*
)
;
# Run nshmp-haz
# Run nshmp-haz
java
"-Xmx
${
JAVA_MEMORY
}
"
\
java
"-Xmx
${
JAVA_MEMORY
}
"
\
-cp
"/
app/
nshmp-haz.jar"
\
-cp
"/nshmp-haz.jar"
\
"gov.usgs.earthquake.nshmp.
${
CLASS_NAME
}
"
\
"gov.usgs.earthquake.nshmp.
${
CLASS_NAME
}
"
\
"
${
MODEL_PATH
}
"
\
"
${
MODEL_PATH
}
"
\
"
${
sites_file
}
"
\
"
${
sites_file
}
"
\
...
...
This diff is collapsed.
Click to expand it.
ws.Dockerfile
+
3
−
7
View file @
c640fa9c
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
#
#
# Run locally:
# Run locally:
# docker run -p 8080:8080
# docker run -p 8080:8080
# -v "path/to/model
s
:/model
s
"
# -v "path/to/model:/model"
# nshmp-haz-ws
# nshmp-haz-ws
####
####
...
@@ -31,8 +31,6 @@ ARG builder_workdir
...
@@ -31,8 +31,6 @@ ARG builder_workdir
ARG
CI_PROJECT_URL=null
ARG
CI_PROJECT_URL=null
ARG
CI_COMMIT_BRANCH=null
ARG
CI_COMMIT_BRANCH=null
WORKDIR
/app
COPY
. .
COPY
. .
RUN
./gradlew assemble
RUN
./gradlew assemble
...
@@ -48,10 +46,8 @@ ENV CONTEXT_PATH="/"
...
@@ -48,10 +46,8 @@ ENV CONTEXT_PATH="/"
ENV
JAVA_OPTS="-Xms2g -Xmx8g"
ENV
JAVA_OPTS="-Xms2g -Xmx8g"
ENV
MODELS_DIRECTORY="/model"
ENV
MODELS_DIRECTORY="/model"
WORKDIR
/app
COPY
--from=builder build/libs/nshmp-haz.jar .
COPY
--from=builder nshms.yml .
COPY
--from=builder /app/build/libs/nshmp-haz.jar .
COPY
--from=builder /app/nshms.yml .
VOLUME
[ "${MODELS_DIRECTORY}" ]
VOLUME
[ "${MODELS_DIRECTORY}" ]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment