Skip to content

Commit

Permalink
Final updates to Dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
Shawn P. Serbin committed Jun 14, 2023
1 parent c5870a9 commit bcbccfe
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 51 deletions.
15 changes: 8 additions & 7 deletions arm64_docker_builds.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,21 @@ docker buildx create --name multibuilder --use
# Step 2. Change to local simulation_containers git repo directory
cd /Users/sserbin/Data/GitHub/simulation_containers

# Step 3a. Build an ARM64 compliant version of the ELM docker. This is for local builds only
#docker buildx build --push -t fasstsimulation/elm-builds:elm_v2-for-ngee_arm64 --no-cache \
#--platform linux/arm64 -f docker/elm/elm_v2-for-ngee/Dockerfile_arm64 .

# Step 3b. Build multi-arch ELM
# Step 3a. Build multi-arch ELM
docker buildx build --push -t serbinsh/ngeearctic_elm_containers:elm_v2-for-ngee_multiarch --no-cache \
--platform linux/amd64,linux/arm64 -f docker/elm/elm_v2-for-ngee/Dockerfile_multiarch .

# Step 3c. Build AMD64 and ARM64 compliant version of the serial lib ELM docker. This is for local builds only
docker buildx build --push -t fasstsimulation/elm-builds:elm_v2-for-ngee-serial_multiarch --no-cache \
# Step 3b. Build AMD64 and ARM64 compliant version of the serial lib ELM docker. This is for local builds only
docker buildx build --push -t serbinsh/ngeearctic_elm_containers:elm_v2-for-ngee-serial_multiarch --no-cache \
--platform linux/amd64,linux/arm64 -f docker/elm/elm_v2-for-ngee/Dockerfile_serial_multiarch .








#### Build a multi-platform version of the jupyter-lab simulation_container
# Step 1. Create a new docker builder (only needs to be done once)
docker buildx create --name multibuilder --use
Expand Down
34 changes: 14 additions & 20 deletions docker/jupyter/Dockerfile_elmlab_3.3.2
Original file line number Diff line number Diff line change
Expand Up @@ -6,56 +6,50 @@
# ----------------------------------------------------------------------

# grab the jupyter-lab container
FROM fasstsimulation/fasst_simulation_tools:fasst_jupyterlab_3.3.2
FROM serbinsh/ngeearctic_elm_containers:ngeearctic_jupyterlab_3.3.2
LABEL maintainer.name="Shawn P. Serbin" \
maintainer.email="[email protected]" \
author.name="Shawn P. Serbin" \
author.email="[email protected]" \
description="ELM Analysis Jupyter-Lab Container"

ENV TOOLS_REPOSITORY_RAW_URL=https://raw.githubusercontent.com/FASSt-simulation/fasst_simulation_tools
ENV REPOSITORY_RAW_URL=https://raw.githubusercontent.com/TESTgroup-BNL/ngeearctic_elm_containers

# Copy in example plotting scripts for use with model output
# add Ben Sulman's matplotlib plotting ascetics defaults
RUN cd "/home/${NB_USER}/scripts" \
&& wget $TOOLS_REPOSITORY_RAW_URL/main/elm_scripts/plotting/plot_KG64_ELM_output.py \
&& wget $REPOSITORY_RAW_URL/main/scripts/elm_scripts/plotting/plot_KG64_ELM_output.py \
&& chmod 775 plot_KG64_ELM_output.py \
&& wget $TOOLS_REPOSITORY_RAW_URL/main/elm_scripts/plotting/plot_ELM_output.py \
&& wget $REPOSITORY_RAW_URL/main/scripts/elm_scripts/plotting/plot_ELM_output.py \
&& chmod 775 plot_ELM_output.py \
&& cd "/home/${NB_USER}" \
&& mkdir -p "/home/${NB_USER}/.config/matplotlib" \
&& cd "/home/${NB_USER}/.config/matplotlib" \
&& wget $TOOLS_REPOSITORY_RAW_URL/main/elm_scripts/plotting/matplotlibrc \
&& wget $REPOSITORY_RAW_URL/main/scripts/elm_scripts/plotting/matplotlibrc \
&& cd "/home/${NB_USER}" \
&& fix-permissions "/home/${NB_USER}"

# Add example jupyter notebook scripts here
RUN cd "/home/${NB_USER}/scripts" \
&& wget $TOOLS_REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_ELM_variable.ipynb \
&& wget $REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_ELM_variable.ipynb \
&& chmod 775 plot_ELM_variable.ipynb \
&& wget $TOOLS_REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_ELM_variable_2D.ipynb \
&& wget $REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_ELM_variable_2D.ipynb \
&& chmod 775 plot_ELM_variable_2D.ipynb \
&& wget $TOOLS_REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_ELM_output.ipynb \
&& wget $REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_ELM_output.ipynb \
&& chmod 775 plot_ELM_output.ipynb \
&& wget $TOOLS_REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_ELM_radiation.ipynb \
&& wget $REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_ELM_radiation.ipynb \
&& chmod 775 plot_ELM_radiation.ipynb \
&& wget $TOOLS_REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_moisture_temperature.ipynb \
&& wget $REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_moisture_temperature.ipynb \
&& chmod 775 plot_moisture_temperature.ipynb \
&& wget $TOOLS_REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_soil_BGC.ipynb \
&& wget $REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_soil_BGC.ipynb \
&& chmod 775 plot_soil_BGC.ipynb \
&& wget $TOOLS_REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_veg_data.ipynb \
&& wget $REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_veg_data.ipynb \
&& chmod 775 plot_veg_data.ipynb \
&& wget $TOOLS_REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_ELM_ensembles.ipynb \
&& wget $REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_ELM_ensembles.ipynb \
&& chmod 775 plot_ELM_ensembles.ipynb \
&& wget $TOOLS_REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_ELM_compare_cases.ipynb \
&& wget $REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_ELM_compare_cases.ipynb \
&& chmod 775 plot_ELM_compare_cases.ipynb

# add back in if we want examples showing how to run the model from within a notebook
# && wget $TOOLS_REPOSITORY_RAW_URL/main/notebooks/ngeearctic/run_ELM_KG64_basic.ipynb \
# && chmod 775 run_ELM_KG64_basic.ipynb \
# && wget $TOOLS_REPOSITORY_RAW_URL/main/notebooks/ngeearctic/run_plot_KG64_ELM_output.ipynb \
# && chmod 775 run_plot_KG64_ELM_output.ipynb

# Setup default user, when enter docker container
USER ${NB_UID}
WORKDIR "${HOME}"
Expand Down
36 changes: 15 additions & 21 deletions docker/jupyter/Dockerfile_elmlab_gee_3.3.2
Original file line number Diff line number Diff line change
Expand Up @@ -6,59 +6,53 @@
# ----------------------------------------------------------------------

# grab the jupyter-lab container
FROM fasstsimulation/fasst_simulation_tools:fasst_jupyterlab_3.3.2_gee
FROM serbinsh/ngeearctic_elm_containers:ngeearctic_jupyterlab_3.3.2_gee
LABEL maintainer.name="Shawn P. Serbin" \
maintainer.email="[email protected]" \
author.name="Shawn P. Serbin" \
author.email="[email protected]" \
description="ELM Analysis Jupyter-Lab Container"

ENV TOOLS_REPOSITORY_RAW_URL=https://raw.githubusercontent.com/FASSt-simulation/fasst_simulation_tools
ENV REPOSITORY_RAW_URL=https://raw.githubusercontent.com/TESTgroup-BNL/ngeearctic_elm_containers

# Copy in example plotting scripts for use with model output
# add Ben Sulman's matplotlib plotting ascetics defaults
RUN cd "/home/${NB_USER}/scripts" \
&& wget $TOOLS_REPOSITORY_RAW_URL/main/elm_scripts/plotting/plot_KG64_ELM_output.py \
&& wget $REPOSITORY_RAW_URL/main/scripts/elm_scripts/plotting/plot_KG64_ELM_output.py \
&& chmod 775 plot_KG64_ELM_output.py \
&& wget $TOOLS_REPOSITORY_RAW_URL/main/elm_scripts/plotting/plot_ELM_output.py \
&& wget $REPOSITORY_RAW_URL/main/scripts/elm_scripts/plotting/plot_ELM_output.py \
&& chmod 775 plot_ELM_output.py \
&& cd "/home/${NB_USER}" \
&& mkdir -p "/home/${NB_USER}/.config/matplotlib" \
&& cd "/home/${NB_USER}/.config/matplotlib" \
&& wget $TOOLS_REPOSITORY_RAW_URL/main/elm_scripts/plotting/matplotlibrc \
&& wget $REPOSITORY_RAW_URL/main/scripts/elm_scripts/plotting/matplotlibrc \
&& cd "/home/${NB_USER}" \
&& fix-permissions "/home/${NB_USER}"

# Add example jupyter notebook scripts here
RUN cd "/home/${NB_USER}/scripts" \
&& wget $TOOLS_REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_ELM_variable.ipynb \
&& wget $REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_ELM_variable.ipynb \
&& chmod 775 plot_ELM_variable.ipynb \
&& wget $TOOLS_REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_ELM_variable_2D.ipynb \
&& wget $REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_ELM_variable_2D.ipynb \
&& chmod 775 plot_ELM_variable_2D.ipynb \
&& wget $TOOLS_REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_ELM_output.ipynb \
&& wget $REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_ELM_output.ipynb \
&& chmod 775 plot_ELM_output.ipynb \
&& wget $TOOLS_REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_ELM_radiation.ipynb \
&& wget $REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_ELM_radiation.ipynb \
&& chmod 775 plot_ELM_radiation.ipynb \
&& wget $TOOLS_REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_moisture_temperature.ipynb \
&& wget $REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_moisture_temperature.ipynb \
&& chmod 775 plot_moisture_temperature.ipynb \
&& wget $TOOLS_REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_soil_BGC.ipynb \
&& wget $REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_soil_BGC.ipynb \
&& chmod 775 plot_soil_BGC.ipynb \
&& wget $TOOLS_REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_veg_data.ipynb \
&& wget $REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_veg_data.ipynb \
&& chmod 775 plot_veg_data.ipynb \
&& wget $TOOLS_REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_ELM_ensembles.ipynb \
&& wget $REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_ELM_ensembles.ipynb \
&& chmod 775 plot_ELM_ensembles.ipynb \
&& wget $TOOLS_REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_ELM_compare_cases.ipynb \
&& wget $REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_ELM_compare_cases.ipynb \
&& chmod 775 plot_ELM_compare_cases.ipynb \
# GEE notebooks
&& wget $TOOLS_REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_ELM_vs_GEE_data.ipynb \
&& wget $REPOSITORY_RAW_URL/main/notebooks/ngeearctic/plot_ELM_vs_GEE_data.ipynb \
&& chmod 775 plot_ELM_vs_GEE_data.ipynb

# add back in if we want examples showing how to run the model from within a notebook
# && wget $TOOLS_REPOSITORY_RAW_URL/main/notebooks/ngeearctic/run_ELM_KG64_basic.ipynb \
# && chmod 775 run_ELM_KG64_basic.ipynb \
# && wget $TOOLS_REPOSITORY_RAW_URL/main/notebooks/ngeearctic/run_plot_KG64_ELM_output.ipynb \
# && chmod 775 run_plot_KG64_ELM_output.ipynb

# Setup default user, when enter docker container
USER ${NB_UID}
WORKDIR "${HOME}"
Expand Down
14 changes: 11 additions & 3 deletions docker/jupyter/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,18 @@

Building dual-platform jupyter-lab containers for analyzing ELM output

# 1. First build the main jupyter-lab container, e.g. Jupyter-Lab 3.3.2. Run this within the repo directory
# 1a. First build the main jupyter-lab container, e.g. Jupyter-Lab 3.3.2. Run this within the repo directory
docker buildx build --push -t serbinsh/ngeearctic_elm_containers:ngeearctic_jupyterlab_3.3.2 --no-cache \
--platform linux/amd64,linux/arm64 -f docker/jupyter/Dockerfile_lab_3.3.2 .

# 2. Second build the elmlab container which includes all of the example notebooks. Run this within the repo directorys
# 1b. First build the main jupyter-lab container w/ GEE, e.g. Jupyter-Lab 3.3.2. Run this within the repo directory
docker buildx build --push -t serbinsh/ngeearctic_elm_containers:ngeearctic_jupyterlab_3.3.2_gee --no-cache \
--platform linux/amd64,linux/arm64 -f docker/jupyter/Dockerfile_lab_gee_3.3.2 .

# 2a. Second build the elmlab container which includes all of the example notebooks. Run this within the repo directorys
docker buildx build --push -t serbinsh/ngeearctic_elm_containers:elmlab_3.3.2 --no-cache \
--platform linux/amd64,linux/arm64 -f docker/jupyter/Dockerfile_elmlab_3.3.2 .
--platform linux/amd64,linux/arm64 -f docker/jupyter/Dockerfile_elmlab_3.3.2 .

# 2b. Second build the elmlab container w/ GEE which includes all of the example notebooks. Run this within the repo directorys
docker buildx build --push -t serbinsh/ngeearctic_elm_containers:elmlab_gee_3.3.2 --no-cache \
--platform linux/amd64,linux/arm64 -f docker/jupyter/Dockerfile_elmlab_gee_3.3.2 .

0 comments on commit bcbccfe

Please sign in to comment.