From fac8176cee4a2cc888bd8868f6496ec9869761a1 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Tue, 7 Jun 2022 17:55:01 +0200 Subject: [PATCH] conda variant to install apps added --- setup_apps.sh | 6 ++-- setup_apps_conda.sh | 82 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+), 3 deletions(-) create mode 100644 setup_apps_conda.sh diff --git a/setup_apps.sh b/setup_apps.sh index ba48aae..86f0426 100644 --- a/setup_apps.sh +++ b/setup_apps.sh @@ -28,9 +28,9 @@ echo "Install JupyterHub..." apt-get install -y language-pack-de python3-pip python3 -m pip install jupyterhub npm install -g configurable-http-proxy -python3 -m pip install jupyterlab notebook jupyterlab-git -jupyter labextension install @jupyterlab/server-proxy -jupyter labextension install jupyter-matplotlib +python3 -m pip install jupyterlab notebook jupyterlab-git jupyter-server-proxy +#jupyter labextension install @jupyterlab/server-proxy +#jupyter labextension install jupyter-matplotlib echo "Setup JupyterHub..." mkdir /etc/jupyterhub/ diff --git a/setup_apps_conda.sh b/setup_apps_conda.sh new file mode 100644 index 0000000..85b654a --- /dev/null +++ b/setup_apps_conda.sh @@ -0,0 +1,82 @@ +#!/bin/bash + +#variant to use conda insted of pip, not tested + +#Src: https://medium.com/swlh/how-to-install-jupyterhub-using-conda-without-runing-as-root-and-make-it-a-service-59b843fead12 + +set -e + +if [ "$EUID" -ne 0 ] + then echo "Please run as root" + exit +fi + +#apt-get install -y --no-install-recommends libnvinfer7=7.1.3-1+cuda11.0 \ +# libnvinfer-dev=7.1.3-1+cuda11.0 \ +# libnvinfer-plugin7=7.1.3-1+cuda11.0 + +#add public ssh keys +if [ ! -s "~/.ssh/authorized_keys" ]; then + cat id_*.pub >> ~/.ssh/authorized_keys +fi + +echo "" +echo "Install supermicro system tools..." +apt-get update +apt-get install -y ipmitool && modprobe ipmi_devintf + +#echo "Install a recent notejs for jupyterhub from nodesource..." +#curl -fsSL https://deb.nodesource.com/setup_current.x | bash - +#apt-get install -y nodejs npm + +echo "Install anaconda..." +wget -O /tmp/anaconda3.sh https://repo.anaconda.com/archive/Anaconda3-2022.05-Linux-x86_64.sh +bash /tmp/anaconda3.sh + +echo "Install JupyterHub..." +apt-get install -y language-pack-de +conda install --yes jupyterhub jupyterlab notebook configurable-http-proxy jupyterlab-git jupyter-server-proxy +#jupyter labextension install jupyter-matplotlib + +echo "Setup JupyterHub..." +mkdir /etc/jupyterhub/ +cp jupyterhub_config.py /etc/jupyterhub/jupyterhub_config.py +cp jupyterhub.service /etc/systemd/system/jupyterhub.service +systemctl enable jupyterhub +systemctl start jupyterhub + +echo "Install Tensorflow..." +conda install --yes tensorflow-gpu + +echo "Install cantera..." +conda install --yes --channel cantera cantera + +echo "Install common Python libs..." +conda install --yes h5py tqdm pandas ipywidgets pillow matplotlib ipympl opencv-python + +#System monitoring +#echo "Install netdata..." +#wget -O /tmp/netdata-kickstart.sh https://my-netdata.io/kickstart.sh && sh /tmp/netdata-kickstart.sh +#echo "nvidia_smi: yes" >> /usr/lib/netdata/conf.d/python.d.conf +#service netdata restart +#on http://0.0.0.0:19999 + +echo "Install gpuview..." +python3 -m pip install gpuview +gpuview service --host 127.0.0.1 --port 9988 + +echo "Disable services that delays startup by wating for network connectivity..." +systemctl disable cloud-config +systemctl disable cloud-final.service +systemctl disable iscsid.service +systemctl disable open-iscsi.service + + +echo "show gpu state..." +nvidia-smi + +echo "" +echo "Setup successfully finished" + + +