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

Build/test/release with a container action #115

Merged
merged 19 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
cf26575
Build the base image for building/testing step-by-step
yzhang-23 Aug 15, 2023
e59033f
Committing license headers
Aug 15, 2023
f1c08d6
Container action added to build/test repo using base image
yzhang-23 Aug 22, 2023
addf3be
Container action added to build/test repo using base image
yzhang-23 Aug 22, 2023
b8789d0
Merge addf3be538193430256536513d11e9b777a29300 into deaed24606b920919…
yzhang-23 Aug 22, 2023
56be123
Committing license headers
Aug 22, 2023
4b626de
Container action added to build/test repo using base image
yzhang-23 Aug 22, 2023
69a0e54
Merge branch 'base_image_build' of https://github.com/NWChemEx-Projec…
yzhang-23 Aug 22, 2023
2f77d5f
Committing clang-format changes
Aug 22, 2023
e542c8a
Container action added to build/test repo using base image
yzhang-23 Aug 22, 2023
c516533
Merge branch 'base_image_build' of https://github.com/NWChemEx-Projec…
yzhang-23 Aug 22, 2023
94315c6
Container action added to build/test repo using base image
yzhang-23 Aug 22, 2023
03a375c
Container action added to build/test repo using base image
yzhang-23 Aug 22, 2023
060ea4c
Container action added to build/test repo using base image
yzhang-23 Aug 22, 2023
6cb1216
Container action added to build/test repo using base image
yzhang-23 Aug 23, 2023
938aff1
Container action added to build/test repo using base image
yzhang-23 Aug 23, 2023
fb84f3b
Container action added to build/test repo using base image
yzhang-23 Aug 23, 2023
bfec31d
Container action added to build/test repo using base image
yzhang-23 Aug 24, 2023
d083b9f
Container action added to build/test repo using base image
yzhang-23 Aug 24, 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
148 changes: 148 additions & 0 deletions .github/workflows/build_base.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
# manually input version no.s here
# will check in workflows to obtain
# this info from other files
#

name: Build base image

on:
workflow_call:
inputs:
cmake_version:
type: string
required: false
default: 3.17.0
ryanmrichard marked this conversation as resolved.
Show resolved Hide resolved
gcc_version:
type: string
required: false
default: 9
clang_version:
type: string
required: false
default: 11
ubuntu_version:
type: string
required: false
default: 20.04
madness_version:
type: string
required: false
default: 997e8b458c4234fb6c8c2781a5df59cb14b7e700
catch2_version:
type: string
required: false
default: 2.13.8
spdlog_version:
type: string
required: false
default: ad0e89cbfb4d0c1ce4d097e134eb7be67baebb36
cereal_version:
type: string
required: false
default: 1.3.0
workflow_dispatch:
inputs:
cmake_version:
yzhang-23 marked this conversation as resolved.
Show resolved Hide resolved
type: string
required: false
default: 3.17.0
gcc_version:
type: string
required: false
default: 9
clang_version:
type: string
required: false
default: 11
ubuntu_version:
type: string
required: false
default: 20.04
madness_version:
type: string
required: false
default: 997e8b458c4234fb6c8c2781a5df59cb14b7e700
catch2_version:
type: string
required: false
default: 2.13.8
spdlog_version:
type: string
required: false
default: ad0e89cbfb4d0c1ce4d097e134eb7be67baebb36
cereal_version:
type: string
required: false
default: 1.3.0

jobs:
build-image-gcc-clang-cmake:
uses: NWChemEx-Project/.github/.github/workflows/base_image_gcc-clang-cmake.yaml@master
with:
cmake_version: ${{ inputs.cmake_version }}
gcc_version: ${{ inputs.gcc_version }}
clang_version: ${{ inputs.clang_version }}
ubuntu_version: ${{ inputs.ubuntu_version }}
secrets: inherit

build-base-image:
runs-on: ubuntu-latest
needs: build-image-gcc-clang-cmake
steps:
- uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.CONTAINER_REPO_TOKEN }}
- name: Install MADNESS and MPI
uses: NWChemEx-Project/.github/actions/install_package@master
with:
madness_version: ${{ inputs.madness_version }}
package_name: madness
parent_image_name: ghcr.io/nwchemex-project/base-cmake
- name: Install spdlog
uses: NWChemEx-Project/.github/actions/install_package@master
with:
spdlog_version: ${{ inputs.spdlog_version }}
package_name: spdlog
parent_image_name: base-madness
- name: Install cereal
uses: NWChemEx-Project/.github/actions/install_package@master
with:
cereal_version: ${{ inputs.cereal_version }}
package_name: cereal
parent_image_name: base-spdlog
- name: Install catch2
uses: NWChemEx-Project/.github/actions/install_package@master
with:
catch2_version: ${{ inputs.catch2_version }}
package_name: catch2
parent_image_name: base-cereal
- name: Push the base image
uses: NWChemEx-Project/.github/actions/push_package@master
with:
tmp_image_name: base-catch2
tmp_image_tag: latest
image_name: ghcr.io/nwchemex-project/base_parallelzone
image_tag: latest
- name: Check stable release image
id: image_exists
uses: cloudposse/github-action-docker-image-exists@main
with:
image_name: nwchemex-project/base_parallelzone
registry: ghcr.io
organization: "${{ github.event.repository.owner.login }}"
repository: "${{ github.event.repository.name }}"
login: ${{ github.actor }}
password: "${{ secrets.CONTAINER_REPO_TOKEN }}"
tag: stable
- name: Push stable release image if not exist
if: ${{ steps.image_exists.conclusion != 'success' }}
uses: NWChemEx-Project/.github/actions/push_image@master
with:
tmp_image_name: ghcr.io/nwchemex-project/base_parallelzone
tmp_image_tag: latest
image_name: ghcr.io/nwchemex-project/base_parallelzone
image_tag: stable
28 changes: 28 additions & 0 deletions Dockerfile/base-catch2.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2023 NWChemEx-Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

ARG PARENT_IMAGE_NAME

FROM ${PARENT_IMAGE_NAME}:latest

ARG CATCH2_VERSION

# Install catch2 ##
RUN cd /tmp \
&& git clone -b v${CATCH2_VERSION} https://github.com/catchorg/Catch2.git \
&& cd Catch2 \
&& cmake -Bbuild -H. -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=/install \
&& cmake --build build \
&& cmake --build build --target install \
&& rm -rf /tmp/Catch2
31 changes: 31 additions & 0 deletions Dockerfile/base-cereal.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright 2023 NWChemEx-Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

ARG PARENT_IMAGE_NAME

FROM ${PARENT_IMAGE_NAME}:latest

ARG CEREAL_VERSION

# Install cereal
RUN cd /tmp \
&& git clone https://github.com/USCiLab/cereal.git \
&& cd cereal \
&& git checkout tags/v${CEREAL_VERSION} \
&& export BUILD_TARGET=cereal \
&& export FIND_TARGET=cereal \
&& cmake -DJUST_INSTALL_CEREAL=ON -DCMAKE_INSTALL_PREFIX=/install -Bbuild . \
&& cmake --build build \
&& cmake --build build --target install \
&& rm -rf /tmp/cereal
36 changes: 36 additions & 0 deletions Dockerfile/base-madness.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright 2023 NWChemEx-Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

ARG PARENT_IMAGE_NAME

FROM ${PARENT_IMAGE_NAME}:latest

# Install mpi
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
openmpi-bin \
libopenmpi-dev
ARG MADNESS_VERSION

# Install MADNESS
RUN cd /tmp \
&& git clone https://github.com/m-a-d-n-e-s-s/madness.git \
&& cd madness \
&& git checkout ${MADNESS_VERSION} \
&& export BUILD_TARGET=MADworld \
&& export FIND_TARGET=MADworld \
&& cmake -DENABLE_UNITTESTS=OFF -DMADNESS_BUILD_MADWORLD_ONLY=ON -DMADNESS_ENABLE_CEREAL=ON -DENABLE_MKL=OFF -DENABLE_ACML=OFF -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=/install -Bbuild . \
&& cmake --build build \
&& cmake --build build --target install \
&& rm -rf /tmp/madness
31 changes: 31 additions & 0 deletions Dockerfile/base-spdlog.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright 2023 NWChemEx-Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

ARG PARENT_IMAGE_NAME

FROM ${PARENT_IMAGE_NAME}:latest

ARG SPDLOG_VERSION

# Install spdlog
RUN cd /tmp \
&& git clone https://github.com/gabime/spdlog.git \
&& cd spdlog \
&& git checkout ${SPDLOG_VERSION} \
&& export BUILD_TARGET=spdlog \
&& export FIND_TARGET=spdlog::spdlog \
&& cmake -DSPDLOG_INSTALL=ON -DCMAKE_INSTALL_PREFIX=/install -DCMAKE_CXX_FLAGS="-fPIC" -Bbuild . \
&& cmake --build build \
&& cmake --build build --target install \
&& rm -rf /tmp/spdlog
19 changes: 19 additions & 0 deletions Dockerfile/build_tmp.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2023 NWChemEx-Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

ARG btag

###

FROM ghcr.io/nwchemex-ci-test/base_parallelzone:$btag
16 changes: 16 additions & 0 deletions Dockerfile/release.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2023 NWChemEx-Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM ubuntu:20.04
ADD install /install