Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 5 additions & 1 deletion .github/workflows/build-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ jobs:
with:
path: docker-output/build/ccache
key: ${{ matrix.target }}-${{ github.ref }}-${{ github.sha }}
restore-keys: ${{ matrix.target }}-${{ github.ref }}
restore-keys: |
${{ matrix.target }}-${{ github.ref }}
${{ matrix.target }}-
- name: Login to DockerHub
uses: docker/login-action@v3
Expand All @@ -61,3 +63,5 @@ jobs:
targets: ${{ matrix.target }}
files: docker-bake.hcl
push: ${{ github.ref == 'refs/heads/develop' }}
env:
GIT_BRANCH: ${{ github.head_ref || github.ref_name }}
15 changes: 12 additions & 3 deletions ci/docker/vt.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ FROM --platform=${ARCH} ${BASE} AS build
ARG BUILD_SHARED_LIBS
ARG CMAKE_BUILD_TYPE
ARG CMAKE_CXX_STANDARD
ARG GIT_BRANCH
ARG VT_ASAN_ENABLED
ARG VT_BUILD_TRACE_ONLY
ARG VT_CI_BUILD
Expand All @@ -31,6 +32,7 @@ ARG VT_PERF_ENABLED
ARG VT_POOL_ENABLED
ARG VT_PRODUCTION_BUILD_ENABLED
ARG VT_RDMA_TESTS_ENABLED
ARG VT_TEST_SPACK
ARG VT_TESTS_NUM_NODES
ARG VT_TRACE_ENABLED
ARG VT_TRACE_RUNTIME_ENABLED
Expand All @@ -49,7 +51,14 @@ if [ -d vt/docker-output/build/ccache ]; then
fi
EOF

ENV GIT_BRANCH=${GIT_BRANCH}

RUN --mount=target=/vt,rw \
/vt/ci/build_cpp.sh /vt /build && \
/vt/ci/test_cpp.sh /vt /build && \
/vt/ci/build_vt_sample.sh /vt /build
if [ "${VT_TEST_SPACK}" = "1" ]; then \
apt update -y -q && apt install -y -q libssl-dev unzip && \
/vt/ci/test_spack_package.sh; \
else \
/vt/ci/build_cpp.sh /vt /build && \
/vt/ci/test_cpp.sh /vt /build && \
/vt/ci/build_vt_sample.sh /vt /build; \
fi
34 changes: 23 additions & 11 deletions ci/test_spack_package.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
#!/usr/bin/env bash

set -exo pipefail

cur_path=$(pwd)
spack_path="$cur_path/spack"
vt_spack_package="$cur_path/spack-package"

git clone https://github.com/spack/spack.git
git clone https://github.com/DARMA-tasking/spack-package.git
git clone --branch v0.23.1 --depth=2 https://github.com/spack/spack.git
. spack/share/spack/setup-env.sh

cd "$spack_path" || exit 1
git checkout v0.16.3
cd "$cur_path" || exit 1
git clone -b master https://github.com/DARMA-tasking/spack-package.git
python3 spack-package/ci/add_vt_branch.py "${GIT_BRANCH}"

declare -A variables_map
variables_map["lb_enabled"]="${VT_LB_ENABLED:-0}"
variables_map["trace_enabled"]="${VT_TRACE_ENABLED:-0}"
variables_map["trace_only"]="${VT_BUILD_TRACE_ONLY:-0}"
variables_map["trace_only"]="${VT_BUILD_TRACE_ONLY:-1}"
variables_map["doxygen_enabled"]="${VT_DOXYGEN_ENABLED:-0}"
variables_map["mimalloc_enabled"]="${VT_MIMALLOC_ENABLED:-0}"
variables_map["asan_enabled"]="${VT_ASAN_ENABLED:-0}"
Expand All @@ -26,6 +26,7 @@ variables_map["diagnostics_enabled"]="${VT_DIAGNOSTICS_ENABLED:-0}"
variables_map["diagnostics_runtime_enabled"]="${VT_DIAGNOSTICS_RUNTIME_ENABLED:-0}"
variables_map["unity_build_enabled"]="${VT_UNITY_BUILD_ENABLED:-0}"
variables_map["fcontext_enabled"]="${VT_FCONTEXT_ENABLED:-0}"
variables_map["kokkos"]="${VT_KOKKOS_ENABLED:-0}"

cmd_vars=()
for flag in "${!variables_map[@]}"
Expand All @@ -40,16 +41,27 @@ do
done

install_cmd=$(printf " %s" "${cmd_vars[@]}")
install_cmd="$spack_path/bin/spack install darma-vt@develop build_type=Release ${install_cmd:1}"
install_cmd="spack install darma-vt@${GIT_BRANCH} build_type=Release ${install_cmd:1} ^[email protected]"

mkdir -p ~/.spack
cat >> ~/.spack/packages.yaml <<'EOF'
packages:
openmpi:
externals:
- spec: [email protected]
prefix: /usr/local
EOF

spack clean --all
spack repo add "$vt_spack_package"
spack external find

"$spack_path"/bin/spack repo add "$vt_spack_package"
"$spack_path"/bin/spack external find
$install_cmd

git clone https://github.com/DARMA-tasking/vt-sample-project
mkdir -p vt-sample-project/build
cd vt-sample-project/build || exit 1
vt_DIR=$("$spack_path"/bin/spack location --install-dir darma-vt)
vt_DIR=$(spack location --install-dir darma-vt)
export vt_DIR
cmake -G "${CMAKE_GENERATOR:-Ninja}" \
-DCMAKE_BUILD_TYPE=Release \
Expand Down
17 changes: 16 additions & 1 deletion docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ variable "REPO" {
default = "lifflander1/vt"
}

variable "GIT_BRANCH" {}

function "arch" {
params = [item]
result = lookup(item, "arch", "amd64")
Expand Down Expand Up @@ -122,6 +124,11 @@ function "vt_rdma_tests" {
result = lookup(item, "vt_rdma_tests", "")
}

function "vt_test_spack" {
params = [item]
result = lookup(item, "vt_test_spack", "0")
}

function "vt_tests_num_nodes" {
params = [item]
result = lookup(item, "vt_tests_num_nodes", "")
Expand Down Expand Up @@ -196,12 +203,13 @@ target "vt-build" {
}

target "vt-build-all" {
name = "vt-build-${replace(item.image, ".", "-")}"
name = "vt-build-${replace(item.image, ".", "-")}${vt_test_spack(item) == 1 ? "-spack" : ""}"
inherits = ["vt-build"]
tags = ["${REPO}:vt-${item.image}"]

args = {
ARCH = arch(item)
GIT_BRANCH = "${GIT_BRANCH}"
IMAGE = "wf-${item.image}"
REPO = REPO
BUILD_SHARED_LIBS = vt_build_shared_libs(item)
Expand All @@ -227,6 +235,7 @@ target "vt-build-all" {
VT_POOL_ENABLED = vt_pool(item)
VT_PRODUCTION_BUILD_ENABLED = vt_production_build(item)
VT_RDMA_TESTS_ENABLED = vt_rdma_tests(item)
VT_TEST_SPACK = vt_test_spack(item)
VT_TESTS_NUM_NODES = vt_tests_num_nodes(item)
VT_TRACE_ENABLED = vt_trace(item)
VT_TRACE_RUNTIME_ENABLED = vt_trace_runtime(item)
Expand Down Expand Up @@ -266,6 +275,12 @@ target "vt-build-all" {
vt_lb = 0
vt_tests_num_nodes = 4
},
{
image = "amd64-ubuntu-20.04-gcc-10-openmpi-cpp"
vt_lb = 1
vt_trace_only = 1
vt_test_spack = 1
},
{
image = "amd64-ubuntu-20.04-gcc-9-cpp"
},
Expand Down
Loading