Skip to content
Snippets Groups Projects
Commit 4a625d2f authored by Nicolas Richart's avatar Nicolas Richart
Browse files

More fixes on the overlays

parent 9482109c
No related branches found
No related tags found
1 merge request!2CI update to use squashfs
Pipeline #201481 failed
...@@ -105,10 +105,14 @@ spack:checkout: ...@@ -105,10 +105,14 @@ spack:checkout:
before_script: before_script:
- git config --global --add --bool advice.detachedHead false - git config --global --add --bool advice.detachedHead false
script: script:
- mkdir -p ${CI_DATA}/overlayfs/ - |
- mkdir -p ${CI_DATA}/squashfs-cache for i in overlayfs squashfs-cache buildcache spack-mirror
- mkdir -p ${CI_DATA}/buildcache do
- mkdir -p ${CI_DATA}/spack-mirror if [ ! -e ${CI_DATA}/$i ]
then
mkdir -p ${CI_DATA}/$i
fi
done
- ./ci/prepare_squashfs.sh - ./ci/prepare_squashfs.sh
timeout: 1h timeout: 1h
......
#!/usr/bin/env sh #!/usr/bin/env sh
CI_DATA="/work/scitas-ge/richart/ci" CI_DATA="/scratch/richart/ci"
srun_options="-N1 -n1 -c 64 -p h100" srun_options="-N1 -n1 -c 64 -p h100"
apptainer_options="--nv" apptainer_options="--nv"
...@@ -18,10 +18,14 @@ MOUNT_POINT=$(jq -Mrc .stack.mount_point ${CI_PROJECT_DIR}/stacks/${stack}/confi ...@@ -18,10 +18,14 @@ MOUNT_POINT=$(jq -Mrc .stack.mount_point ${CI_PROJECT_DIR}/stacks/${stack}/confi
APPTAINER_IMAGE=~/rhel9-kuma.sif APPTAINER_IMAGE=~/rhel9-kuma.sif
mkdir -p ${CI_DATA}/overlayfs/{lower,upper,wd}-${SQUASHFS_ID} for i in overlayfs squashfs-cache buildcache spack-mirror
mkdir -p ${CI_DATA}/squashfs-cache do
mkdir -p ${CI_DATA}/buildcache if [ ! -e ${CI_DATA}/$i ]
mkdir -p ${CI_DATA}/spack-mirror then
mkdir -p ${CI_DATA}/$i
fi
done
if [ ! -f ${CI_DATA}/squashfs-cache/${stack}-${environment}-${SQUASHFS_ID}.sqfs ] if [ ! -f ${CI_DATA}/squashfs-cache/${stack}-${environment}-${SQUASHFS_ID}.sqfs ]
then then
......
...@@ -5,56 +5,39 @@ set -o nounset ...@@ -5,56 +5,39 @@ set -o nounset
source ${CI_PROJECT_DIR}/ci/stack_env.sh source ${CI_PROJECT_DIR}/ci/stack_env.sh
if [ ! -d /squashfs-cache ]
then
mkdir -p /squashfs-cache
fi
# Check if MR as squashfs # Check if MR as squashfs
sqfs_image=$(ls -t1 /squashfs-cache/${stack}-${environment}-${squash_id}*.sqfs 2> /dev/null | head -1) sqfs_image=$(ls -t1 ${CI_DATA}/squashfs-cache/${stack}-${environment}-${squash_id}*.sqfs 2> /dev/null | head -1)
if [ $? -ne 0 ] if [ $? -ne 0 ]
then then
echo "No MR ($squash_id) squashfs found" echo "No MR ($squash_id) squashfs found"
# Check if MR default branch as squashfs # Check if MR default branch as squashfs
sqfs_base_image=$(ls -t1 /squashfs-cache/${stack}-${environment}-${squash_base}*.sqfs 2> /dev/null | head -1) sqfs_base_image=$(ls -t1 ${CI_DATA}/squashfs-cache/${stack}-${environment}-${squash_base}*.sqfs 2> /dev/null | head -1)
if [ $? -ne 0 ] if [ $? -ne 0 ]
then then
echo "No default branch ($squash_base) squashfs found" echo "No default branch ($squash_base) squashfs found"
echo "Creating an empty one" echo "Creating an empty one"
empty=$(mktemp -d) empty=$(mktemp -d)
sqfs_base_image=/squashfs-cache/${stack}-${environment}-${squash_base}-initial.sqfs sqfs_base_image="${CI_DATA}/squashfs-cache/${stack}-${environment}-${squash_base}-initial.sqfs"
mksquashfs ${empty} ${sqfs_base_image} mksquashfs ${empty} ${sqfs_base_image}
else else
echo "Found ${sqfs_base_image}" echo "Found ${sqfs_base_image}"
fi fi
# Link MR sqaushfs to the one of default branch # Link MR sqaushfs to the one of default branch
sqfs_image=/squashfs-cache/${stack}-${environment}-${squash_id}.sqfs sqfs_image=${CI_DATA}/squashfs-cache/${stack}-${environment}-${squash_id}.sqfs
cd /squashfs-cache cd ${CI_DATA}/squashfs-cache
ln -sf $(basename ${sqfs_base_image}) $(basename ${sqfs_image}) ln -sf $(basename ${sqfs_base_image}) $(basename ${sqfs_image})
cd - cd -
echo "Linking ${sqfs_image} -> ${sqfs_base_image}" echo "Linking ${sqfs_image} -> ${sqfs_base_image}"
else else
if [ ${sqfs_image} != /squashfs-cache/${stack}-${environment}-${squash_id}.sqfs ]; if [ ${sqfs_image} != ${CI_DATA}/squashfs-cache/${stack}-${environment}-${squash_id}.sqfs ];
then then
cd /squashfs-cache cd ${CI_DATA}/squashfs-cache
ln -sf $(basname ${sqfs_image}) ${stack}-${environment}-${squash_id}.sqfs ln -sf $(basname ${sqfs_image}) ${stack}-${environment}-${squash_id}.sqfs
cd cd
fi fi
echo "Found ${sqfs_image}" echo "Found ${sqfs_image}"
fi fi
if [ ! -d /overlayfs ]
then
mkdir -p /overlayfs
fi
if [ ! -d /overlayfs/upper ]
then
mkdir -p /overlayfs/lower
mkdir -p /overlayfs/upper
mkdir -p /overlayfs/wd
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment