Skip to content

Building Jenkins build‐spack‐env job and syncing the output with SciSoft spack‐mirror

Patrick Gartung edited this page Feb 15, 2024 · 4 revisions

Build spack environments using Jenkins build-spack-env jobs here

  • The inputs are environment name stubs which include the environment name, version, compiler and cxxstd.
  • Builds are done for SL7 and AL9 and the axes are labeled by the system compiler version (gcc-4.8.5, gcc-11.4.1 respectively)
  • The generated environment spack yaml are named by adding the system compiler to the stubs.
  • The job produces three build-cache directories, one for compilers, one for completed env build binaries, and one for failed env build binaries.
  • These builds need to be synced with a directory accessible via a web server.
  • For the build-spack-env jobs I used a directory under /SciSoft/spack-mirror.
  • The job is parameterized in term of the UPS_SELECTOR variable (see below)

Set up Spack install on node with access to SciSoft file system.

  • Add these entries to Spack install mirrors configuration.
  local-source:
    url: /SciSoft/spack-mirror/spack-packages/sources/
    binary: false
    source: true
  local-binary-unified:
    url: /SciSoft/spack-mirror/spack-binary-cache-unified/
    binary: true
    source: false
  local-compiler-unified:
    url: /SciSoft/spack-mirror/spack-compiler-cache-unified/
    binary: true
    source: false
  local-binary-plain:
    url: /SciSoft/spack-mirror/spack-binary-cache-plain/
    binary: true
    source: false
  local-compiler-plain:
    url: /SciSoft/spack-mirror/spack-compiler-cache-plain/
    binary: true
    source: false

Clone fermi-spack-tools locally

  • https://github.com/FNALssi/fermi-spack-tools

Load the spack configured with the mirrors paths above.

Pick a temporary directory for Spack to download build-cache indices and run the sync_from_jenkins_scisoft script

  • cd /tmp/gartung

  • ~/fermi-spack-tools/bin/sync_from_jenkins_scisoft gcc-11.4.1 699 The first argument is the system compiler: gcc-11.4.1 for AL9.3 and gcc-4.8.5 for SL7 The second argument is the build number

  • This script downloads and unpacks the tarball generated by the build-spack-env script

  • It then determines the spack install directory layout and pick the correct mirror to sync the buildcache files to

    unified for ups like directory layout (used for mu2e builds)

    plain for default Spack directory layout (used for larsoft builds)

  • It adds an entry for each of the potential build cache directories (mirrors) create by the job, labeled

    build number c for compiler

    build number b for binary

    build number e for emergency

  • The mirror config will have entries like these added

  gcc-11.4.1-668c:
    url: https://buildmaster.fnal.gov/buildmaster/view/spack/job/build-spack-env/668/label1=gcc-11.4.1/artifact/copyBack/spack-compiler-cache
    binary: true
    source: false
  gcc-11.4.1-668b:
    url: https://buildmaster.fnal.gov/buildmaster/view/spack/job/build-spack-env/668/label1=gcc-11.4.1/artifact/copyBack/spack-binary-cache/
    binary: true
    source: false
  gcc-11.4.1-668e:
    url: https://buildmaster.fnal.gov/buildmaster/view/spack/job/build-spack-env/668/label1=gcc-11.4.1/artifact/copyBack/spack-emergency-cache/
    binary: true
    source: false
  • The script then issues spack buildcache sync jenkins-mirror-name scisoft-mirror-name for each environment and each buildcache type.

    The spack buildcache sync command handles the updating of the scisoft mirror indices.

Using the Scisoft buildcache mirrors with subsequent build-spack-environment Jenkins jobs

  • Add these parameters to the build-spack-env Jenkins job SPACK_URI_CACHE parameter
scisoft_mirror_binaries|https://scisoft.fnal.gov/scisoft/spack-mirror/spack-binary-cache-$UPS_SELECTOR
scisoft_mirror_compilers|https://scisoft.fnal.gov/scisoft/spack-mirror/spack-compiler-cache-$UPS_SELECTOR

The mirror name is parameterized in terms of the job UPS_SELECTOR parameter.