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

Bring main up to ngeet-2024 #21

Merged
merged 64 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
10f967a
update gitignore and add documentation source images folder
glemieux Mar 1, 2024
d295ebb
update build to look in NGEET org repo
glemieux Mar 1, 2024
039d043
update download target to be tag located on NGEET fork of HLM
glemieux Mar 2, 2024
5ac68ac
update config wget commands to specify the branch
glemieux Mar 2, 2024
ac909d7
add download for fates
glemieux Mar 3, 2024
369741c
adding build instruction readme
glemieux Mar 3, 2024
74b8384
turn readme into markdown
glemieux Mar 3, 2024
30714df
minor formatting readme
glemieux Mar 3, 2024
9d70dcc
add new folder for elm_v3-for-ngee
glemieux Jul 17, 2024
820c396
initial commit of docker compose yaml
glemieux Jul 19, 2024
0bc765e
start moving baseos to ngeetropics
glemieux Jul 20, 2024
7975efb
update compose file with container names and volumes
glemieux Jul 20, 2024
7b00796
volume is not a service; add tty and std_in to elm-fates container
glemieux Jul 21, 2024
d7a78f1
renaming compose file internally
glemieux Jul 21, 2024
21ba9bd
fix typo and white space
glemieux Jul 21, 2024
0015f5e
add ports to the jupyter container
glemieux Jul 21, 2024
c6b1f5b
add scripts volume mounted to local directory
glemieux Jul 21, 2024
0009d57
add hostname and user name override to the compose file
glemieux Jul 23, 2024
d82dd71
allow user to use .env file to set environment variables for convenience
glemieux Jul 23, 2024
062bfac
update volumes with env vars
glemieux Jul 23, 2024
c2e7ee4
Merge branch 'ngeet-2024-compose' into ngeet-2024
glemieux Jul 23, 2024
f474fca
update e3sm build to get all elm externals
glemieux Jul 25, 2024
6436677
add gcc 11.2 baseos
glemieux Jul 25, 2024
88ec530
update compose and elm-fates dockerfile
glemieux Jul 25, 2024
270fbcf
update docker container bind mounts
glemieux Jul 26, 2024
acf5d83
starting to clean up directory structure
glemieux Jul 26, 2024
34515a4
fix sharing of volumes between containers
glemieux Jul 26, 2024
b3bc2c1
whitespace cleanup
glemieux Jul 26, 2024
5202801
simplify what has to be defined in .env file
glemieux Jul 26, 2024
2e3087c
update env template with simplified variables
glemieux Jul 26, 2024
ae7af96
fix inventory data location
glemieux Jul 26, 2024
1c39eac
add initial cut of minimal data dockerfile
glemieux Aug 5, 2024
582d832
remove the docker compose file
glemieux Aug 5, 2024
1c5d326
update default data dockerfile
glemieux Aug 5, 2024
4ef2b7d
add sitedata folder to elm-fates v3 image
glemieux Aug 5, 2024
40453d8
add land to default data file
glemieux Aug 5, 2024
8702202
update data container to use alpine
glemieux Aug 5, 2024
607b2e3
Add BCI container dockerfile
glemieux Aug 7, 2024
5dec86e
update basic data container
glemieux Aug 12, 2024
fc01c7b
update data container for bci and domain/met drivers
glemieux Aug 15, 2024
0c73683
change uid for modeluser
glemieux Aug 15, 2024
d43817a
Merge branch 'ngeet-2024-dataimage-default' into ngeet-2024
glemieux Aug 15, 2024
ad70c0b
remove manaus from the gitignore
glemieux Aug 16, 2024
2da79f9
add sed commands to modify the datm namelist definitions
glemieux Aug 16, 2024
41501e1
fix QBOT typo variable in sed command
glemieux Aug 16, 2024
2556658
remove the datm namelist modification
glemieux Aug 16, 2024
f64fb88
update bci inventory location and generalize site name
glemieux Aug 23, 2024
b3c8406
update site data dockerfile
glemieux Aug 26, 2024
0b3ce14
Merge pull request #10 from NGEET/data-container-update-sites
glemieux Aug 26, 2024
4ac364e
update baseos to reinstate python symlink and pip install
glemieux Aug 26, 2024
18f32ce
Merge remote-tracking branch 'origin/main' into ngeet-2024
glemieux Aug 27, 2024
1f6d63d
minor update to driver data container
glemieux Aug 28, 2024
a04c645
update baseos with pinned version of scipy
glemieux Aug 28, 2024
e487274
updating initial build action with matrix strategy
glemieux Aug 29, 2024
6c06184
update site dockerfile description
glemieux Aug 29, 2024
0dad100
add subdirectories in the elm-fates image dockerfile
glemieux Aug 29, 2024
369746f
update elm-fates container permissions for inventory data
glemieux Aug 30, 2024
bf358a8
make sure to recursively provide read/execute access
glemieux Aug 30, 2024
2d5600e
update build context and tag
glemieux Aug 31, 2024
ace6c6a
enable matrix os and update tag to be dynamic
glemieux Aug 31, 2024
cbe026d
change image build to use docker architecture emulation
glemieux Aug 31, 2024
7248095
add temp workaround for cd going to home
glemieux Sep 6, 2024
570d619
correct temp bashcd append
glemieux Sep 7, 2024
fdac494
Add CO2 timeseries to the default dataset
glemieux Sep 12, 2024
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
58 changes: 23 additions & 35 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docker image build
name: Docker image build - base OS

on:
push:
Expand All @@ -10,44 +10,32 @@ on:
jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
platform: [linux/amd64, linux/arm64]

steps:
- name: checkout
uses: actions/checkout@v4

- name: Docker QEMU
uses: docker/setup-qemu-action@v3

- name: Docker Setup Buildx
uses: docker/[email protected]
env:
env:
DOCKER_CONFIG: docker/baseos/gcc1120
#with:
# Buildx version. (eg. v0.3.0)
#version: # optional
# Sets the builder driver to be used
#driver: # optional, default is docker-container
# List of additional driver-specific options. (eg. image=moby/buildkit:master)
#driver-opts: # optional
# BuildKit daemon flags
#buildkitd-flags: # optional, default is --allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host
# BuildKit daemon config file
#buildkitd-config: # optional
# Inline BuildKit daemon config
#buildkitd-config-inline: # optional
# Sets up docker build command as an alias to docker buildx build
#install: # optional, default is false
# Switch to this builder instance
#use: # optional, default is true
# Optional address for docker socket or context from `docker context ls`
#endpoint: # optional
# Fixed platforms for current node. If not empty, values take priority over the detected ones
#platforms: # optional
# Append additional nodes to the builder
#append: # optional
# Cache buildx binary to GitHub Actions cache backend
#cache-binary: # optional, default is true
# Cleanup temp files and remove builder at the end of a job
#cleanup: # optional, default is true
# BuildKit daemon config file
#config: # optional
# Inline BuildKit daemon config
#config-inline: # optional


- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v6
with:
platform: ${{ matrix.platform }}
context: "{{defaultContext}}:docker/baseos/gcc1120"
push: true
tags: ngeetropics/baseos:testbuild-${{ matrix.platform}}
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,16 @@
*._*
.DS_store
.DS_Store

# Documentation build
/docs/build

# docker
.env

# data
*.nc
*.cdl
/docker/data/sites/met_data
/docker/data/sites/bci_inventory_data
/docker/data/sites/inventory_ctrl
167 changes: 167 additions & 0 deletions docker/baseos/gcc1120/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
# ----------------------------------------------------------------------
# Debian baseOS docker container to use with ELM/CTSM builds
# AMD64 version
# ----------------------------------------------------------------------

FROM gcc:11.2.0
LABEL maintainer.name="Gregory Lemieux" \
maintainer.email="[email protected]" \
author.name="Shawn P. Serbin" \
author.email="[email protected]" \
description="GCC-based image loaded with necessary dependencies for building HLM/HLM-FATES images"

# Set a few variables that can be used to control the docker build
# TODO: actually use these to allow for argument builds OR
# remove if its not relevant
ARG OPENMPI_VERSION=4.1.4
ARG EXPAT_VERSION=2.4.7
ARG HDF5_VERSION=1.12.2.3
ARG NETCDF_VERSION=4.9.0.3
ARG NETCDF_FORTRAN_VERSION=4.5.3

# set path variables
ENV PATH=/usr/local/bin:$PATH
ENV LD_LIBRARY_PATH=/usr/local/lib64:$LD_LIBRARY_PATH
ENV PATH=/usr/local/hdf5/bin:$PATH
ENV PATH=/usr/local/netcdf/bin:$PATH
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/hdf5/lib
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/netcdf/lib
ENV HDF5_DIR=/usr/local/hdf5

# Update the system and install initial dependencies
RUN apt-get update -y \
&& apt-get install -y \
cmake \
git \
subversion \
bzip2 \
libgmp3-dev \
m4 \
wget \
libcurl4-openssl-dev \
zlib1g-dev \
libncurses5-dev \
libxml2 \
libxml2-dev \
csh \
liblapack-dev \
libblas-dev \
liblapack-dev \
libffi7 \
libffi-dev \
libxml-libxml-perl \
libxml2-utils \
vim \
libudunits2-0 \
libudunits2-dev \
udunits-bin \
python3 \
python3-dev \
python3-pip \
apt-utils \
ftp \
apt-transport-https \
libssl-dev \
openssl \
libncurses5-dev \
libsqlite3-dev \
gsl-bin \
libgsl-dev \
flex \
nco \
locales \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean all

## Install program to configure locales
RUN dpkg-reconfigure locales && \
locale-gen C.UTF-8 && \
/usr/sbin/update-locale LANG=C.UTF-8
RUN echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen && \
locale-gen
## Set default locale for the environment
ENV LC_ALL C.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8

# ## check locales
RUN locale -a

# ## compile openMPI
RUN cd / \
&& wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-${OPENMPI_VERSION}.tar.gz \
&& tar -zxvf openmpi-${OPENMPI_VERSION}.tar.gz \
&& cd openmpi-${OPENMPI_VERSION} \
&& export PATH=/usr/local/bin:$PATH \
&& export LD_LIBRARY_PATH=/usr/local/lib64:$LD_LIBRARY_PATH \
&& ./configure --enable-static \
&& make \
&& make install \
&& cd / \
&& rm -r openmpi-${OPENMPI_VERSION} \
&& rm openmpi-${OPENMPI_VERSION}.tar.gz \
&& ldconfig

## Compile Expat XML parser
RUN cd / \
&& wget https://github.com/libexpat/libexpat/releases/download/R_2_4_7/expat-2.4.7.tar.bz2 \
&& tar -xvjf expat-2.4.7.tar.bz2 \
&& cd expat-2.4.7 \
&& ./configure \
&& make \
&& make install \
&& cd / \
&& rm -r expat-2.4.7 \
&& rm expat-2.4.7.tar.bz2

## HDF5 - use alternative source since main HDF5 source doesnt have useful download links
#https://support.hdfgroup.org/ftp/HDF5/releases/
RUN cd / \
&& mkdir -p /usr/local/hdf5 \
&& wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.1/src/hdf5-1.12.1.tar.gz \
&& tar -zxvf hdf5-1.12.1.tar.gz \
&& cd hdf5-1.12.1 \
&& CC=mpicc ./configure --enable-fortran --enable-parallel --prefix=/usr/local/hdf5 \
&& make \
&& make install \
&& export PATH=/usr/local/hdf5/bin:$PATH \
&& export LD_LIBRARY_PATH=/usr/local/hdf5/lib/libhdf5 \
&& cd / \
&& rm -r hdf5-1.12.1 \
&& rm hdf5-1.12.1.tar.gz

## netCDF & netCDF-Fortran
RUN cd / \
&& mkdir -p /usr/local/netcdf \
&& wget https://downloads.unidata.ucar.edu/netcdf-c/4.8.1/netcdf-c-4.8.1.tar.gz \
&& tar -zxvf netcdf-c-4.8.1.tar.gz \
&& cd netcdf-c-4.8.1 \
&& export H5DIR=/usr/local/hdf5 \
&& export NCDIR=/usr/local/netcdf \
&& CC=mpicc CPPFLAGS=-I${H5DIR}/include LDFLAGS=-L${H5DIR}/lib ./configure --enable-parallel-tests --prefix=${NCDIR} \
&& make \
&& make install \
&& export PATH=/usr/local/netcdf/bin:$PATH \
&& export LD_LIBRARY_PATH=/usr/local/netcdf/lib \
&& cd / \
&& rm -r netcdf-c-4.8.1 \
&& rm netcdf-c-4.8.1.tar.gz \
&& wget https://downloads.unidata.ucar.edu/netcdf-fortran/4.5.4/netcdf-fortran-4.5.4.tar.gz \
&& tar -zxvf netcdf-fortran-4.5.4.tar.gz \
&& cd netcdf-fortran-4.5.4 \
&& export NCDIR=/usr/local/netcdf \
&& export NFDIR=/usr/local/netcdf \
&& FC=mpif90 CPPFLAGS=-I${NCDIR}/include LDFLAGS=-L${NCDIR}/lib ./configure --prefix=${NFDIR} --enable-parallel-tests \
&& make \
&& make install \
&& cd / \
&& rm -r netcdf-fortran-4.5.4 \
&& rm netcdf-fortran-4.5.4.tar.gz

# This is the minimum version of scipy to avoid fates#1242
RUN pip3 install 'scipy==1.11.4' 'netCDF4==1.7.1'

# Add symlink to python3 to alias python
RUN ln -sf /usr/bin/python3 /usr/bin/python

### EOF
Loading
Loading