Intro to bash scripting and HPC Workshop Setup instructions on REANNZ
GitHub : https://github.com/GenomicsAotearoa/Workshop-Bash_Scripting_And_HPC_Job_Scheduler
This workshop needs to be run on the REANNZ HPC cluster.
All learners and instructors will need to have an account on the REANNZ HPC cluster and will need to be added to the GA training project nesi02659 as team members before the workshop.
Dataset setup
Each user will get their own copy of the example dataset. These copies will be made in the nobackup dir, but the original dataset is stored in the project dir. The very first thing all learners and instructors will do in the workshop is create a symbolic link to their own copy of the dataset in their home directory. The benefit of this that:
- Everyone can work on their own copy of the dataset without interfering with each other.
- Everyone’s path to the dataset will be the same (
~/scripting_workshop), so all workshop instructions will work for everyone.
The original dataset is stored at:
/nesi/project/nesi02659/scripting_workshopwhich contains:
ls -F scripting_workshop/
modload.sh* rna_seq/ scheduler/ variant_calling/Instructions to setup dataset copies
There are instructions on setting up copies of the dataset in the project at:
/nesi/project/nesi02659/INSTRUCTOR_INSTRUCTIONSThese instructions below are the same as the instructions in the readme in the HPC/bash workshop instructions dir. This should be completed once by the lead training coordinator (right now that is Chloe) or a REANNZ staff member may assist and complete this. It is best to wait until you have all nesi user names from all participants (learners and instructors/helpers):
Steps:
- Change dir to nobackup and make a new scripting workshop dir
cd /nesi/nobackup/nesi02659/
mkdir scripting_workshop
cd scripting_workshop- Create a text file called
.newand copy each user account IDs for each learner on a new line. Include all instructors and helpers too!
nano .newOnce you’ve entered the usernames and saved the .new file, it should look like:
cat .newusername1
username2
username3
- Copy the contents of the dataset to a hidden template folder
cp -r /nesi/project/nesi02659/scripting_workshop /nesi/nobackup/nesi02659/scripting_workshop/.templatels -F /nesi/nobackup/nesi02659/scripting_workshop/.templaternaseq/ scheduler/ variant_calling/ modload.sh
- Copy the script
copy.shto /nesi/nobackup/nesi02659/scripting_workshop/
cp /nesi/project/nesi02659/INSTRUCTOR_INSTRUCTIONS/intro-hpc-bash-script_WORKSHOP-INSTRUCTIONS/copy.sh .- Run the copy.sh script. The output should make a new dir named for each user, and within each user dir all the scripting_workshop template files should be contained.
bash copy.shExpected output after successful copy.sh run:
ls -F /nesi/nobackup/nesi02659/scripting_workshop/users/*/nesi/nobackup/nesi02659/scripting_workshop/users/username1:
modload.sh* rna_seq/ scheduler/ variant_calling/
/nesi/nobackup/nesi02659/scripting_workshop/users/username2:
modload.sh* rna_seq/ scheduler/ variant_calling/
/nesi/nobackup/nesi02659/scripting_workshop/users/username3:
modload.sh* rna_seq/ scheduler/ variant_calling/
- Get each learner and instructor to create a symlink to their own dir above by running:
cd ~
ln -s /nesi/nobackup/nesi02659/scripting_workshop/users/${USER} scripting_workshop- Good to go!
- At the end of workshop, run
rm -rf /nesi/nobackup/nesi02659/scripting_workshopto remove all copies of the datasets.
cat copy.sh#!/bin/bash -e
MAIN_DIR="/nesi/nobackup/nesi02659/scripting_workshop"
mkdir -p ${MAIN_DIR}/users
for ACCOUNT in $(cat ${MAIN_DIR}/.new)
do
echo "setting up ${ACCOUNT} ..."
cp -r ${MAIN_DIR}/.template ${MAIN_DIR}/users/${ACCOUNT}
chmod -R 777 ${MAIN_DIR}/users/${ACCOUNT}
done
Backup copy
There is a back up of the dataset on GitHub: