From b84fefe1b86091a306135115bcb08e4baccc2130 Mon Sep 17 00:00:00 2001 From: Aaron Jackson Date: Fri, 25 Aug 2023 08:22:36 +0100 Subject: [PATCH 1/9] Bump RStudio for Ubuntu --- modules/rstudio.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/rstudio.sh b/modules/rstudio.sh index c52a1d5..f019bd8 100644 --- a/modules/rstudio.sh +++ b/modules/rstudio.sh @@ -23,11 +23,11 @@ sudo apt install -y r-base # shellcheck source=/dev/null . /etc/lsb-release if [ "$DISTRIB_RELEASE" == "20.04" ] ; then - wget https://s3.amazonaws.com/rstudio-ide-build/desktop/bionic/amd64/rstudio-2022.07.2-576-amd64.deb - sudo gdebi -n rstudio-2022.07.2-576-amd64.deb + wget https://s3.amazonaws.com/rstudio-ide-build/electron/focal/amd64/rstudio-2023.06.1-524-amd64.deb + sudo gdebi -n rstudio-2023.06.1-524-amd64.deb elif [ "$DISTRIB_RELEASE" == "22.04" ] ; then - wget https://download1.rstudio.org/electron/jammy/amd64/rstudio-2022.12.0-353-amd64.deb - sudo gdebi -n rstudio-2022.12.0-353-amd64.deb + wget https://s3.amazonaws.com/rstudio-ide-build/electron/jammy/amd64/rstudio-2023.06.1-524-amd64.deb + sudo gdebi -n rstudio-2023.06.1-524-amd64.deb else echo "--------------------------------------------------------" echo "RStudio - Unsupported Ubuntu version ${DISTRIB_RELEASE}" From 2740f271423a1439923674665f53f71d13822cb4 Mon Sep 17 00:00:00 2001 From: Aaron Jackson Date: Fri, 25 Aug 2023 15:46:00 +0100 Subject: [PATCH 2/9] Bump PyCharm to 2023 and add desktop shortcut symlink --- modules/pycharm-setup.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/pycharm-setup.sh b/modules/pycharm-setup.sh index 9d02648..82fb4be 100644 --- a/modules/pycharm-setup.sh +++ b/modules/pycharm-setup.sh @@ -5,8 +5,8 @@ set -eu SETUPDIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")") cd "$SETUPDIR" -PYCHARM_VERSION=2021.3.2 -PYCHARM_SHA256=f1ae01f471d01c6f09aab0a761c6dea9834ef584f2aaf6d6ebecdce6b55a66e8 +PYCHARM_VERSION=2023.2.1 +PYCHARM_SHA256=5956c6cb5a5bad1d9749e487b3bb69fcbf0170f52324e4ff009283b723838778 echo "Installing PyCharm" curl -sfLO https://download-cdn.jetbrains.com/python/pycharm-community-${PYCHARM_VERSION}.tar.gz @@ -28,3 +28,4 @@ Icon=/opt/pycharm-community-${PYCHARM_VERSION}/bin/pycharm.svg Type=Application EOF sudo chmod +x /opt/pycharm/PyCharm.desktop +ln -s /opt/pycharm/PyCharm.desktop /home/ubuntu/Desktop/PyCharm.desktop From f49bce30bbbd4e09068b087099bf90a75eaa3a85 Mon Sep 17 00:00:00 2001 From: Aaron Jackson Date: Fri, 25 Aug 2023 15:46:38 +0100 Subject: [PATCH 3/9] plink, gtool, snptest, jupyter notebook shortcut --- modules/msc_custom.sh | 89 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 78 insertions(+), 11 deletions(-) diff --git a/modules/msc_custom.sh b/modules/msc_custom.sh index 6f97f7e..f7daa9d 100644 --- a/modules/msc_custom.sh +++ b/modules/msc_custom.sh @@ -2,6 +2,84 @@ set -eu + +###################################################################### +# PLINK +mkdir plink +pushd plink +curl -sfLO https://s3.amazonaws.com/plink1-assets/plink_linux_x86_64_20230116.zip +unzip plink_linux_x86_64_20230116.zip +chmod +x plink +sudo ln -s "$(pwd)/plink" /usr/local/bin/plink +popd + +###################################################################### +# GTOOL +mkdir gtool +pushd gtool +curl -sfLO https://www.well.ox.ac.uk/~cfreeman/software/gwas/gtool_v0.7.5_x86_64.tgz +tar zxvf gtool_v0.7.5_x86_64.tgz +chmod +x gtool +sudo ln -s "$(pwd)/gtool" /usr/local/bin/gtool +popd + +###################################################################### +# SNPTEST +mkdir snptest +pushd snptest +curl -sfLO http://www.well.ox.ac.uk/~gav/resources/snptest_v2.5.4-beta3_linux_x86_64_static.tgz +tar zxvf snptest_v2.5.4-beta3_linux_x86_64_static.tgz +sudo cp snptest_v2.5.4-beta3_linux_x86_64_static/snptest_v2.5.4-beta3 /usr/local/bin/snptest +sudo chmod +x /usr/local/bin/snptest +popd + +###################################################################### +# Some TensorFlow stuff +eval "$(/home/ubuntu/conda/bin/conda shell.bash hook)" +/home/ubuntu/conda/bin/conda activate msc +export CONDA_PREFIX="$HOME/conda/envs/msc" +mkdir -p $CONDA_PREFIX/etc/conda/activate.d + +echo 'CUDNN_PATH=$(dirname $(python -c "import nvidia.cudnn;print(nvidia.cudnn.__file__)"))' \ + > $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh +echo 'export LD_LIBRARY_PATH=$CONDA_PREFIX/lib/:$CUDNN_PATH/lib:$LD_LIBRARY_PATH' \ + >> $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh + +source $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh + +###################################################################### +# Jupyter Notebook shortcut +sudo tee /usr/local/bin/nb <&1 | awk "/http/ {print \$2}" | tail -n1) + +unset LD_LIBRARY_PATH +xdg-open "\$notebook_url" + +wait +EOF + +sudo chmod +x /usr/local/bin/nb + +cat < Date: Fri, 25 Aug 2023 15:47:35 +0100 Subject: [PATCH 4/9] Add env var AUTOHIBERNATE_BEHAVIOUR can be set to shutdown if hiberation isn't possible on a project's workspace type. --- modules/autohibernate.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/autohibernate.sh b/modules/autohibernate.sh index e874d97..0a3a4ab 100644 --- a/modules/autohibernate.sh +++ b/modules/autohibernate.sh @@ -20,6 +20,7 @@ sudo tee /usr/bin/autohibernate < Date: Fri, 25 Aug 2023 15:57:15 +0100 Subject: [PATCH 5/9] Forgot to add it... --- modules/msc_custom.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/msc_custom.sh b/modules/msc_custom.sh index f7daa9d..a61d274 100644 --- a/modules/msc_custom.sh +++ b/modules/msc_custom.sh @@ -53,8 +53,8 @@ sudo tee /usr/local/bin/nb < Date: Fri, 1 Sep 2023 10:48:49 +0100 Subject: [PATCH 6/9] Fix TensorFlow CuDNN and pull down EfficientNetB0 --- modules/msc_custom.sh | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/modules/msc_custom.sh b/modules/msc_custom.sh index a61d274..531011a 100644 --- a/modules/msc_custom.sh +++ b/modules/msc_custom.sh @@ -35,17 +35,15 @@ popd ###################################################################### # Some TensorFlow stuff -eval "$(/home/ubuntu/conda/bin/conda shell.bash hook)" -/home/ubuntu/conda/bin/conda activate msc -export CONDA_PREFIX="$HOME/conda/envs/msc" -mkdir -p $CONDA_PREFIX/etc/conda/activate.d -echo 'CUDNN_PATH=$(dirname $(python -c "import nvidia.cudnn;print(nvidia.cudnn.__file__)"))' \ - > $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh -echo 'export LD_LIBRARY_PATH=$CONDA_PREFIX/lib/:$CUDNN_PATH/lib:$LD_LIBRARY_PATH' \ - >> $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh +CUDNN_PATH=$(find "$HOME/conda/envs/msc" -path "*/cudnn/lib") +echo "export LD_LIBRARY_PATH=$CUDNN_PATH:$HOME/conda/envs/msc/lib/:\$LD_LIBRARY_PATH" \ + > "$HOME/conda/envs/msc/etc/conda/activate.d/env_vars.sh" -source $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh +# We want to trigger a download of EfficientNet weights +~/conda/bin/conda run -n msc python -c "\ +from tensorflow.keras.applications import EfficientNetB0; \ +model = EfficientNetB0(weights='imagenet')" ###################################################################### # Jupyter Notebook shortcut From 41466aaaf0fbd3398d70d12753029f32700aa654 Mon Sep 17 00:00:00 2001 From: Aaron Jackson Date: Fri, 1 Sep 2023 10:49:29 +0100 Subject: [PATCH 7/9] Jupyter Notebook fixes MSc --- modules/msc_custom.sh | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/modules/msc_custom.sh b/modules/msc_custom.sh index 531011a..70ee5c4 100644 --- a/modules/msc_custom.sh +++ b/modules/msc_custom.sh @@ -51,17 +51,11 @@ sudo tee /usr/local/bin/nb <&1 | awk "/http/ {print \$2}" | tail -n1) +. \$HOME/conda/etc/profile.d/conda.sh +conda activate msc -unset LD_LIBRARY_PATH -xdg-open "\$notebook_url" - -wait +jupyter notebook EOF sudo chmod +x /usr/local/bin/nb @@ -72,7 +66,7 @@ Name=Jupyter Notebook GenericName=Python Notebook Comment=Launch Jupyter Notebook Terminal=true -Exec=/usr/bin/bash -c "source /home/ubuntu/conda/etc/profile.d/conda.sh && /usr/local/bin/nb" +Exec=/usr/bin/bash -c "/usr/local/bin/nb" Icon=/home/ubuntu/conda/envs/msc/share/icons/hicolor/scalable/apps/notebook.svg Type=Application EOF From 25445bb2f422da5b7b894805efc25d6ca26db9f2 Mon Sep 17 00:00:00 2001 From: Aaron Jackson Date: Fri, 1 Sep 2023 15:07:22 +0100 Subject: [PATCH 8/9] Ensure env_vars path exists before generating file --- modules/msc_custom.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/msc_custom.sh b/modules/msc_custom.sh index 70ee5c4..5b571a8 100644 --- a/modules/msc_custom.sh +++ b/modules/msc_custom.sh @@ -36,6 +36,7 @@ popd ###################################################################### # Some TensorFlow stuff +mkdir -p "$HOME/conda/envs/msc/etc/conda/activate.d" CUDNN_PATH=$(find "$HOME/conda/envs/msc" -path "*/cudnn/lib") echo "export LD_LIBRARY_PATH=$CUDNN_PATH:$HOME/conda/envs/msc/lib/:\$LD_LIBRARY_PATH" \ > "$HOME/conda/envs/msc/etc/conda/activate.d/env_vars.sh" From 1be578a77fe4c475960611b6decbe1784fb22346 Mon Sep 17 00:00:00 2001 From: Aaron Jackson Date: Tue, 5 Sep 2023 11:27:49 +0100 Subject: [PATCH 9/9] Add tidyverse as a base package since it has native deps --- modules/rstudio.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/rstudio.sh b/modules/rstudio.sh index f019bd8..dc4535b 100644 --- a/modules/rstudio.sh +++ b/modules/rstudio.sh @@ -59,4 +59,5 @@ sudo apt update sudo apt install -y r-cran-odbc r-cran-dbi r-cran-qqman r-cran-metafor \ r-cran-tidyr r-cran-ggplot2 r-cran-hmisc r-cran-data.table \ - r-cran-dplyr r-cran-lubridate r-cran-survival r-cran-survminer + r-cran-dplyr r-cran-lubridate r-cran-survival r-cran-survminer \ + r-cran-tidyverse