Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
74a489a
Feat: Initial spack env.
Nov 26, 2025
76e2884
Fix: Adjusted some scripts to please the pipeline gods.
Nov 27, 2025
88991e5
Fix: Pipeline?
Nov 27, 2025
a0739a0
Fix: Replaced install-dependencies with environment.
Nov 27, 2025
2196aaa
Fix: Replaced install-dependencies with environment.
Nov 27, 2025
88a407b
Fix: Replaced install-dependencies with environment.
Nov 27, 2025
197fb44
Fix: Replaced install-dependencies with environment.
Nov 27, 2025
c03426d
Fix: Replaced install-dependencies with environment.
Nov 27, 2025
02435af
Fix: Replaced install-dependencies with environment.
Nov 27, 2025
ad4228b
Fix: Readded spack installer.
Dec 11, 2025
e6594de
Fix: Removed pinning to specific packages commit.
Dec 11, 2025
7a4a3a6
Refactor: Reverted rename.
Dec 11, 2025
bf8b6ff
Fix: Environment script spack env activation.
Dec 12, 2025
d0ee48c
Fix: Pipeline.
Dec 12, 2025
c446659
Fix: Pipeline.
Dec 12, 2025
a12133b
Fix: Readded spack packages clone.
Dec 12, 2025
b7ed110
Fix: Added SPACK_ENV env var for container ci/cd since the env is not…
Dec 12, 2025
e26f61b
Fix: Pipeline.
Dec 12, 2025
bc677f8
Fix: Container Pipeline.
Dec 12, 2025
ef55294
Fix: Container Pipeline.
Dec 12, 2025
5823906
Fix: Removed debug code.
Dec 12, 2025
70eaa7a
Refactor: Some script cleanup.
Dec 15, 2025
29b0e23
Refactor: Some script cleanup.
Dec 15, 2025
a207fda
Fix: Reconcretized lock. Added fail-fast and deprecated flags.
Dec 18, 2025
5261542
Readded commit pin. Ignored spack.lock.
Dec 19, 2025
141e9d1
Added lock.
Dec 19, 2025
9a3e4fe
Pipeline?
Dec 19, 2025
20876fd
Fix a missing script source.
Jan 2, 2026
e7fd0f0
Improved cache hash.
Jan 2, 2026
91eff72
Pipeline gdbm_prefix print.
Jan 2, 2026
8357b5a
Removed gdbm workaround.
Jan 2, 2026
5ecf468
Added debug print to ci.
Jan 2, 2026
549acaf
Added debug print to ci.
Jan 2, 2026
f2e7170
Added more debug print to ci.
Jan 2, 2026
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
11 changes: 6 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
uses: actions/cache@v4
with:
path: dependencies
key: ${{ matrix.os.dist }}-${{ matrix.os.compiler }}-${{ matrix.os.compiler_version }}-${{ hashFiles('scripts/spack', 'scripts/install-dependencies.sh') }}
key: ${{ matrix.os.dist }}-${{ matrix.os.compiler }}-${{ matrix.os.compiler_version }}-${{ hashFiles('spack.yaml', 'scripts/spack', 'scripts/install-dependencies.sh') }}
- name: Install dependencies
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
env:
Expand Down Expand Up @@ -130,12 +130,13 @@ jobs:
uses: actions/cache@v4
with:
path: /dependencies
key: ${{ matrix.os.image }}-${{ matrix.os.compiler }}-${{ matrix.os.compiler_version }}-${{ hashFiles('scripts/spack', 'scripts/install-dependencies.sh') }}
key: ${{ matrix.os.image }}-${{ matrix.os.compiler }}-${{ matrix.os.compiler_version }}-${{ hashFiles('spack.yaml', 'scripts/spack', 'scripts/install-dependencies.sh') }}
- name: Install dependencies
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
env:
JULEA_SPACK_COMPILER: ${{ matrix.os.compiler_spack }}@${{ matrix.os.compiler_version }}
JULEA_SPACK_DIR: /dependencies
JULEA_SPACK_ENV: .
run: |
./scripts/install-dependencies.sh
build:
Expand Down Expand Up @@ -187,7 +188,7 @@ jobs:
uses: actions/cache/restore@v4
with:
path: dependencies
key: ${{ matrix.os.dist }}-${{ matrix.os.compiler }}-${{ matrix.os.compiler_version }}-${{ hashFiles('scripts/spack', 'scripts/install-dependencies.sh') }}
key: ${{ matrix.os.dist }}-${{ matrix.os.compiler }}-${{ matrix.os.compiler_version }}-${{ hashFiles('spack.yaml', 'scripts/spack', 'scripts/install-dependencies.sh') }}
- name: Check dependencies
if: ${{ matrix.dependencies == 'spack' && steps.cache.outputs.cache-hit != 'true' }}
run: |
Expand Down Expand Up @@ -313,7 +314,7 @@ jobs:
uses: actions/cache/restore@v4
with:
path: dependencies
key: ${{ matrix.os.dist }}-${{ matrix.os.compiler }}-${{ matrix.os.compiler_version }}-${{ hashFiles('scripts/spack', 'scripts/install-dependencies.sh') }}
key: ${{ matrix.os.dist }}-${{ matrix.os.compiler }}-${{ matrix.os.compiler_version }}-${{ hashFiles('spack.yaml', 'scripts/spack', 'scripts/install-dependencies.sh') }}
- name: Check dependencies
if: ${{ matrix.dependencies == 'spack' && steps.cache.outputs.cache-hit != 'true' }}
run: |
Expand Down Expand Up @@ -405,7 +406,7 @@ jobs:
uses: actions/cache/restore@v4
with:
path: dependencies
key: ubuntu-24.04-gcc-13.3.0-${{ hashFiles('scripts/spack', 'scripts/install-dependencies.sh') }}
key: ubuntu-24.04-gcc-13.3.0-${{ hashFiles('spack.yaml', 'scripts/spack', 'scripts/install-dependencies.sh') }}
- name: Check dependencies
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: |
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,10 @@ bld*/

# Visual Studio Code
.vscode/

# CLion
.idea/

# Spack-Env
.spack-env/
spack.lock
5 changes: 2 additions & 3 deletions scripts/benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ SELF_BASE="${SELF_PATH##*/}"

# shellcheck source=scripts/common
. "${SELF_DIR}/common"
# shellcheck source=scripts/spack
. "${SELF_DIR}/spack"

usage ()
{
Expand Down Expand Up @@ -54,6 +52,7 @@ then
JULEA_SPACK_DIR="$(get_directory "${SELF_DIR}/..")/dependencies"
fi

spack_load_dependencies
# shellcheck source=scripts/environment.sh
. "${SELF_DIR}/environment.sh"

run_benchmark "$@"
14 changes: 5 additions & 9 deletions scripts/ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,15 @@ set -e
MODE="$1"
DEPS="$2"

GDBM_PREFIX=''

. scripts/environment.sh

if test "${DEPS}" = 'spack'
then
GDBM_PREFIX="-Dgdbm_prefix=$(spack location --install-dir gdbm)"
fi
echo "PATH=${PATH}"
command -v meson

case "${MODE}" in
release)
# shellcheck disable=SC2086
meson setup --prefix="${GITHUB_WORKSPACE}/julea-install" --buildtype=release --werror ${GDBM_PREFIX} bld
meson setup --prefix="${GITHUB_WORKSPACE}/julea-install" --buildtype=release --werror bld
ninja -C bld
ninja -C bld install
;;
Expand All @@ -44,12 +40,12 @@ case "${MODE}" in
CLANG_LUNDEF='-Db_lundef=false'
fi
# shellcheck disable=SC2086
meson setup -Db_sanitize=address,undefined ${CLANG_LUNDEF} ${GDBM_PREFIX} bld
meson setup -Db_sanitize=address,undefined ${CLANG_LUNDEF} bld
ninja -C bld
;;
coverage)
# shellcheck disable=SC2086
meson setup -Db_coverage=true -Db_sanitize=address,undefined ${GDBM_PREFIX} bld
meson setup -Db_coverage=true -Db_sanitize=address,undefined bld
ninja -C bld
;;
*)
Expand Down
16 changes: 13 additions & 3 deletions scripts/environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ SELF_BASE="${SELF_PATH##*/}"

# shellcheck source=scripts/common
. "${SELF_DIR}/common"
# shellcheck source=scripts/spack
. "${SELF_DIR}/spack"

JULEA_ENVIRONMENT_SOURCED=1

Expand Down Expand Up @@ -63,7 +61,19 @@ then
JULEA_SPACK_DIR="$(get_directory "${SELF_DIR}/..")/dependencies"
fi

spack_load_dependencies
# shellcheck source=scripts/spack
. "${SELF_DIR}/spack"

# activate spack if its installed
if spack_init
then
# Activate spack shell support.
# shellcheck source=/dev/null
. "${JULEA_SPACK_DIR}/share/spack/setup-env.sh"
# Activate spack environment.
spack env activate .
spack env status
fi

# Do not filter out paths contained in CPATH and LIBRARY_PATH.
PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1
Expand Down
5 changes: 5 additions & 0 deletions scripts/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,9 @@ then
JULEA_SPACK_DIR="$(get_directory "${SELF_DIR}/..")/dependencies"
fi

if test -z "${JULEA_SPACK_ENV}"
then
JULEA_SPACK_ENV="$(get_directory "${SELF_DIR}/..")"
fi

spack_install_dependencies
1 change: 1 addition & 0 deletions scripts/setup
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ setup_start ()
host="$(get_host "${server}")"
port="$(get_port "${server}")"

# TODO: These sometimes dont match which causes the script to silently fail. Fix this.
if test "${host}" = "${HOSTNAME}"
then
port_option=''
Expand Down
6 changes: 3 additions & 3 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ SELF_BASE="${SELF_PATH##*/}"
. "${SELF_DIR}/common"
# shellcheck source=scripts/setup
. "${SELF_DIR}/setup"
# shellcheck source=scripts/spack
. "${SELF_DIR}/spack"

usage ()
{
Expand Down Expand Up @@ -76,7 +74,9 @@ then
JULEA_SPACK_DIR="$(get_directory "${SELF_DIR}/..")/dependencies"
fi

spack_load_dependencies

# shellcheck source=scripts/environment.sh
. "${SELF_DIR}/environment.sh"

setup_init

Expand Down
125 changes: 13 additions & 112 deletions scripts/spack
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,20 @@ spack_clone ()

if test ! -d "${JULEA_SPACK_DIR}"
then
git clone --config feature.manyFiles=true https://github.com/spack/spack.git "${JULEA_SPACK_DIR}"
git clone --config feature.manyFiles=true --depth=1 --branch=releases/v1.0 https://github.com/spack/spack.git "${JULEA_SPACK_DIR}"
fi

test -d "${JULEA_SPACK_DIR}" || return 1

if test ! -d "${JULEA_SPACK_DIR}/packages"
then
git clone --config feature.manyFiles=true https://github.com/spack/spack-packages.git "${JULEA_SPACK_DIR}/packages"
git clone --config feature.manyFiles=true --branch=develop https://github.com/spack/spack-packages.git "${JULEA_SPACK_DIR}/packages"
fi

test -d "${JULEA_SPACK_DIR}/packages" || return 1

spack_set_env

(
cd "${JULEA_SPACK_DIR}" || return 1

git fetch
git checkout releases/v1.0
git reset --hard origin/releases/v1.0
)

(
cd "${JULEA_SPACK_DIR}/packages" || return 1

Expand All @@ -63,7 +55,7 @@ spack_clone ()
git reset --hard "${spack_packages_commit}"
)

spack_cmd repo set --destination "${JULEA_SPACK_DIR}/packages" builtin
spack_cmd repo set --destination "${JULEA_SPACK_DIR}/packages" builtin

return 0
}
Expand Down Expand Up @@ -99,101 +91,7 @@ spack_cmd ()
)
}

spack_load ()
{
local pkg_loaded
local spack_pkg

pkg_loaded='YES'
spack_pkg="$1"

test -n "${spack_pkg}" || return 1

spack_pkg="$(printf '%s' "${spack_pkg}" | sed 's/#/ /g')"

spack load "${spack_pkg}" || pkg_loaded='NO'

printf 'Dependency "%s" loaded: %s\n' "${spack_pkg}" "${pkg_loaded}"
}

spack_install ()
{
local spack_pkg

spack_pkg="$1"

test -n "${spack_pkg}" || return 1

spack_pkg="$(printf '%s' "${spack_pkg}" | sed 's/#/ /g')"

printf 'Installing "%s"\n' "${spack_pkg}"
# FIXME ignore errors?
spack_cmd install "${spack_pkg}"
}

spack_get_dependencies ()
{
local dependencies

dependencies=''

# Required for building JULEA
dependencies="${dependencies} meson"
dependencies="${dependencies} pkgconf"

# Mandatory dependencies
dependencies="${dependencies} glib"
dependencies="${dependencies} libbson"
dependencies="${dependencies} libfabric#fabrics=sockets,tcp,udp,verbs,rxd,rxm"

# Recommended dependencies
dependencies="${dependencies} [email protected]"
dependencies="${dependencies} libfuse~utils"
dependencies="${dependencies} lmdb"
dependencies="${dependencies} sqlite"

# Optional dependencies
# FIXME https://github.com/spack/spack-packages/pull/1109
dependencies="${dependencies} [email protected]"
dependencies="${dependencies} leveldb"
dependencies="${dependencies} mariadb-c-client"
dependencies="${dependencies} mongo-c-driver"
dependencies="${dependencies} otf"
dependencies="${dependencies} rocksdb~static"

if test -n "${CI}"
then
dependencies="${dependencies} py-gcovr"
fi

#dependencies="${dependencies} enzo@main"
#dependencies="${dependencies} mpi"

printf '%s' "${dependencies}"
}

spack_load_dependencies ()
{
if test -z "${JULEA_SPACK_DEPENDENCIES_LOADED}"
then
if spack_init
then
for dependency in $(spack_get_dependencies)
do
spack_load "${dependency}"
done

# FIXME this could be more clever by storing the actual dependencies loaded
JULEA_SPACK_DEPENDENCIES_LOADED=1

export JULEA_SPACK_DEPENDENCIES_LOADED
fi
else
printf 'Dependencies have already been loaded, skipping.\n' >&2
fi
}

spack_install_dependencies ()
spack_install_dependencies()
{
# FIXME does not fail if Git is not installed
if spack_clone
Expand Down Expand Up @@ -222,14 +120,17 @@ spack_install_dependencies ()
spack_cmd config --scope site add "packages:all:require:\"%${JULEA_SPACK_COMPILER}\""
fi

spack_cmd mark --implicit --all
spack_cmd mark --implicit --all

for dependency in $(spack_get_dependencies)
do
spack_install "${dependency}"
done
if spack_init
then
echo "Installing Spack packages"
spack env activate "${JULEA_SPACK_ENV}"
spack env status
spack install --fail-fast --deprecated
fi

spack_cmd gc --yes-to-all
spack_cmd gc --yes-to-all

if test -n "${CI}"
then
Expand Down
5 changes: 2 additions & 3 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ SELF_BASE="${SELF_PATH##*/}"

# shellcheck source=scripts/common
. "${SELF_DIR}/common"
# shellcheck source=scripts/spack
. "${SELF_DIR}/spack"

usage ()
{
Expand Down Expand Up @@ -63,6 +61,7 @@ then
JULEA_SPACK_DIR="$(get_directory "${SELF_DIR}/..")/dependencies"
fi

spack_load_dependencies
# shellcheck source=scripts/environment.sh
. "${SELF_DIR}/environment.sh"

run_test "$@"
Loading