Skip to content

Commit

Permalink
Feature #2005 updates to create v5.1 conda environments that use debi…
Browse files Browse the repository at this point in the history
…an10 and Python 3.10.4 (#2043)
  • Loading branch information
georgemccabe authored Feb 9, 2023
1 parent 200843b commit 07824ce
Show file tree
Hide file tree
Showing 25 changed files with 433 additions and 198 deletions.
19 changes: 13 additions & 6 deletions internal/scripts/docker_env/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
# Dockerfile to create conda environments used for use case tests

ARG BASE_ENV=metplus_base.v5
FROM dtcenter/metplus-envs:${BASE_ENV}
ARG METPLUS_ENV_VERSION
ARG BASE_ENV=metplus_base
FROM dtcenter/metplus-envs:${BASE_ENV}.${METPLUS_ENV_VERSION}

ENV PATH=$PATH:/usr/local/conda/bin

ARG ENV_NAME
WORKDIR /scripts
COPY scripts/${ENV_NAME}_env.sh .

ARG BASE_ENV=metplus_base.v5
RUN conda update -y -n base -c defaults conda \
&& ./${ENV_NAME}_env.sh ${BASE_ENV}
ARG METPLUS_ENV_VERSION
ARG ENV_NAME
RUN conda update -y -n base -c conda-forge conda \
&& ./${ENV_NAME}_env.sh ${METPLUS_ENV_VERSION}

RUN conda list --name ${ENV_NAME}.v5 > /usr/local/envs/${ENV_NAME}.v5/environments.yml
ARG METPLUS_ENV_VERSION
ARG ENV_NAME
RUN conda list --name ${ENV_NAME}.${METPLUS_ENV_VERSION} > \
/usr/local/conda/envs/${ENV_NAME}.${METPLUS_ENV_VERSION}/environments.yml
29 changes: 29 additions & 0 deletions internal/scripts/docker_env/Dockerfile.cartopy
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Dockerfile to create conda environments used for use case tests

ARG METPLUS_ENV_VERSION
ARG BASE_ENV=metplus_base
FROM dtcenter/metplus-envs:${BASE_ENV}.${METPLUS_ENV_VERSION}

ENV PATH=$PATH:/usr/local/conda/bin

ARG ENV_NAME
WORKDIR /scripts
COPY scripts/${ENV_NAME}_env.sh .

ARG ENV_NAME
ARG METPLUS_ENV_VERSION
RUN conda update -y -n base -c conda-forge conda \
&& ./${ENV_NAME}_env.sh ${METPLUS_ENV_VERSION}

ARG METPLUS_ENV_VERSION
ARG ENV_NAME
RUN conda list --name ${ENV_NAME}.${METPLUS_ENV_VERSION} > \
/usr/local/conda/envs/${ENV_NAME}.${METPLUS_ENV_VERSION}/environments.yml

ARG METPLUS_ENV_VERSION
ARG ENV_NAME
RUN apt update && apt -y upgrade \
&& apt install -y curl \
&& rm -f cartopy_feature_download.py \
&& curl https://raw.githubusercontent.com/SciTools/cartopy/master/tools/cartopy_feature_download.py > cartopy_feature_download.py \
&& /usr/local/conda/envs/${ENV_NAME}.${METPLUS_ENV_VERSION}/bin/python3 cartopy_feature_download.py cultural physical
9 changes: 9 additions & 0 deletions internal/scripts/docker_env/Dockerfile.conda
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Dockerfile to install conda

ARG DEBIAN_VERSION=10
FROM debian:${DEBIAN_VERSION}-slim

RUN apt update && apt install -y curl \
&& curl https://repo.anaconda.com/miniconda/Miniconda3-py310_22.11.1-1-Linux-x86_64.sh > /miniconda.sh \
&& bash /miniconda.sh -b -p /usr/local/conda \
&& /usr/local/conda/bin/conda update -y -n base -c conda-forge conda
8 changes: 5 additions & 3 deletions internal/scripts/docker_env/Dockerfile.gempak_env
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Dockerfile to create conda environments used for use case tests

ARG METPLUS_ENV_VERSION
ARG BASE_ENV=metplus_base
FROM dtcenter/metplus-envs:${BASE_ENV}
FROM dtcenter/metplus-envs:${BASE_ENV}.${METPLUS_ENV_VERSION}

ARG ENV_NAME
WORKDIR /scripts
COPY scripts/${ENV_NAME}_env.sh .

ARG BASE_ENV=metplus_base
RUN ./${ENV_NAME}_env.sh ${BASE_ENV}
ARG METPLUS_ENV_VERSION
ARG ENV_NAME
RUN ./${ENV_NAME}_env.sh ${METPLUS_ENV_VERSION}
70 changes: 61 additions & 9 deletions internal/scripts/docker_env/Dockerfile.gfdl-tracker
Original file line number Diff line number Diff line change
@@ -1,27 +1,80 @@
FROM dtcenter/met:10.0.0
ARG DEBIAN_VERSION=10
FROM debian:${DEBIAN_VERSION}-slim
MAINTAINER George McCabe <mccabe@ucar.edu>

#
# Define the compilers.
#
ENV CC /usr/bin/gcc
ENV CXX /usr/bin/g++
ENV FC /usr/bin/gfortran
ENV F77 /usr/bin/gfortran

# Needed to install GFDL Tracker
ENV LIB_Z_PATH /usr/lib64
ENV LIB_JASPER_PATH /usr/lib64
ENV LIB_PNG_PATH /usr/lib64
ENV LIB_Z_PATH /usr/local/lib
ENV LIB_JASPER_PATH /usr/local/lib
ENV LIB_PNG_PATH /usr/local/lib

# Needed to install NetCDF-Fortran
ENV NCDIR /usr/local

# Install required system tools
RUN apt update && apt -y upgrade \
&& apt install -y build-essential gfortran wget unzip curl csh file m4

# install jasper, png, and zlib from MET tar_files
RUN cd / && wget https://dtcenter.ucar.edu/dfiles/code/METplus/MET/installation/tar_files.tgz \
&& tar -zxf tar_files.tgz \
&& unzip tar_files/jasper-1.900.1.zip \
&& export CPPFLAGS="-I$/usr/local/include" \
&& cd jasper-1.900.1 \
&& ./configure > configure.log 2>&1 \
&& make > make.log 2>&1 \
&& make install > make_install.log 2>&1 \
&& cd / \
&& tar -xzf tar_files/zlib*.tar.gz \
&& cd zlib* \
&& ./configure > configure.log 2>&1 \
&& make > make.log 2>&1 \
&& make install > make_install.log 2>&1 \
&& cd / \
&& tar -xzf tar_files/libpng*.tar.gz \
&& cd libpng* \
&& ./configure > configure.log 2>&1 \
&& make > make.log 2>&1 \
&& make install > make_install.log 2>&1

# Install HDF5
ENV HDF5_VER 1_10_6
ENV HDF5_URL https://github.com/HDFGroup/hdf5/archive/refs/tags/hdf5-${HDF5_VER}.zip

RUN mkdir -p /usr/local/hdf5 \
&& cd /usr/local/hdf5 \
&& echo "Downloading HDF5 from ${HDF5_URL}" \
&& wget ${HDF5_URL} \
&& unzip hdf5-${HDF5_VER}.zip \
&& cd hdf5-hdf5-${HDF5_VER} \
&& LOG_FILE=/usr/local/hdf5/hdf5-hdf5-${HDF5_VER}_configure.log \
&& echo "Configuring hdf5-hdf5-${HDF5_VER} and writing log file ${LOG_FILE}" \
&& ./configure --prefix=/usr/local --enable-cxx --enable-fortran --with-default-api-version=v18 > ${LOG_FILE} \
&& LOG_FILE=/usr/local/hdf5/hdf5-hdf5-${HDF5_VER}_make_install.log \
&& echo "Compiling hdf5-hdf5-${HDF5_VER} and writing log file ${LOG_FILE}" \
&& make install > ${LOG_FILE}

# Install NetCDF-C 4.8.0
RUN cd / \
&& curl https://codeload.github.com/Unidata/netcdf-c/tar.gz/refs/tags/v4.8.0 --output v4.8.0.tar.gz \
&& tar zxf v4.8.0.tar.gz \
&& cd netcdf-c-4.8.0 \
&& ./configure --disable-dap \
&& ./configure LDFLAGS="-L/usr/local/lib -Wl,-rpath,/usr/local/lib" CPPFLAGS=-I/usr/local/include --disable-dap \
&& make check install

# Install NetCDF-Fortran 4.5.3
RUN cd / \
&& wget https://github.com/Unidata/netcdf-fortran/archive/refs/tags/v4.5.3.tar.gz \
&& tar zxf v4.5.3.tar.gz \
&& cd netcdf-fortran-4.5.3 \
&& ./configure \
&& ./configure LDFLAGS="-L/usr/local/lib -Wl,-rpath,/usr/local/lib" CPPFLAGS=-I/usr/local/include \
&& make check install

RUN cd / \
Expand All @@ -30,6 +83,5 @@ RUN cd / \
&& cd standalone_gfdl-vortextracker_v3.9a_gcc \
&& unset FC && unset CC \
&& ./configure \
&& mv configure.trk-docker-gnu configure.trk \
&& ./compile 2>&1 | tee tracker.log

&& cp configure.trk-docker-gnu configure.trk \
&& ./compile > tracker.log 2>&1
13 changes: 9 additions & 4 deletions internal/scripts/docker_env/Dockerfile.metplus_base
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# Dockerfile to create conda environment used for use cases
# that don't require any additional packages

FROM conda/miniconda3-centos7
ARG METPLUS_ENV_VERSION
FROM dtcenter/metplus-envs:conda.${METPLUS_ENV_VERSION}

ENV PATH=$PATH:/usr/local/conda/bin

WORKDIR /scripts
COPY scripts/metplus_base_env.sh .

RUN conda update -y -n base -c defaults conda \
&& ./metplus_base_env.sh
ARG METPLUS_ENV_VERSION
RUN conda update -y -n base -c conda-forge conda \
&& ./metplus_base_env.sh ${METPLUS_ENV_VERSION}

RUN conda list --name metplus_base.v5 > /usr/local/envs/metplus_base.v5/environments.yml
ARG METPLUS_ENV_VERSION
RUN conda list --name metplus_base.${METPLUS_ENV_VERSION} > /usr/local/conda/envs/metplus_base.${METPLUS_ENV_VERSION}/environments.yml
13 changes: 9 additions & 4 deletions internal/scripts/docker_env/Dockerfile.py_embed_base
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@
# use cases that use python embedding but need additional
# packages

FROM conda/miniconda3-centos7
ARG METPLUS_ENV_VERSION
FROM dtcenter/metplus-envs:conda.${METPLUS_ENV_VERSION}

ENV PATH=$PATH:/usr/local/conda/bin

WORKDIR /scripts
COPY scripts/py_embed_base_env.sh .

RUN conda update -y -n base -c defaults conda \
&& ./py_embed_base_env.sh
ARG METPLUS_ENV_VERSION
RUN conda update -y -n base -c conda-forge conda \
&& ./py_embed_base_env.sh ${METPLUS_ENV_VERSION}

RUN conda list --name py_embed_base.v5 > /usr/local/envs/py_embed_base.v5/environments.yml
ARG METPLUS_ENV_VERSION
RUN conda list --name py_embed_base.${METPLUS_ENV_VERSION} > /usr/local/conda/envs/py_embed_base.${METPLUS_ENV_VERSION}/environments.yml
Loading

0 comments on commit 07824ce

Please sign in to comment.