Skip to content
Open
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
67 changes: 67 additions & 0 deletions container/buildcache.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Multi-stage variant of ./Dockerfile.
#
# Instead of pulling a prebuilt buildcache, this builds the buildcache
# locally from container/spack.yaml in a "builder" stage, then copies
# it into the tutorial image. Use it to try out new specs: edit
# container/spack.yaml and rebuild.
#
# docker build -f container/buildcache.dockerfile -t tutorial:experimental container
#

# ---- stage 1: build the buildcache ----
FROM ghcr.io/spack/tutorial-ubuntu-26.04:v2026-06-09 AS builder

ENV DEBIAN_FRONTEND=noninteractive
ENV SPACK_ROOT=/spack/spack
ENV PATH=$SPACK_ROOT/bin:$PATH
ENV SPACK_COMMIT=63943396d634faa92cb59474df3558ec9b9b2425
ENV SPACK_PACKAGES_COMMIT=688a7045fbcaea7b4965ac51e266408a0b591b9d

# Base image has no spack, so clone it and pin to a specific commit.
RUN git clone --depth 1 https://github.com/spack/spack.git $SPACK_ROOT && \
git -C $SPACK_ROOT fetch --depth 1 origin $SPACK_COMMIT && \
git -C $SPACK_ROOT checkout $SPACK_COMMIT

# Pin the builtin package repository to a specific commit.
RUN spack repo update builtin --commit $SPACK_PACKAGES_COMMIT

COPY spack.yaml /opt/spack-environment/spack.yaml

RUN --mount=type=cache,target=/home/software/spack \
spack -e /opt/spack-environment concretize -f && \
spack -e /opt/spack-environment install --fail-fast

RUN --mount=type=cache,target=/home/software/spack \
spack -e /opt/spack-environment buildcache push --unsigned --update-index /mirror && \
chmod -R go+r /mirror

# ---- stage 2: the tutorial image ----
FROM ghcr.io/spack/tutorial-ubuntu-26.04:v2026-06-09

ENV DEBIAN_FRONTEND=noninteractive

# Same tooling as ./Dockerfile, minus rclone (no longer needed).
RUN apt-get update -y && \
apt-get install -y --no-install-recommends \
bash-completion \
ca-certificates \
emacs \
jq \
less \
vim

# Bring in the buildcache produced by the builder stage.
COPY --from=builder /mirror /mirror

COPY packages.yaml /etc/spack/packages.yaml
COPY config.yaml /etc/spack/config.yaml
COPY concretizer.yaml /etc/spack/concretizer.yaml

RUN useradd -ms /bin/bash spack && \
chmod -R go+r /etc/spack

USER spack

WORKDIR /home/spack

ENTRYPOINT [ "bash" ]
80 changes: 80 additions & 0 deletions container/spack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
spack:
view: false

packages:
all:
require:
- target=x86_64_v3
tbb:
require: intel-tbb

specs:
- group: compiler
specs:
- gcc@16 build_type=Release +profiled +strip

- group: "gcc@15 specs"
specs:
- zlib-ng@2.2.4
- zlib-ng@2.0.7
- zlib-ng +ipo
- zlib-ng build_type=Debug
- zlib-ng %clang
- tcl ^zlib-ng@2.2.4
- tcl ^zlib-ng@2.0.7 %clang
- tcl ^zlib-ng %gcc@14
- hdf5+mpi^openmpi
- hdf5~mpi
- hdf5+hl+mpi ^mpich
- trilinos ^openmpi
- trilinos +hdf5 ^hdf5+hl+mpi ^mpich
- mpileaks
- lmod@8.7.67
- environment-modules
- macsio@1.1+scr ^scr@2.0.0~fortran ^silo~fortran ^hdf5~fortran
- julia ^llvm ~clang ~gold ~lldb ~lua ~polly compiler-rt=none libcxx=none libunwind=none targets=x86 ^openblas threads=openmp
- vim
override:
packages:
c:
prefer: [gcc@15]
cxx:
prefer: [gcc@15]
fortran:
prefer: [gcc@15]

- group: scalapacks
needs: [compiler]
specs:
- matrix:
- [netlib-scalapack]
- [^mpich, ^openmpi]
- [^openblas, ^netlib-lapack]
- matrix:
- [py-scipy ^openblas, armadillo ^openblas, netlib-lapack, openmpi, mpich, elpa ^mpich]
override:
packages:
c:
prefer: [gcc@16]
cxx:
prefer: [gcc@16]
fortran:
prefer: [gcc@16]

concretizer:
unify: false
reuse: false
targets:
granularity: generic

config:
installer: new
misc_cache: "$user_cache_path/cache"
db_lock_timeout: 120
shared_linking:
missing_library_policy: warn
install_tree:
root: /home/software/spack
padded_length: 256
projections:
all: "{architecture.platform}-{architecture.target}/{name}-{version}-{hash}"
12 changes: 6 additions & 6 deletions outputs/basics/clone.out
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
$ git clone --depth=2 --branch=releases/v1.1 https://github.com/spack/spack.git ~/spack
Cloning into '/home/spack/spack'...
remote: Enumerating objects: 2340, done.K
remote: Counting objects: 100% (2340/2340), done.K
remote: Compressing objects: 100% (1583/1583), done.K
remote:nTotale2340 (delta2311),3reused 1329 (delta 237), pack-reused 0 (from 0)K
Receiving objects: 100% (2340/2340), 5.30 MiB | 20.25 MiB/s, done.
Resolving deltas: 100% (311/311), done.
remote: Enumerating objects: 2343, done.K
remote: Counting objects: 100% (2343/2343), done.K
remote: Compressing objects: 100% (1589/1589), done.K
remote:nTotale2343 (delta2309),3reused 1265 (delta 234), pack-reused 0 (from 0)K
Receiving objects: 100% (2343/2343), 5.32 MiB | 18.72 MiB/s, done.
Resolving deltas: 100% (309/309), done.
$ cd ~/spack
18 changes: 9 additions & 9 deletions outputs/basics/find-ldf-2.out
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
$ spack find -ldf
-- linux-ubuntu22.04-x86_64 / no compilers ----------------------
rpw3buk gcc@11.4.0
4xgkopt gcc@11.4.0

vjnqll7 glibc@2.35
jfjsr3p glibc@2.35


-- linux-ubuntu22.04-x86_64_v3 / %c,cxx,fortran=gcc@11.4.0 ------
Expand Down Expand Up @@ -637,11 +637,11 @@ c6d2zlj readline@8.3
ncdxq3j ncurses@6.5-20250705
f4qiprw pkgconf@2.5.1

vsq3oi3 gmake@4.4.1
ikkzcak gmake@4.4.1
ntccuj2 compiler-wrapper@1.0
rpw3buk gcc@11.4.0
qmbrryi gcc-runtime@11.4.0
vjnqll7 glibc@2.35
4xgkopt gcc@11.4.0
dr7kup4 gcc-runtime@11.4.0
jfjsr3p glibc@2.35

4obn7cg gmake@4.4.1
ntccuj2 compiler-wrapper@1.0
Expand Down Expand Up @@ -1240,9 +1240,9 @@ ahapkrs gcc-runtime@10.5.0
ntkvysy gcc@10.5.0
qg7qyaz glibc@2.35

qmbrryi gcc-runtime@11.4.0
rpw3buk gcc@11.4.0
vjnqll7 glibc@2.35
dr7kup4 gcc-runtime@11.4.0
4xgkopt gcc@11.4.0
jfjsr3p glibc@2.35

nokfxva gcc-runtime@11.4.0
ml7cem5 gcc@11.4.0
Expand Down
18 changes: 9 additions & 9 deletions outputs/basics/find-ldf.out
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
$ spack find -ldf
-- linux-ubuntu22.04-x86_64 / no compilers ----------------------
rpw3buk gcc@11.4.0
4xgkopt gcc@11.4.0

vjnqll7 glibc@2.35
jfjsr3p glibc@2.35


-- linux-ubuntu22.04-x86_64_v3 / %c,cxx=clang@14.0.0 ------------
Expand Down Expand Up @@ -82,11 +82,11 @@ qg7qyaz glibc@2.35


-- linux-ubuntu22.04-x86_64_v3 / %c=gcc@11.4.0 ------------------
vsq3oi3 gmake@4.4.1
ikkzcak gmake@4.4.1
ntccuj2 compiler-wrapper@1.0
rpw3buk gcc@11.4.0
qmbrryi gcc-runtime@11.4.0
vjnqll7 glibc@2.35
4xgkopt gcc@11.4.0
dr7kup4 gcc-runtime@11.4.0
jfjsr3p glibc@2.35

4obn7cg gmake@4.4.1
ntccuj2 compiler-wrapper@1.0
Expand All @@ -106,9 +106,9 @@ ahapkrs gcc-runtime@10.5.0
ntkvysy gcc@10.5.0
qg7qyaz glibc@2.35

qmbrryi gcc-runtime@11.4.0
rpw3buk gcc@11.4.0
vjnqll7 glibc@2.35
dr7kup4 gcc-runtime@11.4.0
4xgkopt gcc@11.4.0
jfjsr3p glibc@2.35

nokfxva gcc-runtime@11.4.0
ml7cem5 gcc@11.4.0
Expand Down
6 changes: 3 additions & 3 deletions outputs/basics/find-lf.out
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$ spack find -lf
-- linux-ubuntu22.04-x86_64 / no compilers ----------------------
rpw3buk gcc@11.4.0 vjnqll7 glibc@2.35
4xgkopt gcc@11.4.0 jfjsr3p glibc@2.35

-- linux-ubuntu22.04-x86_64_v3 / %c,cxx=clang@14.0.0 ------------
um7p6tr zlib-ng@2.0.7 ct2r7xm zlib-ng@2.2.4
Expand All @@ -15,10 +15,10 @@ qlavhjb zlib-ng@2.0.7 cflags=-O3
ufbescp gmake@4.4.1

-- linux-ubuntu22.04-x86_64_v3 / %c=gcc@11.4.0 ------------------
vsq3oi3 gmake@4.4.1 4obn7cg gmake@4.4.1
ikkzcak gmake@4.4.1 4obn7cg gmake@4.4.1

-- linux-ubuntu22.04-x86_64_v3 / no compilers -------------------
ntccuj2 compiler-wrapper@1.0 ahapkrs gcc-runtime@10.5.0 qg7qyaz glibc@2.35
ntkvysy gcc@10.5.0 qmbrryi gcc-runtime@11.4.0 qr2e4rd llvm@14.0.0
ntkvysy gcc@10.5.0 dr7kup4 gcc-runtime@11.4.0 qr2e4rd llvm@14.0.0
ml7cem5 gcc@11.4.0 nokfxva gcc-runtime@11.4.0
==> 17 installed packages
2 changes: 1 addition & 1 deletion outputs/basics/find-px.out
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ tcl@8.6.17 /home/spack/spack/opt/spack/linux-x86_64_v3/tcl-8.6.17-tsq4fjjw2p
zlib-ng@2.0.7 /home/spack/spack/opt/spack/linux-x86_64_v3/zlib-ng-2.0.7-qlavhjbsgqyboovfvsultjdwzz5nvthw

-- linux-ubuntu22.04-x86_64_v3 / %c=gcc@11.4.0 ------------------
gmake@4.4.1 /home/spack/spack/opt/spack/linux-x86_64_v3/gmake-4.4.1-vsq3oi374trwzuwcxzutihi2zbxrhosh
gmake@4.4.1 /home/spack/spack/opt/spack/linux-x86_64_v3/gmake-4.4.1-ikkzcakbjrn76u5l3eavzliyjhrdvagn
hdf5@1.14.6 /home/spack/spack/opt/spack/linux-x86_64_v3/hdf5-1.14.6-7mm6knnnjxquabuuhme4sjpe6d6vfawh
hdf5@1.14.6 /home/spack/spack/opt/spack/linux-x86_64_v3/hdf5-1.14.6-vllfzb7aaz52qw5k2rkqq64glpglw5gv
hdf5@1.14.6 /home/spack/spack/opt/spack/linux-x86_64_v3/hdf5-1.14.6-gdk3ghc3gh5rpxoztushxjuvto5prlqd
Expand Down
30 changes: 15 additions & 15 deletions outputs/basics/gmake.out
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
$ spack install gmake
==> Compilers have been configured automatically from PATH inspection
[+] /usr (external gcc-11.4.0-rpw3bukiasa3mhgh2vbz6tlwb5smfg3w)
[+] /usr (external glibc-2.35-vjnqll7uhrmsms4z5opdvczk7riv6fs5)
[+] /usr (external gcc-11.4.0-4xgkoptcicxn25t4t6n3zp4ujbdn7pgo)
[+] /usr (external glibc-2.35-jfjsr3pnnii2tcvxku73bl5apu6jxfct)
==> No binary for compiler-wrapper-1.0-ntccuj2fi3y7asqifeq3i4iylrbxakw2 found: installing from source
==> Installing compiler-wrapper-1.0-ntccuj2fi3y7asqifeq3i4iylrbxakw2 [3/5]
==> Fetching https://mirror.spack.io/_source-cache/archive/a5/a5ff4fcdbeda284a7993b87f294b6338434cffc84ced31e4d04008ed5ea389bf
[100%] 30.08 KB @ 185.8 MB/s
[100%] 30.08 KB @ 57.3 MB/s
==> No patches needed for compiler-wrapper
==> compiler-wrapper: Executing phase: 'install'
==> compiler-wrapper: Successfully installed compiler-wrapper-1.0-ntccuj2fi3y7asqifeq3i4iylrbxakw2
Stage: 0.15s. Install: 0.01s. Post-install: 0.01s. Total: 0.18s
Stage: 0.09s. Install: 0.00s. Post-install: 0.01s. Total: 0.13s
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/compiler-wrapper-1.0-ntccuj2fi3y7asqifeq3i4iylrbxakw2
==> No binary for gcc-runtime-11.4.0-qmbrryiepg5ww5i2bujmli7i22dmwqju found: installing from source
==> Installing gcc-runtime-11.4.0-qmbrryiepg5ww5i2bujmli7i22dmwqju [4/5]
==> No binary for gcc-runtime-11.4.0-dr7kup45zat5rlc3hfgnyu2xliolb5v5 found: installing from source
==> Installing gcc-runtime-11.4.0-dr7kup45zat5rlc3hfgnyu2xliolb5v5 [4/5]
==> No patches needed for gcc-runtime
==> gcc-runtime: Executing phase: 'install'
==> gcc-runtime: Successfully installed gcc-runtime-11.4.0-qmbrryiepg5ww5i2bujmli7i22dmwqju
Stage: 0.00s. Install: 0.05s. Post-install: 0.03s. Total: 0.09s
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/gcc-runtime-11.4.0-qmbrryiepg5ww5i2bujmli7i22dmwqju
==> No binary for gmake-4.4.1-vsq3oi374trwzuwcxzutihi2zbxrhosh found: installing from source
==> Installing gmake-4.4.1-vsq3oi374trwzuwcxzutihi2zbxrhosh [5/5]
==> gcc-runtime: Successfully installed gcc-runtime-11.4.0-dr7kup45zat5rlc3hfgnyu2xliolb5v5
Stage: 0.00s. Install: 0.04s. Post-install: 0.03s. Total: 0.09s
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/gcc-runtime-11.4.0-dr7kup45zat5rlc3hfgnyu2xliolb5v5
==> No binary for gmake-4.4.1-ikkzcakbjrn76u5l3eavzliyjhrdvagn found: installing from source
==> Installing gmake-4.4.1-ikkzcakbjrn76u5l3eavzliyjhrdvagn [5/5]
==> Fetching https://mirror.spack.io/_source-cache/archive/dd/dd16fb1d67bfab79a72f5e8390735c49e3e8e70b4945a15ab1f81ddb78658fb3.tar.gz
[100%] 62.35 MB @ 163.0 MB/s
[100%] 62.35 MB @ 113.1 MB/s
==> No patches needed for gmake
==> gmake: Executing phase: 'install'
==> gmake: Successfully installed gmake-4.4.1-vsq3oi374trwzuwcxzutihi2zbxrhosh
Stage: 0.24s. Install: 10.47s. Post-install: 0.01s. Total: 10.73s
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/gmake-4.4.1-vsq3oi374trwzuwcxzutihi2zbxrhosh
==> gmake: Successfully installed gmake-4.4.1-ikkzcakbjrn76u5l3eavzliyjhrdvagn
Stage: 0.19s. Install: 10.48s. Post-install: 0.01s. Total: 10.70s
[+] /home/spack/spack/opt/spack/linux-x86_64_v3/gmake-4.4.1-ikkzcakbjrn76u5l3eavzliyjhrdvagn
Loading