Skip to content

Maintaining Spack Buildcache

Matthew Thompson edited this page Jan 9, 2025 · 4 revisions

This page details the efforts to create a buildcache for use in Spack CI tests in MAPL.

Useful Links

Building Packages on AWS

Preliminaries

Padded Length

Testing showed we apparently need to increase the length of the padding in the install tree. This is what I ran:

spack config add config:install_tree:padded_length:512

Building Packages

We want all the dependencies of MAPL, so we need to do:

spack install --only dependencies mapl
spack install mepo

This (should) get us everything that MAPL needs to build.

NOTENOTENOTENOTE

You need to use ESMF 8.8.0 with MAPL in Spack CI...for some reason. I think it is the Atanas sprintf issue

Building the Buildcache

Create Spack Environment

It turns out, you can't build or push a buildcache unless you are in a Spack environment. So we need to create one:

spack env create mapl-buildcache
spack env activate -p mapl-buildcache

Add Packages to Environment

spack install --add esmf gftl gftl-shared fargparse pflogger pfunit yafyaml ecbuild udunits mepo
spack concretize -f

Add mirror for buildcache

spack mirror add --oci-username mathomp4 --oci-password-variable MAPL_BUILDCACHE_TOKEN --unsigned mapl-buildcache oci://ghcr.io/mathomp4/mapl-buildcache

Pushing the Buildcache

spack buildcache push --update-index oci://ghcr.io/mathomp4/mapl-buildcache
Clone this wiki locally