Skip to content

Commit

Permalink
Merge pull request #15 from hic-infra/pkgbump
Browse files Browse the repository at this point in the history
Bump packages and changes for MSc 23/23
  • Loading branch information
AaronJackson authored Nov 1, 2023
2 parents 4a89cea + 1be578a commit e91de91
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 19 deletions.
3 changes: 2 additions & 1 deletion modules/autohibernate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ sudo tee /usr/bin/autohibernate <<EOF
set -eu
AUTOHIBERNATE_TIME=$AUTOHIBERNATE_TIME
AUTOHIBERNATE_BEHAVIOUR="${AUTHOHIBERNATE_BEHAVIOUR:=hibernate}"
export DISPLAY=:1
if [ \$(xprintidle) -gt \$AUTOHIBERNATE_TIME ] ; then
Expand All @@ -36,7 +37,7 @@ if [ \$(xprintidle) -gt \$AUTOHIBERNATE_TIME ] ; then
vncconfig -disconnect
# Let's hibernate.
sudo systemctl hibernate
sudo systemctl "\$AUTOHIBERNATE_BEHAVIOUR"
# Without a sleep, the swap will be turned off too soon after
# triggering the hibernate (which is async). We need to wait a
Expand Down
82 changes: 71 additions & 11 deletions modules/msc_custom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,77 @@

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

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"

# 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
sudo tee /usr/local/bin/nb <<EOF
#!/bin/bash
cd /home/ubuntu
. \$HOME/conda/etc/profile.d/conda.sh
conda activate msc
jupyter notebook
EOF

sudo chmod +x /usr/local/bin/nb

cat <<EOF | tee /home/ubuntu/Desktop/Notebook.desktop
[Desktop Entry]
Name=Jupyter Notebook
GenericName=Python Notebook
Comment=Launch Jupyter Notebook
Terminal=true
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
sudo chmod +x /home/ubuntu/Desktop/Notebook.desktop

######################################################################
# Set up R environment

Expand All @@ -18,17 +89,6 @@ sudo R --no-save -e "devtools::install_github('jdstorey/qvalue')"

mv "${HOME}/tmp_Rprofile" "${HOME}/.Rprofile"

######################################################################
# Set up python environments

# pinning numpy to supress a warning about numpy needing to be less
# than 1.23.0 with scikit, even though the deps specify numpy 1.23.1.
read -ra BASE_PKG <<<"numpy==1.23.0 matplotlib scikit-learn pillow pandas"
~/conda/bin/mamba create -y -n pytorch
~/conda/bin/mamba install -y pytorch torchvision "${BASE_PKG[@]}" -c pytorch -n pytorch
~/conda/bin/mamba create -y -n tensorflow
~/conda/bin/mamba install -y tensorflow "${BASE_PKG[@]}" -c anaconda -n tensorflow

######################################################################
# Test custom installs
R --no-save -e "library('ggrepel')"
Expand Down
5 changes: 3 additions & 2 deletions modules/pycharm-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
11 changes: 6 additions & 5 deletions modules/rstudio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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

0 comments on commit e91de91

Please sign in to comment.