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 18 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
28 changes: 28 additions & 0 deletions .github/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 .github/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 .github/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 .github/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
5 changes: 5 additions & 0 deletions .github/Dockerfile/build_tmp.Dockerfile.old
yzhang-23 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ARG btag

###

FROM ghcr.io/nwchemex-ci-test/base_parallelzone:$btag
2 changes: 2 additions & 0 deletions .github/Dockerfile/release.Dockerfile.old
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM ubuntu:20.04
ADD install /install
24 changes: 24 additions & 0 deletions .github/actions/container-build_test_release/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 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 alpine:latest

COPY docker-action /docker-action
COPY entrypoint.sh /entrypoint.sh

RUN apk add --update --no-cache docker
RUN ["chmod", "+x", "/entrypoint.sh"]

# Code file to execute when the docker container starts up (`entrypoint.sh`)
ENTRYPOINT ["/entrypoint.sh"]
79 changes: 79 additions & 0 deletions .github/actions/container-build_test_release/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# 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.

name: container action to build ParallelZone

description: container action from the base image to build ParallelZone

inputs:
base_tag:
description: 'tag of the base image'
required: false
default: 'stable'
token:
type: string
required: true
user:
type: string
required: true
cmake_version:
type: string
required: false
default: ''
gcc_version:
type: string
required: false
default: ''
clang_version:
type: string
required: false
default: ''
yzhang-23 marked this conversation as resolved.
Show resolved Hide resolved
ninja_build:
type: boolean
required: true
use_clang:
type: boolean
required: true
CMAIZE_GITHUB_TOKEN:
type: string
required: true
INSTALL:
type: boolean
required: true
test:
type: boolean
required: true
integration_test:
type: boolean
required: true
branch_name:
type: string
required: true
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.token }} # 1
- ${{ inputs.user }} # 2
- ${{ inputs.base_tag }} # 3
- ${{ inputs.cmake_version }} # 4
- ${{ inputs.gcc_version }} # 5
- ${{ inputs.clang_version }} # 6
- ${{ inputs.ninja_build }} # 7
- ${{ inputs.use_clang }} # 8
- ${{ inputs.CMAIZE_GITHUB_TOKEN }} # 9
- ${{ inputs.INSTALL }} # 10
- ${{ inputs.test }} # 11
- ${{ inputs.integration_test }} # 12
- ${{ inputs.branch_name }} # 13
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# 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 base_tag

FROM ghcr.io/nwchemex-project/base_parallelzone:$base_tag

COPY build_test.sh /build_test.sh

RUN ["chmod", "+x", "/build_test.sh"]

ARG cmake_version
ARG gcc_version
ARG clang_version
ARG ninja_build
ARG use_clang
ARG cmaize_github_token
ARG install
ARG unit_test
ARG int_test
ARG branch_name

ENV env_cmake_version=$cmake_version
ENV env_gcc_version=$gcc_version
ENV env_clang_version=$clang_version
ENV env_ninja_build=$ninja_build
ENV env_use_clang=$use_clang
ENV env_cmaize_github_token=$cmaize_github_token
ENV env_install=$install
ENV env_unit_test=$unit_test
ENV env_int_test=$int_test
ENV env_branch_name=$branch_name

ENTRYPOINT ["/build_test.sh"]
Loading