2022-03-12 00:42:12 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [ "$EUID" -ne 0 ]
|
|
|
|
then echo "Please run as root"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2022-03-13 21:23:12 +00:00
|
|
|
#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
|
|
|
|
|
2022-03-16 00:35:27 +00:00
|
|
|
#add public ssh keys
|
|
|
|
if [ ! -s "~/.ssh/authorized_keys" ]; then
|
|
|
|
cat id_*.pub >> ~/.ssh/authorized_keys
|
|
|
|
fi
|
|
|
|
|
2022-03-17 15:03:07 +00:00
|
|
|
echo ""
|
2022-03-16 00:35:27 +00:00
|
|
|
echo "Install and config python & jupyter..."
|
2022-03-13 21:23:12 +00:00
|
|
|
apt-get update && \
|
|
|
|
apt-get install -y ipmitool && modprobe ipmi_devintf && \
|
|
|
|
apt-get install -y python3-pip nodejs npm git && \
|
2022-03-21 16:44:25 +00:00
|
|
|
apt-add-repository -y ppa:cantera-team/cantera && \
|
|
|
|
apt-get install -y cantera-python3 && \
|
2022-03-13 21:23:12 +00:00
|
|
|
python3 -m pip install jupyterhub && \
|
|
|
|
npm install -g configurable-http-proxy && \
|
2022-03-21 16:44:25 +00:00
|
|
|
python3 -m pip install jupyterlab notebook jupyterlab-git tensorflow && \
|
2022-03-16 00:35:27 +00:00
|
|
|
python3 -m pip install h5py tqdm pandas ipywidgets pillow matplotlib && \
|
2022-03-13 21:23:12 +00:00
|
|
|
python3 -m pip install scipy scikit-learn && \
|
|
|
|
mkdir /etc/jupyterhub/ && \
|
|
|
|
cp jupyterhub_config.py /etc/jupyterhub/jupyterhub_config.py && \
|
|
|
|
cp jupyterhub.service /etc/systemd/system/jupyterhub.service && \
|
|
|
|
systemctl enable jupyterhub && \
|
2022-03-16 00:35:27 +00:00
|
|
|
systemctl start jupyterhub
|
|
|
|
|
|
|
|
if [ $? -eq 0 ]; then
|
2022-03-17 13:14:49 +00:00
|
|
|
echo "check nvidia drivers..."
|
|
|
|
nvidia-smi
|
|
|
|
|
2022-03-17 15:03:07 +00:00
|
|
|
echo ""
|
2022-03-16 00:35:27 +00:00
|
|
|
echo "Setup successfully finished"
|
|
|
|
fi
|
2022-03-13 21:23:12 +00:00
|
|
|
|
2022-03-17 13:14:49 +00:00
|
|
|
|