Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature #2421 update base image #2440

Merged
merged 76 commits into from
Feb 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
9e8b8e2
print python executable used to run when running without MET_PYTHON_EXE
georgemccabe Dec 23, 2022
6246c25
Revert "print python executable used to run when running without MET_…
georgemccabe Dec 23, 2022
3910cad
print python executable used to run when running without MET_PYTHON_EXE
georgemccabe Dec 23, 2022
88759f6
add MET_BASE/python to python path so met_point_obs can be found my P…
georgemccabe Dec 23, 2022
5ad920b
add MET_BASE/python to python path for global python environment (use…
georgemccabe Dec 23, 2022
14d787a
Example call to force set Python executable used in global python cal…
georgemccabe Dec 23, 2022
8cc48cd
Fixed typo that adds LIB_JASPER to list if LIB_LIBPNG is set instead …
georgemccabe Dec 30, 2022
3a1f24f
added a comment to remember to investigate why .a file is removed. If…
georgemccabe Dec 30, 2022
9f398b6
Per #2390, set LIB_Z to /lib if it is not set so that the HDF5 config…
georgemccabe Dec 30, 2022
6742516
Per discussion dtcenter/METplus#1997, add support for setting optiona…
georgemccabe Jan 9, 2023
ebcf2c4
Merge branch 'develop' of github.com:dtcenter/MET into develop
georgemccabe Jan 9, 2023
74fcce1
Merge branch 'develop' into bugfix_2390_develop_compile_zlib
georgemccabe Jan 9, 2023
940f3cd
add -j argument to make commands when building MET in docker to test …
georgemccabe Jan 9, 2023
a4fef9d
per discussion dtcenter/metplus#1997, handle NetCDF4-C for new tar.gz…
georgemccabe Jan 10, 2023
20ac6a2
clean up setting of compiler env vars
georgemccabe Jan 10, 2023
d941d18
clean up building of configure command for MET
georgemccabe Jan 10, 2023
274ff23
Skip MET compliation if SKIP_MET is set in the environment. This allo…
georgemccabe Jan 10, 2023
8ece11a
more cleanup of compiler env var setting
georgemccabe Jan 10, 2023
42de559
removed unnecessary else
georgemccabe Jan 10, 2023
b3898e3
add ability to skip compilation of external libraries by setting SKIP…
georgemccabe Jan 10, 2023
bcc7351
remove redundant setting of env var
georgemccabe Jan 10, 2023
4817077
added function to run commands and check return value. clean up logic…
georgemccabe Jan 10, 2023
2e55407
clean up formatting of long elif statement
georgemccabe Jan 11, 2023
35ed5ec
add execute permissions for compile script
georgemccabe Jan 11, 2023
519e689
removed extra cd command
georgemccabe Jan 11, 2023
0933433
changed logic to set COMPILE_* to compile optional libraries in env c…
georgemccabe Jan 11, 2023
e277faf
changed command failure log to include ERROR: and print full command …
georgemccabe Jan 11, 2023
4da0c0a
changed logic to exit 0 if MET compilation is skipped and shifted ind…
georgemccabe Jan 11, 2023
9718ad4
Merge branch 'develop' of github.com:dtcenter/MET into develop
georgemccabe Jan 12, 2023
bd266f6
Merge branch 'develop' into bugfix_2390_develop_compile_zlib
georgemccabe Jan 12, 2023
11cd6c1
Merge branch 'develop' into feature_2388_python_env
georgemccabe Jan 12, 2023
9b5cd1f
Per #2388, make MET_PYTHON_BIN_EXE a required configuration setting f…
JohnHalleyGotway Jan 12, 2023
ba40fb9
Per #2388, switch MET_PYTHON_BIN_EXE help message to be more consiste…
JohnHalleyGotway Jan 12, 2023
7081535
Per #2388, add MET_PYTHON_BIN_EXE to the documentation.
JohnHalleyGotway Jan 12, 2023
12d16c9
merged remote changes and resolve conflicts
georgemccabe Jan 12, 2023
e251079
Per #2388, if not already set, set MET_PYTHON_BIN_EXE = /opt/local/Li…
JohnHalleyGotway Jan 12, 2023
0ac332a
set MET_PYTHON_BIN_EXE in docker env
georgemccabe Jan 13, 2023
c3482c2
Merge branch 'develop' of github.com:dtcenter/MET into develop
georgemccabe Jan 13, 2023
740939e
Merge branch 'develop' into feature_2388_python_env
georgemccabe Jan 13, 2023
7ce72e8
Merge branch 'develop' into bugfix_2390_develop_compile_zlib
georgemccabe Jan 13, 2023
42c82e1
merged bugfix_2390_develop_compile_zlib and feature_2388_python_env
georgemccabe Jan 13, 2023
0f5f979
changes to install using tar_files.tgz using METbaseimage based on de…
georgemccabe Jan 13, 2023
e311c57
added env vars needed to use compile script
georgemccabe Jan 13, 2023
7754d67
changed test base
georgemccabe Jan 13, 2023
9dc0c6e
fixed values for python setup
georgemccabe Jan 13, 2023
d8e6cda
Merge branch 'develop' of github.com:dtcenter/MET into develop
georgemccabe Jan 13, 2023
f354b70
set BIN_DIR_PATH to install MET exes into /usr/local/bin
georgemccabe Jan 13, 2023
937ed60
attempt to build MET through GHA using compile script and debian image
georgemccabe Jan 13, 2023
d8c2737
fixed call to compile script
georgemccabe Jan 13, 2023
82197c3
change met base tag to debian and ci-run-unit
georgemccabe Jan 13, 2023
1d9ca04
merged develop and resolved conflicts
georgemccabe Jan 13, 2023
6259aa9
allow MET_INSTALL_DIR env var to control where MET is installed, ci-r…
georgemccabe Jan 17, 2023
2353457
set env vars to compile optional libs, ci-run-unit
georgemccabe Jan 17, 2023
56f56d4
Merge branch 'develop' of github.com:dtcenter/MET into develop
georgemccabe Jan 18, 2023
0b8f9d5
Merge branch 'develop' into feature_test_compile
georgemccabe Jan 18, 2023
420540d
redirect stderr to log file and output its contents on failure
georgemccabe Jan 18, 2023
77bbcfd
revert back to installing MET without using the compilation script so…
georgemccabe Jan 18, 2023
32a710b
create logs dir
georgemccabe Jan 18, 2023
e4b4951
send stderr to log file
georgemccabe Jan 18, 2023
b9b497c
add external_libs dir to rpath and set MET install dir to put share/m…
georgemccabe Jan 18, 2023
6a249e0
merged latest changes
georgemccabe Jan 18, 2023
6f13970
add external libs include and lib to flags
georgemccabe Jan 18, 2023
42d5102
add external libs with -L
georgemccabe Jan 18, 2023
78d8021
added freetype include
georgemccabe Jan 18, 2023
0a8aee5
fix includes
georgemccabe Jan 18, 2023
0aa45e8
add cairo include
georgemccabe Jan 18, 2023
a1c2df0
Merge branch 'develop' of github.com:dtcenter/MET into develop
georgemccabe Jan 18, 2023
f9f7481
merged develop and resolved conflicts
georgemccabe Jan 18, 2023
35835d0
remove -D__64BIT__ flag from MET compilation because the compilation …
georgemccabe Jan 19, 2023
a2b8336
clean up sed commands to replace values in place, ci-run-unit
georgemccabe Jan 19, 2023
cdf399d
added note that removal of -D__64BIT__ from g2clib makefile will not …
georgemccabe Jan 19, 2023
30e36a9
changed location of python exe to match new location in docker, ci-ru…
georgemccabe Jan 19, 2023
7b01597
update MET base tag name
georgemccabe Jan 24, 2023
116f236
Merge branch 'develop' into feature_test_compile
georgemccabe Jan 27, 2023
b8cc17e
set LIB_DIR to MET_INSTALL_DIR if it is set
georgemccabe Feb 3, 2023
28c7730
updates to match move of METbaseimage to install in /usr/local instea…
georgemccabe Feb 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/jobs/build_docker_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,5 @@ time_command docker build -t ${DOCKERHUB_TAG} \
-f $DOCKERFILE_PATH ${GITHUB_WORKSPACE}
if [ $? != 0 ]; then
cat ${GITHUB_WORKSPACE}/docker_build.log
# Append the full make_install.log file
echo "Appending make_install.log to docker_build.log. See the logs artifact for details."
cat ${GITHUB_WORKSPACE}/make_install.log >> ${GITHUB_WORKSPACE}/docker_build.log
exit 1
fi
2 changes: 1 addition & 1 deletion .github/jobs/set_job_controls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ run_unit_tests=false
run_diff=false
run_update_truth=false
met_base_repo=met-base
met_base_tag=v1.1
met_base_tag=v2.0_debian10
input_data_version=develop
truth_data_version=develop

Expand Down
2 changes: 1 addition & 1 deletion .github/jobs/test_env_vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ export MET_TEST_TRUTH=/data/output/met_test_truth
export MET_TEST_DIFF=/data/output/met_test_diff

export MET_TEST_RSCRIPT=/usr/bin/Rscript
export MET_TEST_MET_PYTHON_EXE=/usr/bin/python3
export MET_TEST_MET_PYTHON_EXE=/usr/local/bin/python3
2 changes: 1 addition & 1 deletion .github/workflows/build_docker_and_trigger_metplus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
env:
SOURCE_BRANCH: ${{ steps.get_branch_name.outputs.branch_name }}-lite
MET_BASE_REPO: met-base
MET_BASE_TAG: v1.1
MET_BASE_TAG: v2.0_debian10

- name: Push Docker Image
run: .github/jobs/push_docker_image.sh
Expand Down
18 changes: 11 additions & 7 deletions internal/scripts/docker/build_met_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,37 @@

echo "Running script to build MET in Docker"

LOG_FILE=/met/logs/MET-${MET_GIT_NAME}_configure.log

source internal/scripts/environment/development.docker

mkdir -p /met/logs

LOG_FILE=/met/logs/MET-${MET_GIT_NAME}_configure.log
echo "Configuring MET ${MET_GIT_NAME} and writing log file ${LOG_FILE}"
./bootstrap
./configure --enable-grib2 --enable-mode_graphics --enable-modis --enable-lidar2nc --enable-python > ${LOG_FILE}
./configure --enable-grib2 --enable-mode_graphics --enable-modis --enable-lidar2nc --enable-python CPPFLAGS="-I/usr/local/include -I/usr/local/include/freetype2 -I/usr/local/include/cairo" > ${LOG_FILE} 2>&1
if [ $? != 0 ]; then
exit 1
cat ${LOG_FILE}
exit 1
fi

if [ ! -z "${MAKE_ARGS}" ]; then
echo Adding make arguments: ${MAKE_ARGS}
fi

LOG_FILE=/met/MET-${MET_GIT_NAME}/make_install.log
LOG_FILE=/met/logs/MET-${MET_GIT_NAME}_make_install.log
echo "Compiling MET ${MET_GIT_NAME} and writing log file ${LOG_FILE}"
make ${MAKE_ARGS} install > ${LOG_FILE}
if [ $? != 0 ]; then
exit 1
cat ${LOG_FILE}
exit 1
fi

LOG_FILE=/met/logs/MET-${MET_GIT_NAME}_make_test.log
echo "Testing MET ${MET_GIT_NAME} and writing log file ${LOG_FILE}"
make ${MAKE_ARGS} test > ${LOG_FILE} 2>&1
if [ $? != 0 ]; then
exit 1
cat ${LOG_FILE}
exit 1
fi

if [[ $MET_GIT_NAME == "v"* ]]; then
Expand Down
46 changes: 21 additions & 25 deletions internal/scripts/environment/development.docker
Original file line number Diff line number Diff line change
@@ -1,39 +1,22 @@
# Define the development environment for NCAR project machine seneca
# Based on settings in /usr/local/src/met/README.snat
# Define the development environment for Docker

# Top-level MET project directory
MET_PROJ_DIR=`ls -1d /met/MET*`

# Variables required to build MET
export MET_DEVELOPMENT=true

export MET_NETCDF=/usr/local
export MET_HDF5INC=/usr/include
export MET_HDF5LIB=/usr/lib64
export MET_HDF=/usr/local/hdf
export MET_HDFEOS=/usr/local/hdfeos
export MET_BUFR=/usr/local
export MET_GRIB2CINC=/usr/include
export MET_GRIB2CLIB=/usr/lib64
export MET_GSLINC=/usr/include/gsl
export MET_GSLLIB=/usr/lib64
export MET_CAIROINC=/usr/include/cairo
export MET_CAIROLIB=/usr/lib64
export MET_FREETYPEINC=/usr/include/freetype2
export MET_FREETYPELIB=/usr/lib64
export MET_JASPERLIB=/usr/lib64

export MET_PYTHON_BIN_EXE=/usr/bin/python3
export MET_PYTHON_CC="-I/usr/include/python3.6m"
export MET_PYTHON_LD="-L/usr/lib64 -lpython3.6m -lpthread -ldl -lutil -lm"

# -D__64BIT__ is required because we've compiled libgrib2c.a with that flag
export CFLAGS="-DUNDERSCORE -fPIC -D__64BIT__ -g"
export MET_PYTHON=/usr/local
export MET_PYTHON_BIN_EXE=${MET_PYTHON}/bin/python3
export MET_PYTHON_CC="-I${MET_PYTHON}/include/python3.10"
export MET_PYTHON_LD="-L${MET_PYTHON}/lib -lpython3.10 -lcrypt -lpthread -ldl -lutil -lm"

export CFLAGS="-DUNDERSCORE -fPIC -g"
export CXXFLAGS=${CFLAGS}

# Set LDFLAGS to include -rpath settings when compiling MET
export LDFLAGS="-Wl,--disable-new-dtags"
export LDFLAGS="${LDFLAGS} -Wl,-rpath,/usr/local/lib:/usr/lib64:${MET_HDF}/lib:${MET_HDFEOS}/lib"
export LDFLAGS="${LDFLAGS} -Wl,-rpath,/usr/local/lib:/usr/lib64"

# Variables required to run MET
export MET_TEST_INPUT=${MET_PROJ_DIR}/MET_test_data/unit_test
Expand All @@ -44,3 +27,16 @@ export MET_TEST_RSCRIPT=/usr/bin/Rscript

# set make arguments to build using multiple jobs
export MAKE_ARGS=-j

export TEST_BASE=/met
export COMPILER=gnu
export MET_SUBDIR=${TEST_BASE}
export MET_TARBALL=none
export USE_MODULES=FALSE

export MET_INSTALL_DIR=/usr/local

export COMPILE_HDF=1
export COMPILE_HDFEOS=1
export COMPILE_FREETYPE=1
export COMPILE_CAIRO=1
35 changes: 27 additions & 8 deletions internal/scripts/installation/compile_MET_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,23 @@ echo "MET_TARBALL = ${MET_TARBALL? "ERROR: MET_TARBALL must be set"}"
echo "USE_MODULES = ${USE_MODULES? "ERROR: USE_MODULES must be set to TRUE if using modules or FALSE otherwise"}"
echo ${MAKE_ARGS:+MAKE_ARGS = $MAKE_ARGS}

export LIB_DIR=${TEST_BASE}/external_libs
LIB_DIR=${TEST_BASE}/external_libs
MET_DIR=${MET_SUBDIR}

if [ -z "${BIN_DIR_PATH}" ]; then
if [ -z "${MET_INSTALL_DIR}" ]; then
BIN_DIR_PATH=${TEST_BASE}/bin
else
BIN_DIR_PATH=${MET_INSTALL_DIR}/bin
fi
fi

if [ -z "${MET_INSTALL_DIR}" ]; then
MET_INSTALL_DIR=${MET_DIR}
else
LIB_DIR=${MET_INSTALL_DIR}
fi

TAR_DIR=${TEST_BASE}/tar_files
MET_TARBALL=${TAR_DIR}/${MET_TARBALL}

Expand Down Expand Up @@ -415,12 +430,16 @@ if [ $COMPILE_G2CLIB -eq 1 ]; then
rm -rf ${LIB_DIR}/g2clib/g2clib*
tar -xf ${TAR_DIR}/g2clib*.tar -C ${LIB_DIR}/g2clib
cd ${LIB_DIR}/g2clib/g2clib*
cat makefile | \
sed -r 's/INC=.*/INC=-I${LIB_DIR}\/include -I${LIB_DIR}\/include\/jasper/g' | \
sed 's/CC=gcc/CC=${CC_COMPILER}/g' | \
sed 's/-D__64BIT__//g' \
> makefile_new
mv makefile_new makefile
sed -i 's|INC=.*|INC=-I${LIB_DIR}/include -I${LIB_DIR}/include/jasper|g' makefile

# allow other compilers besides gcc
sed -i 's/CC=gcc/CC=${CC_COMPILER}/g' makefile

# remove -D__64BIT__ flag because compiling with it has
# shown issues with GRIB/GRIB2 files that are over 2GB in size
# This flag was removed in g2clib 1.6.4
# so this can be removed if the version is updated
sed -i 's/-D__64BIT__//g' makefile
export CC_COMPILER=${CC}
echo "cd `pwd`"
# g2clib appears to compile but causes failure compiling MET if -j argument is used
Expand Down Expand Up @@ -628,7 +647,7 @@ if [[ $COMPILER_FAMILY == "pgi" ]]; then
export OPT_ARGS="${OPT_ARGS} FFLAGS=-lpgf90"
fi

configure_cmd="./configure --prefix=${MET_DIR} --bindir=${BIN_DIR_PATH}"
configure_cmd="./configure --prefix=${MET_INSTALL_DIR} --bindir=${BIN_DIR_PATH}"
configure_cmd="${configure_cmd} BUFRLIB_NAME=${BUFRLIB_NAME}"
configure_cmd="${configure_cmd} GRIB2CLIB_NAME=${GRIB2CLIB_NAME} --enable-grib2"
if [[ ! -z ${MET_FREETYPEINC} && ! -z ${MET_FREETYPELIB} && \
Expand Down