From e9dcdb77ffa0af071f9c736b31b6644aa0523b29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Fri, 6 Jan 2023 10:30:33 +0100 Subject: [PATCH] script for exporting a stack to tarballs --- scripts/export_stack_to_tarballs.sh | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 scripts/export_stack_to_tarballs.sh diff --git a/scripts/export_stack_to_tarballs.sh b/scripts/export_stack_to_tarballs.sh new file mode 100755 index 00000000..eb2d18e9 --- /dev/null +++ b/scripts/export_stack_to_tarballs.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# Export a given version of the EESSI stack to a set of tarballs. +# A tarball will be created for each combination of operating system and ISA. +# Each tarball contains the corresponding compatibility layer, the software directories +# for all CPUs of this particular architecture, and additional directories like init and scripts. + +repo=pilot.eessi-hpc.org + +if [ $# -ne 1 ]; then + echo "Usage: $0 " >&2 + exit 1 +fi + +version="$1" +basedir="/cvmfs/${repo}/versions" +oss=$(ls -1 ${basedir}/${version}/compat/) +archs=$(ls -1 ${basedir}/${version}/compat/linux/) + +for os in ${oss} +do + for arch in ${archs} + do + tar_contents="${version}/init ${version}/scripts ${version}/compat/${os}/${arch} ${version}/software/${os}/${arch}" + tar_name="eessi-${version}-${os}-${arch}.tar.gz" + echo "Creating tarball ${tar_name}..." + # Run with sudo to prevent permission issues + sudo tar czf ${tar_name} -C ${basedir} ${tar_contents} + done +done