Skip to content

Commit

Permalink
Merge pull request #16 from dtcenter/feature_15_yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnHalleyGotway authored Nov 10, 2023
2 parents 42d162f + cf0a2f0 commit 00f1063
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/jobs/bash_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function time_command {
error=$?
else
echo "Logging to ${CMD_LOGFILE}"
"$@" &>> $CMD_LOGFILE
"$@" >> $CMD_LOGFILE 2>&1
error=$?
unset CMD_LOGFILE
fi
Expand Down
7 changes: 7 additions & 0 deletions .github/jobs/build_docker_image.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#! /bin/bash

source ${GITHUB_WORKSPACE}/.github/jobs/bash_functions.sh

# Required environment variables:
# $GITHUB_WORKSPACE is the full path to METbaseimage.
# $GITHUB_TAG is the tag name (e.g. vX.Y).
# $DOCKERHUB_BASE_REPO is dtcenter/met-base.
# $DOCKERHUB_UNIT_TEST_REPO is dtcenter/met-base-unit-test.

MET_BASE_TAG=${GITHUB_TAG}

DOCKERHUB_TAG_BASE=${DOCKERHUB_BASE_REPO}:${MET_BASE_TAG}
Expand Down
38 changes: 24 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ENV F77 /usr/bin/gfortran

ENV PYTHON_VER 3.10.4

ENV GSFONT_URL https://dtcenter.ucar.edu/dfiles/code/METplus/MET/docker_data/ghostscript-fonts-std-8.11.tar.gz
ENV GSFONT_URL https://dtcenter.ucar.edu/dfiles/code/METplus/MET/docker_data/ghostscript-fonts-std-8.11.tar.gz

#
# Set up the environment for interactive bash shell
Expand Down Expand Up @@ -54,14 +54,6 @@ RUN sed -i 's/policy domain="coder" rights="none" pattern="PS/policy domain="cod
#
WORKDIR /met

RUN wget https://dtcenter.ucar.edu/dfiles/code/METplus/MET/installation/tar_files.tgz \
&& wget https://raw.githubusercontent.com/dtcenter/MET/develop/internal/scripts/installation/compile_MET_all.sh \
&& wget https://raw.githubusercontent.com/dtcenter/MET/develop/internal/scripts/environment/development.docker \
&& tar -zxf tar_files.tgz \
&& export SKIP_MET=TRUE \
&& chmod +x compile_MET_all.sh \
&& ./compile_MET_all.sh development.docker

#
# Install Python from source
#
Expand All @@ -71,11 +63,29 @@ RUN wget https://www.python.org/ftp/python/${PYTHON_VER}/Python-${PYTHON_VER}.tg
&& ./configure --enable-optimizations --enable-shared LDFLAGS="-L/usr/local/lib -Wl,-rpath,/usr/local/lib" \
&& make -j `nproc` \
&& make install \
&& ln -s /usr/local/bin/python3 /usr/local/bin/python \
&& BLDOPTS="--force-reinstall --global-option=build_ext --global-option=\"-R/usr/local/lib\" --global-option=\"-L/usr/local/lib\"" \
&& ln -s /usr/local/bin/python3 /usr/local/bin/python

#
# Compile the MET libraries
#
ARG MET_COMPILE_SCRIPT_BRANCH=develop
RUN echo "Pulling compilation script from MET branch ${MET_COMPILE_SCRIPT_BRANCH}" \
&& wget https://dtcenter.ucar.edu/dfiles/code/METplus/MET/installation/tar_files.tgz \
&& wget https://raw.githubusercontent.com/dtcenter/MET/${MET_COMPILE_SCRIPT_BRANCH}/internal/scripts/installation/compile_MET_all.sh \
&& wget https://raw.githubusercontent.com/dtcenter/MET/${MET_COMPILE_SCRIPT_BRANCH}/internal/scripts/environment/development.docker \
&& tar -zxf tar_files.tgz \
&& export SKIP_MET=TRUE \
&& chmod +x compile_MET_all.sh \
&& ./compile_MET_all.sh development.docker

#
# Install required Python packages
#
RUN BLDOPTS="--global-option=build_ext --global-option=\"-R/usr/local/lib\" --global-option=\"-L/usr/local/lib\"" \
&& python3 -m pip install --upgrade pip \
&& python3 -m pip install ${BLDOPTS} numpy \
&& python3 -m pip install ${BLDOPTS} xarray \
&& python3 -m pip install ${BLDOPTS} numpy==1.24.2 \
&& python3 -m pip install ${BLDOPTS} xarray==2023.1.0 \
&& export HDF5_DIR=/usr/local/ \
&& export NETCDF4_DIR=/usr/local/ \
&& python3 -m pip install ${BLDOPTS} netCDF4
&& python3 -m pip install ${BLDOPTS} netCDF4==1.6.2 \
&& python3 -m pip install ${BLDOPTS} pyyaml==6.0.1

0 comments on commit 00f1063

Please sign in to comment.