-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c4c8e2d
commit 78491dc
Showing
7 changed files
with
50 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,43 @@ | ||
FROM ubuntu:20.04 as base | ||
FROM continuumio/miniconda3 as build | ||
|
||
MAINTAINER Jared Lewis <jared.lewis@climate-resource.com> | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
ENV TZ=Etc/UTC | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y sudo curl build-essential gfortran m4 csh git jq wget aria2 imagemagick libmpich-dev file libnetcdff-dev && \ | ||
apt-get install -y curl m4 csh jq file && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
FROM base as build | ||
COPY environment.yml /opt/environment.yml | ||
RUN conda env create -f /opt/environment.yml | ||
|
||
ARG TARGETPLATFORM | ||
ARG WRF_VERSION=4.5.1 | ||
ARG WPS_VERSION=4.5 | ||
# Install conda-pack: | ||
RUN conda install -c conda-forge conda-pack | ||
|
||
# Use conda-pack to create a standalone enviornment | ||
# in /venv: | ||
RUN conda-pack -n wrf -o /tmp/env.tar && \ | ||
mkdir /opt/venv && cd /opt/venv && tar xf /tmp/env.tar && \ | ||
rm /tmp/env.tar | ||
|
||
# We've put venv in same path it'll be in final image, | ||
# so now fix up paths: | ||
RUN /opt/venv/bin/conda-unpack | ||
|
||
COPY scripts /opt/wrf/build/scripts/ | ||
RUN PLATFORM=${TARGETPLATFORM} WRF_VERSION=${WRF_VERSION} WPS_VERSION=${WPS_VERSION} bash /opt/wrf/build/scripts/build_wrf.sh | ||
|
||
|
||
FROM debian:bookworm AS runtime | ||
|
||
ARG TARGETPLATFORM | ||
ARG WRF_VERSION=4.5.1 | ||
ARG WPS_VERSION=4.5 | ||
|
||
WORKDIR /opt/wrf | ||
COPY --from=build /opt/venv /opt/venv | ||
COPY --from=build /opt/wrf /opt/wrf | ||
|
||
RUN PLATFORM=${TARGETPLATFORM} bash /opt/wrf/build/scripts/install_deps.sh | ||
RUN PLATFORM=${TARGETPLATFORM} WRF_VERSION=${WRF_VERSION} WPS_VERSION=${WPS_VERSION} bash /opt/wrf/build/scripts/build_wrf.sh | ||
|
||
ENTRYPOINT ["/bin/bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: wrf | ||
channels: | ||
- conda-forge | ||
- defaults | ||
dependencies: | ||
- hdf5=1.14.3 | ||
- jasper=4.2.4 | ||
- mpich=4.2.1 | ||
- netcdf-fortran=4.6.1 | ||
- wget | ||
- gfortran=10.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.