From 93632edaaa71ab2e56e0132333d786305e144d53 Mon Sep 17 00:00:00 2001 From: Patrick Gartung Date: Thu, 19 Sep 2024 09:10:13 -0500 Subject: [PATCH 1/4] Make adding buildcache mirrors optional --- bin/make_subspack | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/bin/make_subspack b/bin/make_subspack index b603a05..1b7a501 100755 --- a/bin/make_subspack +++ b/bin/make_subspack @@ -12,6 +12,7 @@ get_from_bootstrap() { usage() { echo "usage: make_subspack [options] [-t|-u] path/to/existing/spack /path/to/new/area" echo " options are:" + echo "--with_caches enable buildcache mirrors echo "--with_padding enable directory padding in config" echo "--spack_release xx install spack release xx" echo "--spack_repo url use spack repo url" @@ -32,7 +33,7 @@ parse_args() { verbose=false plain=false - if x=$(getopt --longoptions with_padding,spack_release:,spack_repo:,local_env:,dev_pkgs: --options vtup -- "$@") + if x=$(getopt --longoptions with_caches,with_padding,spack_release:,spack_repo:,local_env:,dev_pkgs: --options vtup -- "$@") then eval set : $x shift @@ -44,6 +45,7 @@ parse_args() { while echo x$1 | grep x- > /dev/null do case "x$1" in + x--with_caches) enable_caches=true; shift ;; x--with_padding) padding=true; shift ;; x--spack_release) spack_release=$2; shift; shift;; x--spack_repo) spack_repo=$2; shift; shift;; @@ -297,14 +299,16 @@ message "adding package repos..." done ) -echo "Adding buildcache $binary_cache" -$SPACK_ROOT/bin/spack mirror add --scope site fnal $binary_cache -$SPACK_ROOT/bin/spack buildcache update-index -d $binary_cache -message "Adding backup buildcache $binary_cache_bak" -$SPACK_ROOT/bin/spack mirror add --scope site scisoft $binary_cache_bak -$SPACK_ROOT/bin/spack buildcache update-index -d $binary_cache_bak -$SPACK_ROOT/bin/spack -k buildcache keys --install --trust --force - +if [ "$enable_caches" != "" ] +then + echo "Adding buildcache $binary_cache" + $SPACK_ROOT/bin/spack mirror add --scope site fnal $binary_cache + $SPACK_ROOT/bin/spack buildcache update-index -d $binary_cache + message "Adding backup buildcache $binary_cache_bak" + $SPACK_ROOT/bin/spack mirror add --scope site scisoft $binary_cache_bak + $SPACK_ROOT/bin/spack buildcache update-index -d $binary_cache_bak + $SPACK_ROOT/bin/spack -k buildcache keys --install --trust --force +fi #symlink in environments from upstream cd $SPACK_ROOT/var/spack mkdir environments From e4a7696bc5ea4618b84dd74f41a9ec446c897103 Mon Sep 17 00:00:00 2001 From: Patrick Gartung Date: Thu, 19 Sep 2024 11:22:00 -0500 Subject: [PATCH 2/4] Add the buildcache mirrors then disable them by renamig mirrors.yaml --- bin/make_subspack | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/bin/make_subspack b/bin/make_subspack index 1b7a501..9219e94 100755 --- a/bin/make_subspack +++ b/bin/make_subspack @@ -299,15 +299,17 @@ message "adding package repos..." done ) -if [ "$enable_caches" != "" ] +echo "Adding buildcache $binary_cache" +$SPACK_ROOT/bin/spack mirror add --scope site fnal $binary_cache +$SPACK_ROOT/bin/spack buildcache update-index -d $binary_cache +message "Adding backup buildcache $binary_cache_bak" +$SPACK_ROOT/bin/spack mirror add --scope site scisoft $binary_cache_bak +$SPACK_ROOT/bin/spack buildcache update-index -d $binary_cache_bak +$SPACK_ROOT/bin/spack -k buildcache keys --install --trust --force +if [ "$enable_caches" = "" ] then - echo "Adding buildcache $binary_cache" - $SPACK_ROOT/bin/spack mirror add --scope site fnal $binary_cache - $SPACK_ROOT/bin/spack buildcache update-index -d $binary_cache - message "Adding backup buildcache $binary_cache_bak" - $SPACK_ROOT/bin/spack mirror add --scope site scisoft $binary_cache_bak - $SPACK_ROOT/bin/spack buildcache update-index -d $binary_cache_bak - $SPACK_ROOT/bin/spack -k buildcache keys --install --trust --force + echo "Disabling buildcache mirrors." + mv $SPACK_ROOT/etc/spack/mirrors.yaml $SPACK_ROOT/etc/spack/mirrors.yaml.bak fi #symlink in environments from upstream cd $SPACK_ROOT/var/spack From 3e15ef3a80809e2b41c91877a783b87e7d9458e7 Mon Sep 17 00:00:00 2001 From: Patrick Gartung Date: Thu, 19 Sep 2024 11:24:40 -0500 Subject: [PATCH 3/4] Make disabling buildcache an option --without-caches --- bin/make_subspack | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/make_subspack b/bin/make_subspack index 9219e94..7357149 100755 --- a/bin/make_subspack +++ b/bin/make_subspack @@ -12,7 +12,7 @@ get_from_bootstrap() { usage() { echo "usage: make_subspack [options] [-t|-u] path/to/existing/spack /path/to/new/area" echo " options are:" - echo "--with_caches enable buildcache mirrors + echo "--without_caches enable buildcache mirrors echo "--with_padding enable directory padding in config" echo "--spack_release xx install spack release xx" echo "--spack_repo url use spack repo url" @@ -45,7 +45,7 @@ parse_args() { while echo x$1 | grep x- > /dev/null do case "x$1" in - x--with_caches) enable_caches=true; shift ;; + x--with_caches) disable_caches=true; shift ;; x--with_padding) padding=true; shift ;; x--spack_release) spack_release=$2; shift; shift;; x--spack_repo) spack_repo=$2; shift; shift;; @@ -306,7 +306,7 @@ message "Adding backup buildcache $binary_cache_bak" $SPACK_ROOT/bin/spack mirror add --scope site scisoft $binary_cache_bak $SPACK_ROOT/bin/spack buildcache update-index -d $binary_cache_bak $SPACK_ROOT/bin/spack -k buildcache keys --install --trust --force -if [ "$enable_caches" = "" ] +if [ "$disable_caches" != "" ] then echo "Disabling buildcache mirrors." mv $SPACK_ROOT/etc/spack/mirrors.yaml $SPACK_ROOT/etc/spack/mirrors.yaml.bak From e563ea2e680ecaf57d4a4ea804d7ba6a88022080 Mon Sep 17 00:00:00 2001 From: Patrick Gartung Date: Thu, 19 Sep 2024 11:26:39 -0500 Subject: [PATCH 4/4] Fix options parsing --- bin/make_subspack | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/make_subspack b/bin/make_subspack index 7357149..b5da484 100755 --- a/bin/make_subspack +++ b/bin/make_subspack @@ -33,7 +33,7 @@ parse_args() { verbose=false plain=false - if x=$(getopt --longoptions with_caches,with_padding,spack_release:,spack_repo:,local_env:,dev_pkgs: --options vtup -- "$@") + if x=$(getopt --longoptions without_caches,with_padding,spack_release:,spack_repo:,local_env:,dev_pkgs: --options vtup -- "$@") then eval set : $x shift @@ -45,7 +45,7 @@ parse_args() { while echo x$1 | grep x- > /dev/null do case "x$1" in - x--with_caches) disable_caches=true; shift ;; + x--without_caches) disable_caches=true; shift ;; x--with_padding) padding=true; shift ;; x--spack_release) spack_release=$2; shift; shift;; x--spack_repo) spack_repo=$2; shift; shift;;