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: 2 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
style: ${{ steps.filter.outputs.style }}

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # @v2
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # @v2
if: ${{ github.event_name == 'push' }}
with:
fetch-depth: 0
Expand All @@ -51,10 +51,8 @@ jobs:
uses: ./.github/workflows/container.yml

outputs:
# Output regeneration temporarily disabled — remove the `false` line below to re-enable.
if: |
false
&& !cancelled()
!cancelled()
&& contains(needs.*.result, 'success')
&& !contains(needs.*.result, 'failure')
&& (needs.changes.outputs.outputs == 'true'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ jobs:

steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf
uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3

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

- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand All @@ -36,7 +36,7 @@ jobs:
type=raw,value={{tag}}

- name: Build & Push
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf
env:
DOCKER_BUILD_SUMMARY: false
DOCKER_BUILD_RECORD_UPLOAD: false
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/outputs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ jobs:
steps:
- name: Checkout (Push)
if: github.event_name != 'pull_request'
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
with:
ref: ${{ github.head_ref }}

- name: Checkout (PR)
if: github.event_name == 'pull_request'
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}

- name: Download container from artifact if PR
if: github.event_name == 'pull_request' && inputs.with_pr_container
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
with:
name: tutorial-container
path: /tmp
Expand All @@ -43,19 +43,19 @@ jobs:
- name: Re-generate outputs from tutorial scripts
run: |
chmod -R a+w outputs
mkdir spack-home && sudo chown -R 1000:1000 spack-home
mkdir spack-home && sudo chmod -R a+rwx spack-home
DOCKER_RUN_OPTS="-e COLUMNS=94 -e COLIFY_SIZE=24x94 -v $(pwd)/spack-home:/home/spack"
make -C outputs -j $(nproc) DOCKER_RUN_OPTS="$DOCKER_RUN_OPTS" container=ghcr.io/spack/tutorial

- name: Show diff of modified files
run: |
git diff HEAD outputs/

- name: Push modified files to branch
if: ( github.event_name == 'pull_request' && ! github.event.pull_request.head.repo.fork )
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add outputs/
git commit -m "Update generated outputs on behalf of [@${{ github.actor }}]"
git push
# - name: Push modified files to branch
# if: ( github.event_name == 'pull_request' && ! github.event.pull_request.head.repo.fork )
# run: |
# git config user.name "github-actions[bot]"
# git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
# git add outputs/
# git commit -m "Update generated outputs on behalf of [@${{ github.actor }}]"
# git push
2 changes: 1 addition & 1 deletion .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0

- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ __pycache__
/view
/.spack-env
/.venv
.idea
CLAUDE.md
2 changes: 1 addition & 1 deletion _static/images/stacks-unify.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 3 additions & 4 deletions common/setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

If you have not done the prior sections, you'll need to start the docker image::

docker run -it ghcr.io/spack/tutorial:sc25
docker run -it ghcr.io/spack/tutorial:isc26

and then set Spack up like this::

git clone --depth=2 --branch=releases/v1.1 https://github.com/spack/spack
git clone --depth=2 --branch=releases/v1.2 https://github.com/spack/spack
. spack/share/spack/setup-env.sh
spack repo update builtin --tag v2025.11.0
spack tutorial -y
spack mirror add --unsigned tutorial /mirror
spack bootstrap now
spack compiler find

Expand Down
7 changes: 2 additions & 5 deletions container/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/spack/tutorial-ubuntu-22.04
FROM ghcr.io/spack/tutorial-ubuntu-26.04

ENV DEBIAN_FRONTEND=noninteractive

Expand All @@ -13,12 +13,9 @@ RUN apt-get update -y && \
vim \
rclone

# Remove GCC 12 from container
RUN apt-get remove -y gcc-12

# Download the buildcache
RUN mkdir /mirror
RUN rclone copy :s3:spack-binaries/v2025.11.0/tutorial /mirror
RUN rclone copy :s3:spack-binaries/releases/v2026.06/tutorial /mirror

RUN chmod -R go+r /mirror

Expand Down
12 changes: 6 additions & 6 deletions index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,26 @@ You can invoke

.. code-block:: console

$ docker pull ghcr.io/spack/tutorial:sc25
$ docker run -it ghcr.io/spack/tutorial:sc25
$ docker pull ghcr.io/spack/tutorial:isc26
$ docker run -it ghcr.io/spack/tutorial:isc26

to start using the container.
You should now be ready to run through our demo scripts:

#. :ref:`basics-tutorial`
#. :ref:`environments-tutorial`
#. :ref:`configs-tutorial`
#. :ref:`packaging-tutorial`
#. :ref:`stacks-tutorial`
#. :ref:`developer-workflows-tutorial`
#. :ref:`binary-cache-tutorial`
#. :ref:`spack-scripting-tutorial`

Other sections from past tutorials are also available, although they may not be kept up-to-date as frequently:

#. :ref:`configs-tutorial`
#. :ref:`modules-tutorial`
#. :ref:`build-systems-tutorial`
#. :ref:`advanced-packaging-tutorial`
#. :ref:`spack-scripting-tutorial`

Full contents:

Expand All @@ -84,17 +84,17 @@ Full contents:

tutorial_basics
tutorial_environments
tutorial_configuration
tutorial_packaging
tutorial_stacks
tutorial_developer_workflows
tutorial_binary_cache
tutorial_scripting

.. toctree::
:maxdepth: 3
:caption: Additional sections

tutorial_configuration
tutorial_modules
tutorial_buildsystems
tutorial_advanced_packaging
tutorial_scripting
81 changes: 39 additions & 42 deletions outputs/basics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ project="$(dirname "$0")"

export SPACK_COLOR=never

# basic installation
# Setting Up Spack
example basics/clone "git clone --depth=2 --branch=$tutorial_branch https://github.com/spack/spack.git ~/spack"
example basics/clone "cd ~/spack"

Expand All @@ -21,61 +21,65 @@ spack config add "config:suppress_gpg_warnings:true"

example basics/source-setup ". share/spack/setup-env.sh"

# spack list
spack repo update

# Installing Packages
example basics/list "spack list"
example basics/list-py "spack list 'py-*'"

# spack install
example basics/gmake "spack install gmake"
example --tee basics/gmake "spack install gmake"

example basics/compiler-list "spack compilers"

example basics/mirror "spack mirror add tutorial /mirror"
example basics/mirror "spack buildcache keys --install --trust"

example basics/zlib-clang "spack install zlib-ng %clang"
example basics/mirror "spack buildcache keys --install --trust --yes-to-all"

# The Spec Syntax
example basics/versions-zlib "spack versions zlib-ng"
example basics/zlib-2.0.7 "spack install zlib-ng@2.0.7"
example basics/zlib-gcc-10 "spack install zlib-ng %gcc@10"
example --tee basics/zlib-2.0.7 "spack install zlib-ng@2.0.7"

example basics/zlib-O3 "spack install zlib-ng@2.0.7 cflags=-O3"

example basics/find "spack find"
example basics/find-lf "spack find -lf"
example basics/info-zlib "spack info --no-dependencies --no-versions zlib-ng"

example basics/tcl "spack install tcl"
example --tee basics/zlib-ipo "spack install zlib-ng +ipo"
example --tee basics/zlib-build-type "spack install zlib-ng build_type=Debug"

example basics/tcl-zlib-clang "spack install tcl ^zlib-ng@2.0.7 %clang"
example --tee basics/zlib-clang "spack install zlib-ng %clang"
example --tee basics/zlib-gcc-14 "spack install zlib-ng %gcc@14"

zlib_hash=$(spack find --format "{hash:3}" zlib-ng cflags=-O3)
example basics/tcl-zlib-hash "spack install tcl ^/${zlib_hash}"
example basics/spec-tcl-zlib-clang "spack spec -l tcl ^zlib-ng@2.0.7 %clang"
example --tee basics/tcl-zlib-clang "spack install tcl ^zlib-ng@2.0.7 %clang"

example basics/find-ldf "spack find -ldf"
# Refer to the zlib-ng@2.0.7 %clang build we just installed by its hash
zlib_hash=$(spack find --format "{hash:3}" zlib-ng@2.0.7 %clang)
example basics/spec-tcl-zlib-hash "spack spec tcl ^/${zlib_hash}"

example basics/graph-tcl "spack graph tcl"

example basics/providers-mpi "spack providers mpi"
example basics/hdf5-spec "spack spec hdf5"
example basics/hdf5 "spack install hdf5"
example basics/hdf5-no-mpi "spack install hdf5~mpi"

example basics/hdf5-hl-mpi "spack install hdf5+hl+mpi ^mpich"

example basics/find-ldf-2 "spack find -ldf"

example basics/trilinos "spack install trilinos"

example basics/trilinos-hdf5 "spack install trilinos +hdf5 ^hdf5+hl+mpi ^mpich"
example --tee basics/hdf5 "spack install hdf5"
example --tee basics/hdf5-no-mpi "spack install hdf5~mpi"

example basics/find-d-trilinos "spack find -d trilinos"

example basics/graph-trilinos "spack graph trilinos"
example --tee basics/hdf5-mpich "spack install hdf5 ^mpich"
example basics/spec-hdf5-compilers "spack spec hdf5 %c,cxx=clang %fortran=gcc"

# Querying Installations
example basics/find "spack find"
example basics/find-l "spack find -l"
example basics/find-d-tcl "spack find -d tcl"
example basics/find-dep-mpich "spack find ^mpich"
example basics/find-px "spack find -px"

# A Realistic Example
example --tee basics/trilinos "spack install trilinos"
example --tee basics/trilinos-hdf5 "spack install trilinos +hdf5 ^mpich"
example basics/trilinos-find-mpich "spack find ^mpich"

# Uninstalling Packages
example basics/find-zlib "spack find zlib-ng"

example basics/uninstall-zlib "spack uninstall -y zlib-ng %gcc@10"
example basics/uninstall-zlib "spack uninstall -y zlib-ng %gcc@14"

example basics/find-lf-zlib "spack find -lf zlib-ng"

Expand All @@ -88,18 +92,11 @@ example --expect-error basics/uninstall-ambiguous "spack uninstall trilinos"
trilinos_hash="$(spack find --format '{hash:3}' trilinos ^openmpi)"
echo y | example basics/uninstall-specific "spack uninstall /$trilinos_hash"

example basics/find-dep-mpich "spack find ^mpich"

example basics/find-O3 "spack find cflags=-O3"

example basics/find-px "spack find -px"

example basics/compilers "spack compilers"

example basics/install-gcc-12.1.0 "spack install gcc@12"
# Customizing Compilers
example --tee basics/install-gcc-16 "spack install gcc@16"

example basics/compilers-2 "spack compilers"

example basics/spec-zziplib "spack spec zziplib %gcc@12"
example basics/spec-zziplib "spack spec zziplib %gcc@16"

echo y | example basics/compiler-uninstall 'spack uninstall gcc@12'
example basics/compiler-uninstall 'spack uninstall -y gcc@16'
14 changes: 7 additions & 7 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
$ git clone --depth=2 --branch=releases/v1.2 https://github.com/spack/spack.git ~/spack
Cloning into '/home/spack/spack'...
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.47 MiB/s, done.
Resolving deltas: 100% (309/309), done.
remote: Enumerating objects: 2411, done.K
remote: Counting objects: 100% (2411/2411), done.K
remote: Compressing objects: 100% (1617/1617), done.K
remote:nTotale2411 (delta2326),4reused 1328 (delta 249), pack-reused 0 (from 0)K
Receiving objects: 100% (2411/2411), 5.48 MiB | 13.53 MiB/s, done.
Resolving deltas: 100% (326/326), done.
$ cd ~/spack
8 changes: 4 additions & 4 deletions outputs/basics/compiler-list.out
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$ spack compilers
==> Available compilers
-- gcc ubuntu22.04-x86_64 ---------------------------------------
[e] gcc@11.4.0 [e] gcc@10.5.0
-- gcc ubuntu26.04-x86_64 ---------------------------------------
[e] gcc@15.2.0 [e] gcc@14.3.0

-- llvm ubuntu22.04-x86_64 --------------------------------------
[e] llvm@14.0.0
-- llvm ubuntu26.04-x86_64 --------------------------------------
[e] llvm@21.1.8
8 changes: 2 additions & 6 deletions outputs/basics/compiler-uninstall.out
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
$ spack uninstall gcc@12
y
-- linux-ubuntu22.04-x86_64_v3 / %c,cxx=gcc@11.4.0 --------------
fmnvqo4 gcc@12.3.0

==> 1 packages will be uninstalled. Do you want to proceed? [y/N] ==> Successfully uninstalled gcc@12.3.0~binutils+bootstrap~graphite~mold~nvptx~piclibs~profiled~strip build_system=autotools build_type=RelWithDebInfo languages:='c,c++,fortran' platform=linux os=ubuntu22.04 target=x86_64_v3/fmnvqo4
$ spack uninstall -y gcc@16
==> Successfully uninstalled gcc@16.1.0+binutils+bootstrap~graphite+libsanitizer~mold~nvptx~piclibs+profiled+strip build_system=autotools build_type=Release languages:='c,c++,fortran' platform=linux os=ubuntu26.04 target=x86_64_v3/vlwdxlj
8 changes: 4 additions & 4 deletions outputs/basics/compilers-2.out
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$ spack compilers
==> Available compilers
-- gcc ubuntu22.04-x86_64 ---------------------------------------
[e] gcc@11.4.0 [e] gcc@10.5.0 [+] gcc@12.3.0
-- gcc ubuntu26.04-x86_64 ---------------------------------------
[e] gcc@15.2.0 [e] gcc@14.3.0 [+] gcc@16.1.0

-- llvm ubuntu22.04-x86_64 --------------------------------------
[e] llvm@14.0.0
-- llvm ubuntu26.04-x86_64 --------------------------------------
[e] llvm@21.1.8
7 changes: 0 additions & 7 deletions outputs/basics/compilers.out

This file was deleted.

Loading