tidytranscriptomics-workshops / ismb2021_tidytranscriptomics

Other
6 stars 1 forks source link

Workshop infrastructure setup #1

Closed mblue9 closed 3 years ago

mblue9 commented 3 years ago

Notes on setting up infrastructure, building on what was done for ABACBS workshop setup

for i in $packages; do sudo R-install-package $i github; done


- Clone workshop repo to get vignettes folder

git clone https://github.com/tidy-transcriptomics-workshops/ismb2021_tidytranscriptomics.git


- Test running code

if running for first time need to answer yes to the interactive prompt from BlueprintEncodeData (didn't need to do this with rstudio2 admin account)

/homevol/training101/.cache/R/ExperimentHub does not exist, create directory? (yes/no): yes

Rscript -e "rmarkdown::render('ismb2021_tidytranscriptomics/vignettes/tidytranscriptomics.Rmd')"

- If all runs ok, clean up files from testing (if run with Rscript, rather than interactively in Rstudio project then no .Rproj.user is created)

rm -r ismb2021_tidytranscriptomics/.Rproj.user/*


- Copy to directory that will be added to all users

sudo cp -r ismb2021_tidytranscriptomics/ /etc/skel/


- Create users, edit generate-accounts.sh if using a different server number (1,2..). Upload generate-accounts.sh file and chmod +x ./generate-accounts.sh

sudo ./generate-accounts.sh > user-accounts.txt



Test running for all users
-   To create code for performance testing, as before I used `knitr::purl("ismb2021_tidytranscriptomics/vignettes/tidytranscriptomics.Rmd")` to create an R script from the workshop Rmd & removed image paths `grep -v 'png\|jpg' tidytranscriptomics.R > tidytranscriptomics_test.R` so it could be run from any directory on the server with `Rscript tidytranscriptomics_test.R`

- Copy into all users
Upload `add-file-accounts.sh` file and `chmod +x ./add-file-accounts.sh`
`sudo ./add-file-accounts.sh tidytranscriptomics_test.R`

- ssh into server so can monitor with htop
Add public key to  server's `~/.ssh/authorized_keys` 
`ssh admin@rstudio1.tidytranscriptomics-workshop.cloud.edu.au`
`htop` (may need to install htop `sudo apt  install htop`)

- Upload `perf-test.sh` file and `chmod +x ./perf-test.sh`
`./perf-test.sh 'Rscript tidytranscriptomics_test.R'`

- After testing delete accounts with `sudo ./destroy-accounts.sh` as otherwise may get .Rdata objects & packages present in environment. Create clean accounts with `sudo ./generate-accounts.sh > user-accounts.txt`

Notes:
- Scripts (generate-accounts.sh, destroy-accounts.sh, perf-test.sh, add-file-accounts.sh) [workshop_setup_scripts.zip](https://github.com/tidytranscriptomics-workshops/ismb2021_tidytranscriptomics/files/6857203/workshop_setup_scripts.zip), change server number in each if necessary
- To update material to all accounts (if made changes to github repo)
    - As admin in Rstudio terminal
        - cd ismb2021_tidytranscriptomics
        - git pull origin master
        - cd ..
        - sudo ./add-file-accounts.sh ismb2021_tidytranscriptomics
        If need to reinstall package e.g if update data:
        - sudo R-install-package tidytranscriptomics-workshops/ismb2021_tidytranscriptomics github