Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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: 4 additions & 2 deletions .github/workflows/build-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
id: list-targets
uses: docker/bake-action/subaction/list-targets@v6
with:
target: vt-build-all
target: vt-pull-request

bake:
runs-on: ubuntu-latest
Expand All @@ -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 Down
52 changes: 52 additions & 0 deletions .github/workflows/develop-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Develop CI

on:
push:
branches:
- develop

jobs:
prepare:
runs-on: ubuntu-latest
outputs:
targets: ${{ steps.list-targets.outputs.targets }}

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

- name: List targets
id: list-targets
uses: docker/bake-action/subaction/list-targets@v6
with:
target: vt-develop

bake:
needs:
- prepare
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: ${{ fromJson(needs.prepare.outputs.targets) }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- uses: actions/cache@v4
with:
path: docker-output/build/ccache
key: ${{ matrix.target }}-${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ matrix.target }}-${{ github.ref }}
${{ matrix.target }}-

- name: Build
uses: docker/bake-action@v6
with:
source: .
targets: ${{ matrix.target }}
files: docker-bake.hcl
12 changes: 9 additions & 3 deletions ci/docker/vt.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,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 @@ -50,6 +51,11 @@ fi
EOF

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
33 changes: 22 additions & 11 deletions ci/test_spack_package.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
#!/usr/bin/env bash

set -euo 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

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 +25,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 +40,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@develop 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
51 changes: 50 additions & 1 deletion docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,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,7 +201,7 @@ 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}"]

Expand Down Expand Up @@ -227,6 +232,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 +272,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 Expand Up @@ -366,3 +378,40 @@ target "vt-build-all" {
]
}
}


group "vt-pull-request" {
targets = [
"vt-build-amd64-alpine-3-16-clang-cpp",
"vt-build-amd64-ubuntu-20-04-clang-10-cpp",
"vt-build-amd64-ubuntu-20-04-clang-9-cpp",
"vt-build-amd64-ubuntu-20-04-gcc-10-cpp",
"vt-build-amd64-ubuntu-20-04-gcc-10-openmpi-cpp",
"vt-build-amd64-ubuntu-20-04-gcc-9-cpp",
"vt-build-amd64-ubuntu-20-04-gcc-9-cuda-11-4-3-cpp",
"vt-build-amd64-ubuntu-20-04-gcc-9-cuda-12-2-0-cpp",
"vt-build-amd64-ubuntu-20-04-icpx-cpp",
"vt-build-amd64-ubuntu-22-04-clang-11-cpp",
"vt-build-amd64-ubuntu-22-04-clang-12-cpp",
"vt-build-amd64-ubuntu-22-04-clang-13-cpp",
"vt-build-amd64-ubuntu-22-04-clang-14-cpp",
"vt-build-amd64-ubuntu-22-04-clang-15-cpp",
"vt-build-amd64-ubuntu-22-04-gcc-11-cpp",
"vt-build-amd64-ubuntu-22-04-gcc-12-cpp",
"vt-build-amd64-ubuntu-22-04-gcc-12-vtk-cpp",
"vt-build-amd64-ubuntu-22-04-gcc-12-zoltan-cpp",
"vt-build-amd64-ubuntu-24-04-clang-16-cpp",
"vt-build-amd64-ubuntu-24-04-clang-16-vtk-cpp",
"vt-build-amd64-ubuntu-24-04-clang-16-zoltan-cpp",
"vt-build-amd64-ubuntu-24-04-clang-17-cpp",
"vt-build-amd64-ubuntu-24-04-clang-18-cpp",
"vt-build-amd64-ubuntu-24-04-gcc-13-cpp",
"vt-build-amd64-ubuntu-24-04-gcc-14-cpp",
]
}

group "vt-develop" {
targets = [
"vt-build-amd64-ubuntu-20-04-gcc-10-openmpi-cpp-spack",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really want to test spack package only on develop? 🤔
We could probably change spack install darma-vt@develop to use branch. Are there any other limitations / concerns?

Copy link
Member Author

@JacobDomagala JacobDomagala Jul 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I understand you can only build package with one of the declared versions/branches inside package.py.
In our case it is:

  • 1.0.0
  • 1.5.0
  • develop

https://github.com/DARMA-tasking/spack-package/blob/master/packages/darma-vt/package.py#L59-L61

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, this was probably the reason for setting the build up this way.

Copy link
Member Author

@JacobDomagala JacobDomagala Jul 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we really want to test per branch, we could create a script that modifies the package.py to temporarily include version('branch_name', branch='branch_name')

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, it seems to be working!

]
}