Skip to content

Commit

Permalink
Merge branch 'bugfix/clear_spack_cache' into 'master'
Browse files Browse the repository at this point in the history
Cleans Spack build area of failed build remnants.

See merge request olcf/container-builder!23
  • Loading branch information
Simpson, Adam B committed Jan 31, 2018
2 parents 87fb3fe + a66c007 commit c592585
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
17 changes: 14 additions & 3 deletions deploy-summitdev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,37 @@ set -x
SW_ROOT=/sw/summitdev/container-builder/${VERSION}
mkdir -p ${SW_ROOT}

# Build with spack; install spack if it's not already present.
SPACKROOT=${SW_ROOT}/.spack

if [ ! -d ${SPACKROOT} ]; then
git clone https://github.com/spack/spack.git ${SPACKROOT}
cd ${SPACKROOT}
git checkout d3519af7de84fa72dee0618c7754f7ebeaa23142
cd ${HOME}
fi

# Update the spack configuration files to the latest.
cp spack-etc-summitdev/*.yaml ${SPACKROOT}/etc/spack

# Ensure spack is aware of our third-party package repo.
${SPACKROOT}/bin/spack repo add spack-repo/container-builder

# Remove any remnants of past failed builds.
${SPACKROOT}/bin/spack clean --stage --misc-cache

# Record how spack will build the app in the log.
${SPACKROOT}/bin/spack spec -NIl "container-builder%gcc@7.1.0"

# Have spack build the app.
${SPACKROOT}/bin/spack install "container-builder%gcc@7.1.0"

# Find where spack generated the modulefile.
root=$(${SPACKROOT}/bin/spack config get config | grep "\btcl:" | awk '{print $2}' | sed 's/^$spack/./')
arch=$(${SPACKROOT}/bin/spack arch)
mfname=$(${SPACKROOT}/bin/spack module find "container-builder%gcc@7.1.0")

real_mf_path="$SPACKROOT/$root/$arch/$mfname"

# Generate a public modulefile the loads the spack-generated one.
MF_ROOT=/sw/summitdev/modulefiles/core/container-builder
mkdir -p ${MF_ROOT}

Expand All @@ -48,4 +59,4 @@ cat << EOF > ${MF_ROOT}/${VERSION}
setenv QUEUE_HOST ${QUEUE_HOST}
setenv QUEUE_PORT 8080
module --ignore-cache load ${real_mf_path}
EOF
EOF
17 changes: 14 additions & 3 deletions deploy-titan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,37 @@ unset CRAYPE_VERSION
SW_ROOT=/sw/xk6/container-builder/${VERSION}
mkdir -p ${SW_ROOT}

# Build with spack; install spack if it's not already present.
SPACKROOT=${SW_ROOT}/.spack

if [ ! -d ${SPACKROOT} ]; then
git clone https://github.com/spack/spack.git ${SPACKROOT}
cd ${SPACKROOT}
git checkout d3519af7de84fa72dee0618c7754f7ebeaa23142
cd ${HOME}
fi

# Update the spack configuration files to the latest.
cp spack-etc-titan/*.yaml ${SPACKROOT}/etc/spack

# Ensure spack is aware of our third-party package repo.
${SPACKROOT}/bin/spack repo add spack-repo/container-builder

# Remove any remnants of past failed builds.
${SPACKROOT}/bin/spack clean --stage --misc-cache

# Record how spack will build the app in the log.
${SPACKROOT}/bin/spack spec -NIl "container-builder%gcc@5.3.0"

# Have spack build the app.
${SPACKROOT}/bin/spack install "container-builder%gcc@5.3.0"

# Find where spack generated the modulefile.
root=$(${SPACKROOT}/bin/spack config get config | grep "\btcl:" | awk '{print $2}' | sed 's/^$spack/./')
arch=$(${SPACKROOT}/bin/spack arch)
mfname=$(${SPACKROOT}/bin/spack module find "container-builder%gcc@5.3.0")

real_mf_path="$SPACKROOT/$root/$arch/$mfname"

# Generate a public modulefile the loads the spack-generated one.
MF_ROOT=/sw/xk6/modulefiles/container-builder
mkdir -p ${MF_ROOT}

Expand All @@ -50,4 +61,4 @@ cat << EOF > ${MF_ROOT}/${VERSION}
setenv QUEUE_HOST ${QUEUE_HOST}
setenv QUEUE_PORT 8080
module load ${real_mf_path}
EOF
EOF

0 comments on commit c592585

Please sign in to comment.