temppage - AusARG/ABLeS GitHub Wiki

AUTHORS: Hardip Patel, Renzo Balboa, Tim McInerney with the help of NCI Staff and other collaborators.

Other pages to create:

  • FAQ page for general questions

This is a temppage for a reason. I think we can use it to get all the ideas in one place and then organise it as per the requirements into separate pages based on themes or topics.

Generating SSH key:

  1. Check if you have .ssh/id_rsa.pub file available on your computer by typing in cat ~/.ssh/id_rsa.pub in the Terminal.
  2. If you have the file then a large string of characters will be visible on the terminal. (e.g. ssh-rsa adfadffafdafaufa................ username@computename). This is called public SSH key which will be required for interacting with the git repo.
  3. If you don't have that file then you will get a message saying No such file or directory. Then you need to create SSH public key.
  4. Run ssh-keygen command in the Terminal. Hit enter when prompted. DO NOT enter any values there. If command runs successfully then you will have the SSH keys for your computer.
  5. Run cat ~/.ssh/id_rsa.pub command to get the value of the key.

Passwordless entry to Gadi

  1. Follow steps Generating SSH Key heading on this page.
  2. Log in to Gadi using ssh [email protected] command. Enter your designated password when prompted and hit Enter.
  3. Create a new directory (if you don't have it), by typing mkdir -p .ssh
  4. Run nano .ssh/authorized_keys to open the file containing authorized keys.
  5. Paste you SSH Key in a new line followed by 'Ctrl+X' to exit and 'Y' to save changes.
  6. This will make sure that you don't have to type in your password and when you want to login in to Gadi.

...alternatively

use the ssh-copy-id command to copy your ssh key to Gadi. For the example above, the command will look like this:

ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]

you will be prompted for your password to complete the process

Modifying your ~/.ssh/config file for quick login

Run nano ~/.ssh/config command in terminal to open the file and add the following:

host n ##this n can be anything you want to remember Gadi by.
hostname gadi.nci.org.au
user "username" ##replace this with your NCI username

Enter Ctrl-X followed by Y to exit and save respectively. Now you can log into Gadi by typing ssh n and it will take you Gadi.

Creating Unix Module File for maintaining different version of the same program on Gadi

Details about Unix Environment Modules can be found here, here, and by running man module. In short, module package allows you to maintain and run various versions of same program depending on your needs.

The following has been done for the xl04 project so no need to do the following

mkdir /g/data/xl04/apps/modules #for storing module definition files
mkdir /g/data/xl04/apps/binaries #for storing binaries
mkdir /g/data/xl04/apps/source #for storing downloaded source code 

Then let's say you want to install bcftools software. You can download bcftools from here.

cd /g/data/xl04/apps/source
wget https://github.com/samtools/bcftools/releases/download/1.4/bcftools-1.4.tar.bz2
tar xvjf bcftools-1.4.tar.bz2 ## for .tar.bz files
tar -zxvf file.tar.gz ## for .tar.gz files
cd bcftools-1.4
make
mkdir -p /g/data/xl04/apps/binaries/bcftools/1.4 ##This is the directory where we will install software
mkdir -p /g/data/xl04/apps/modules/bcftools ##This is the directory where we will keep module files for the bcftools software
make prefix=/g/data/xl04/apps/binaries/bcftools/1.4 install

Please follow the convention for directory naming, i.e. /g/data/xl04/apps/binaries/softwareName/versionNumber. This will allow us to add in newer version of the bcftools software in the future, e.g. /g/data/xl04/binaries/bcftools/1.5.

Now you can create the module file /g/data/xl04/apps/modules/bcftools/1.4 with the following content in it. Please note that this a file in modules directory and it is NOT a directory.

#%Module1.0
source /opt/Modules/extensions/extensions.tcl
proc ModulesHelp { } {
        puts stderr "\tAdds bcftools binary to the path"
}
module-whatis    "bcftools"

# for Tcl script use only
set bcftoolsversion 1.4
append-path PATH /g/data/xl04/apps/binaries/bcftools/1.4/bin

You are done with creating the module for bcftools version 1.4 software. You can use the module by using module use -a /g/data/xl04/apps/modules command. This command instructs the module program to look for modules in /g/data/xl04/apps/modules directory. Then if you run module avail command, you will see at the modules for program that have been installed for the group as follows.

You can add the following line in your .bash_profile file to have the module path available at all times.

module use -a /g/data/xl04/apps/modules

Creating directory for shared resources

We can all use setfacl and getfacl functions to create/modify permissions on directories so any new files/directories created under the top directory has the same permissions.

dirsetup () { 
  newdir=$1;
  mkdir -p $newdir;
  chmod -R g+s $newdir;
  chmod -R g+rwx $newdir;
  setfacl -R -m g::rwx $newdir;
  setfacl -dR -m g::rwx $newdir;
}
dirsetup mynewshareddirectory

The last line in the above code actually allows for inheritance of permissions. If this doesn't work then a fix is required. For existing files/directories, you will have to pick up from where required.

Accessing the VDI

See below for information to install prerequisite software and access the Virtual Desktop Interface (VDI) on NCI:

https://opus.nci.org.au/display/Help/VDI+User+Guide

Notes

  1. Ensure that you install both TurboVNC and Strudel to be able to access the VDI.
  2. IGV can be found under Applications (top left corner) -> Science -> IGV
  3. NCI Virtual Desktop Pool -

8 vCPUs, 32GB RAM, 140GB “/local” Max session lifetime: 7 days Inactive session time limit: 24 hours

Ensure that you log out after using the system (click on your name and quit). If you are inactive after 24 hours, the system will close, and the active desktop will remain valid for 7 days, or until you log back in and close it.

  1. “/short” on “Gadi” is completely separate to the VDI and cannot be accessed from the desktops.

Installing R packages and using them as a shared resource

A module called Rpackages/3.5.1 has been created which will load R/3.5.1 as pre-requisite and add /g/data/xl04/apps/binaries/Rpackages/3.5.1 to R_LIBS variable. So following should do the trick.

module unload intel-fc intel-cc # DO THIS IF SIMPLY LOADING R DOESN'T WORK
module load intel-fc/16.0.3.210 # DO THIS IF SIMPLY LOADING R DOESN'T WORK 
module load intel-cc/16.0.3.210 # DO THIS IF SIMPLY LOADING R DOESN'T WORK
module load Rpackages/3.5.1
Rscript -e 'install.packages("packageName", repos="https://cran.csiro.au")'

NOTES:

  1. You may have to change the mirror on some occasions
  2. R packages may require Intel compilers (see Gadi help here). You can do that as follows:
module unload intel-fc intel-cc
module load intel-fc/16.0.3.210
module load intel-cc/16.0.3.210
  1. If you are having trouble with both install.packages and BiocLite, then try BiocManager e.g.
module unload intel-fc intel-cc # DO THIS IF SIMPLY LOADING R DOESN'T WORK
module load intel-fc/16.0.3.210 # DO THIS IF SIMPLY LOADING R DOESN'T WORK 
module load intel-cc/16.0.3.210 # DO THIS IF SIMPLY LOADING R DOESN'T WORK
module load Rpackages/3.5.1
R
BiocManager::install(c("package1","package2"), version="3.8") ##In R env

Installing PYTHON packages

module load pythonpackages/3.7.4
pip3 install biopython --prefix=/g/data/xl04/apps/binaries/pythonpackages/3.7.4 

Further help with python packages can be found at the NCI FAQs