Skip to content

Commit 6d46d5e

Browse files
committed
standalone-ghci
1 parent ec75228 commit 6d46d5e

File tree

3 files changed

+203
-0
lines changed

3 files changed

+203
-0
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: ghci
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
paths:
7+
- 'standalone-ghci/**'
8+
- '.github/workflows/standalone-ghci.yaml'
9+
push:
10+
branches: [ main ]
11+
paths:
12+
- 'standalone-ghci/**'
13+
- '.github/workflows/standalone-ghci.yaml'
14+
tags:
15+
- 'standalone-ghci-*'
16+
17+
env:
18+
GCC_VERSION: "11.4.0"
19+
MPICH_VERSION: "4.2.1"
20+
SZIP_VERSION: "2.1.1"
21+
HDF5_VERSION: "1.12.3"
22+
NETCDFC_VERSION: "4.9.2"
23+
NETCDFCXX_VERSION: "4.2"
24+
NETCDFFORTRAN_VERSION: "4.6.1"
25+
PNETCDF_VERSION: "1.12.1"
26+
27+
jobs:
28+
ocis:
29+
runs-on: ubuntu-latest
30+
permissions:
31+
contents: read
32+
packages: write
33+
id-token: write
34+
35+
steps:
36+
-
37+
name: Checkout
38+
uses: actions/checkout@v4
39+
with:
40+
submodules: recursive
41+
show-progress: false
42+
persist-credentials: false
43+
-
44+
name: GHCR
45+
uses: docker/login-action@v3
46+
with:
47+
registry: ghcr.io
48+
username: ${{ github.actor }}
49+
password: ${{ secrets.GITHUB_TOKEN }}
50+
-
51+
name: Meta
52+
id: meta
53+
uses: docker/metadata-action@v5
54+
with:
55+
images: |
56+
ghcr.io/${{ github.repository }}-standalone-ghci
57+
-
58+
name: QEMU
59+
uses: docker/setup-qemu-action@v3
60+
-
61+
name: Buildx
62+
uses: docker/setup-buildx-action@v3
63+
-
64+
name: Push
65+
uses: docker/build-push-action@v6
66+
with:
67+
context: standalone-ghci/
68+
file: standalone-ghci/Dockerfile
69+
push: ${{ github.event_name != 'pull_request' }}
70+
tags: ${{ steps.meta.outputs.tags }}
71+
labels: ${{ steps.meta.outputs.labels }}
72+
build-args: |
73+
GCC_VERSION=${{ env.GCC_VERSION }}
74+
MPICH_VERSION=${{ env.MPICH_VERSION }}
75+
SZIP_VERSION=${{ env.SZIP_VERSION }}
76+
HDF5_VERSION=${{ env.HDF5_VERSION }}
77+
NETCDFC_VERSION=${{ env.NETCDFC_VERSION }}
78+
NETCDFCXX_VERSION=${{ env.NETCDFCXX_VERSION }}
79+
NETCDFFORTRAN_VERSION=${{ env.NETCDFFORTRAN_VERSION }}
80+
PNETCDF_VERSION=${{ env.PNETCDF_VERSION }}

standalone-ghci/Dockerfile

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
FROM ghcr.io/e3sm-project/containers-inputdata-files-standalone:main
2+
3+
ARG GCC_VERSION=11.4.0
4+
ARG MPICH_VERSION=4.2.1
5+
ARG SZIP_VERSION=2.1.1
6+
ARG HDF5_VERSION=1.12.3
7+
ARG NETCDFC_VERSION=4.9.2
8+
ARG NETCDFCXX_VERSION=4.2
9+
ARG NETCDFFORTRAN_VERSION=4.6.1
10+
ARG PNETCDF_VERSION=1.12.1
11+
12+
ENV GCC_VERSION=${GCC_VERSION}
13+
ENV MPICH_VERSION=${MPICH_VERSION}
14+
ENV SZIP_VERSION=${SZIP_VERSION}
15+
ENV HDF5_VERSION=${HDF5_VERSION}
16+
ENV NETCDFC_VERSION=${NETCDFC_VERSION}
17+
ENV NETCDFCXX_VERSION=${NETCDFCXX_VERSION}
18+
ENV NETCDFFORTRAN_VERSION=${NETCDFFORTRAN_VERSION}
19+
ENV PNETCDF_VERSION=${PNETCDF_VERSION}
20+
21+
RUN apt-get update
22+
RUN apt-get -y upgrade
23+
RUN apt-get -y remove cmake
24+
RUN apt-get -y install software-properties-common
25+
RUN add-apt-repository universe
26+
RUN apt-get update && apt-get -y install \
27+
locales csh m4 libcurl4-openssl-dev \
28+
libz-dev gcc g++ gfortran liblapack-dev make git \
29+
git wget subversion libxml2-dev libxml2-utils libxml-libxml-perl \
30+
libswitch-perl build-essential checkinstall zlib1g-dev libssl-dev \
31+
python3-distutils python-is-python3 python3-pip python3-full
32+
33+
RUN python -m pip install netcdf4 pyyaml psutil pylint nanobind
34+
35+
RUN python -m pip cache purge
36+
RUN apt-get -y autoremove
37+
38+
# TODO: move to env file (spack.yaml)?
39+
RUN mkdir -p /opt/spack-environment \
40+
&& (echo "spack:" \
41+
&& echo " " \
42+
&& echo " definitions:" \
43+
&& echo " - compilers: [gcc@${GCC_VERSION}]" \
44+
&& echo " - mpis: [mpich@${MPICH_VERSION}]" \
45+
&& echo " - mpipkgs:" \
46+
&& echo " - hdf5@${HDF5_VERSION}" \
47+
&& echo " - netcdf-c@${NETCDFC_VERSION}" \
48+
&& echo " - netcdf-cxx@${NETCDFCXX_VERSION}" \
49+
&& echo " - netcdf-fortran@${NETCDFFORTRAN_VERSION}" \
50+
&& echo " - parallel-netcdf@${PNETCDF_VERSION}" \
51+
&& echo " - othpkgs:" \
52+
&& echo " - cmake" \
53+
&& echo " - cprnc" \
54+
&& echo " - yaml-cpp" \
55+
&& echo " - fmt" \
56+
&& echo " - spdlog" \
57+
&& echo " " \
58+
&& echo " specs:" \
59+
&& echo " - szip" \
60+
&& echo " - matrix:" \
61+
&& echo " - [\$mpis]" \
62+
&& echo " - [\$%compilers]" \
63+
&& echo " - matrix:" \
64+
&& echo " - [\$othpkgs]" \
65+
&& echo " - [\$%compilers]" \
66+
&& echo " - matrix:" \
67+
&& echo " - [\$mpipkgs]" \
68+
&& echo " - [\$^mpis]" \
69+
&& echo " - [\$%compilers]" \
70+
&& echo " " \
71+
&& echo " concretizer:" \
72+
&& echo " unify: true" \
73+
&& echo " " \
74+
&& echo " config:" \
75+
&& echo " install_tree: /opt/software" \
76+
&& echo " " \
77+
&& echo " view: /usr/local/packages" \
78+
&& echo "") > /opt/spack-environment/spack.yaml
79+
80+
# TODO: do these intervene with each other?
81+
# https://cache.spack.io/tag/v0.22.2/
82+
RUN spack mirror add v0.22.2 https://binaries.spack.io/v0.22.2
83+
RUN spack buildcache keys --install --trust
84+
# https://cache.spack.io/tag/v0.22.1/?stack=e4s
85+
RUN spack mirror add v0.22.2-e4s https://binaries.spack.io/v0.22.2/e4s
86+
RUN spack buildcache keys --install --trust
87+
# https://cache.spack.io/tag/v0.22.2/?stack=root#
88+
RUN spack mirror add v0.22.2-root https://binaries.spack.io/v0.22.2/root
89+
RUN spack buildcache keys --install --trust
90+
91+
# TODO: add e4s inventory when they support ubuntu 22.04+
92+
# # https://oaciss.uoregon.edu/e4s/inventory.html
93+
# RUN spack mirror add E4S-24.0 https://cache.e4s.io/24.0
94+
# RUN spack buildcache keys -it
95+
# RUN spack mirror add E4S https://cache.e4s.io
96+
# RUN spack buildcache keys -it
97+
98+
RUN cd /opt/spack-environment && spack env activate . && spack install --fail-fast && spack gc -y
99+
100+
RUN cd /opt/spack-environment && \
101+
spack env activate --sh -d . >> /etc/profile.d/z10_spack_environment.sh
102+
103+
ENV USER=ghciocitester
104+
105+
RUN git config --global user.email "${USER}@${USER}.${USER}"
106+
RUN git config --global user.name "${USER}"
107+
108+
ARG DEBIAN_FRONTEND=noninteractive
109+
ENV TZ=America/Los_Angeles
110+
111+
ENV LANGUAGE=en_US:en \
112+
LANG=en_US.UTF-8
113+
114+
# TODO: maybe add a test here or in the workflow?
115+
116+
ENTRYPOINT ["/bin/bash", "--rcfile", "/etc/profile", "-l"]

standalone-ghci/readme

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
The standalone-ghci container is mainly for testing eamxx standalone on github actions
2+
3+
Design notes
4+
- the container is based on ghcr.io/e3sm-project/containers-inputdata-files-standalone:main
5+
- the container relies on binary cache to accelerate builds
6+
- the container is based on gcc 11, native to ubuntu 22.04 (jammy)
7+
- the container has mpich 3.4.3, to ensure compatibility with craympich

0 commit comments

Comments
 (0)