Skip to content

Commit

Permalink
add a test for testing setup when multiple servers are in the config
Browse files Browse the repository at this point in the history
  • Loading branch information
stebo85 authored Dec 21, 2023
1 parent ca29424 commit 8319fb6
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/test-cvmfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ env:
DOCKERHUB_ORG: ${{ secrets.DOCKERHUB_ORG }}

jobs:
test_cvmfs_1_2_3:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: check if cvmfs setup with multiple entries works
run: /bin/bash .github/workflows/test_cvmfs_1_2_3.sh
test_cvmfs:
runs-on: ubuntu-22.04
strategy:
Expand All @@ -17,4 +23,4 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: check if ${{ matrix.cvmfs-server }} is online and up-to-date
run: /bin/bash .github/workflows/test_cvmfs.sh ${{ matrix.cvmfs-server }}
run: /bin/bash .github/workflows/test_cvmfs.sh ${{ matrix.cvmfs-server }}
79 changes: 79 additions & 0 deletions .github/workflows/test_cvmfs_1_2_3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# set -e

sudo apt-get install lsb-release
wget https://ecsft.cern.ch/dist/cvmfs/cvmfs-release/cvmfs-release-latest_all.deb

echo "[DEBUG]: adding cfms repo"
sudo dpkg -i cvmfs-release-latest_all.deb
echo "[DEBUG]: apt-get update"
sudo apt-get update --allow-unauthenticated
echo "[DEBUG]: apt-get install cvmfs"
sudo apt-get install cvmfs --allow-unauthenticated

sudo mkdir -p /etc/cvmfs/keys/ardc.edu.au/


echo "-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwUPEmxDp217SAtZxaBep
Bi2TQcLoh5AJ//HSIz68ypjOGFjwExGlHb95Frhu1SpcH5OASbV+jJ60oEBLi3sD
qA6rGYt9kVi90lWvEjQnhBkPb0uWcp1gNqQAUocybCzHvoiG3fUzAe259CrK09qR
pX8sZhgK3eHlfx4ycyMiIQeg66AHlgVCJ2fKa6fl1vnh6adJEPULmn6vZnevvUke
I6U1VcYTKm5dPMrOlY/fGimKlyWvivzVv1laa5TAR2Dt4CfdQncOz+rkXmWjLjkD
87WMiTgtKybsmMLb2yCGSgLSArlSWhbMA0MaZSzAwE9PJKCCMvTANo5644zc8jBe
NQIDAQAB
-----END PUBLIC KEY-----" | sudo tee /etc/cvmfs/keys/ardc.edu.au/neurodesk.ardc.edu.au.pub


echo "CVMFS_USE_GEOAPI=yes" | sudo tee /etc/cvmfs/config.d/neurodesk.ardc.edu.au.conf

echo "CVMFS_SERVER_URL=\"http://cvmfs1.neurodesk.org/cvmfs/@fqrn@;http://cvmfs2.neurodesk.org/cvmfs/@fqrn@;http://cvmfs3.neurodesk.org/cvmfs/@fqrn@;\"" | sudo tee -a /etc/cvmfs/config.d/neurodesk.ardc.edu.au.conf

echo 'CVMFS_KEYS_DIR="/etc/cvmfs/keys/ardc.edu.au/"' | sudo tee -a /etc/cvmfs/config.d/neurodesk.ardc.edu.au.conf

echo "CVMFS_HTTP_PROXY=DIRECT" | sudo tee /etc/cvmfs/default.local
echo "CVMFS_QUOTA_LIMIT=5000" | sudo tee -a /etc/cvmfs/default.local

sudo cvmfs_config setup
# sudo cvmfs_config wsl2_start
sudo cvmfs_config chksetup

ls /cvmfs/neurodesk.ardc.edu.au

# sudo cvmfs_config umount

cvmfs_config stat -v neurodesk.ardc.edu.au



## Test if containers are on CVMFS:
wget https://raw.githubusercontent.com/NeuroDesk/neurocommand/main/cvmfs/log.txt
echo "debug logfile:"
cat log.txt

ls /cvmfs/neurodesk.ardc.edu.au

while IFS= read -r LINE
do
echo "[DEBUG] LINE: $LINE"
IMAGENAME_BUILDDATE="$(cut -d' ' -f1 <<< ${LINE})"
echo "IMAGENAME_BUILDDATE: $IMAGENAME_BUILDDATE"

IMAGENAME="$(cut -d'_' -f1,2 <<< ${IMAGENAME_BUILDDATE})"
BUILDDATE="$(cut -d'_' -f3 <<< ${IMAGENAME_BUILDDATE})"
echo "[DEBUG] IMAGENAME: $IMAGENAME"
echo "[DEBUG] BUILDDATE: $BUILDDATE"

if [[ -f "/cvmfs/neurodesk.ardc.edu.au/containers/$IMAGENAME_BUILDDATE/commands.txt" ]]
then
echo "Container exists on CVMFS."
else
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo "[DEBUG] Container does not exist on CVMFS"
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++"
exit 2
fi
done < log.txt


## test if files can be accessed ok:
cp /cvmfs/neurodesk.ardc.edu.au/containers/fsl_6.0.5.1_20221016/fsl_6.0.5.1_20221016.simg/opt/fsl-6.0.5.1/data/standard/LowerCingulum_1mm.nii.gz ~/LowerCingulum_1mm.nii.gz

0 comments on commit 8319fb6

Please sign in to comment.