pub key added, files renamed, disk setup added

This commit is contained in:
Nicolas 2022-03-16 01:35:27 +01:00
parent 94e73281cd
commit cf44be168e
4 changed files with 58 additions and 6 deletions

1
id_rsa_nicolas.pub Normal file
View File

@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDDx67IZhPzb+MFktnkx04nlUYL6dzzqFv9bJnafY0/XTXDAMQaTVOk/HEbqxKwf4/KpWVlW+Upodkxq5WvpeDVRo5vRGf4Fns67v1A9Z2MpW0lHA1IK2JptjZSJ0XpOq/Q1UzobZti7onyzgcg2TQrnevRSe3gZFA9etXqxmmQ5nzXlhh17P2mq2GEx1dA6LGZl8CTNd0vB8ocFjgTQfl6yNOlwcSu2aQAwRowh/To9SBTiJIhASJVpkZs8DV/0eTHvWaPX7kKgdmU5NX5mV0a9gULEWMZgHxPf6hyHnPBnIFDoK+EiNlC569JL4FTcYK3qmEvDEH8Q2SqNHajWnhLGNqvtHT+/rPMnxUQt+7FpmfHxMWSkUlt3gyJySCkNeEjtf2XnUTLqbBOatb9QgifLu9wCxdK7fqYKsPkrQbJCz0zW71ZhQsIwQACzZNcuMj5AEUHNNEPv6eJ4ivKApa/nTSdtmWwj/DuRjjjmBgpqTfiwJG9Q5yUfnGpC9ttycXurC4/LLiwCnkEj3ZHZ8ZlD8ld0U4412GZsMFrY6dEaRS520FaIvnpSpAmkx7SNBH/3b6p9Rix2VLjeMRreAQo7phfmVSjTrjJx9skGOszEXl8IKbhd58nq5EAEEmhafOhkC6y4ab8UvrrjlAHGb8HrJLzloHIVIEnvYuaS9bJqw== nicolas@Nici

View File

@ -9,19 +9,31 @@ fi
# libnvinfer-dev=7.1.3-1+cuda11.0 \ # libnvinfer-dev=7.1.3-1+cuda11.0 \
# libnvinfer-plugin7=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 "\n"
echo "Install and config python & jupyter..."
apt-get update && \ apt-get update && \
apt-get install -y ipmitool && modprobe ipmi_devintf && \ apt-get install -y ipmitool && modprobe ipmi_devintf && \
apt-get install -y python3-pip nodejs npm git && \ apt-get install -y python3-pip nodejs npm git && \
python3 -m pip install jupyterhub && \ python3 -m pip install jupyterhub && \
npm install -g configurable-http-proxy && \ npm install -g configurable-http-proxy && \
python3 -m pip install jupyterlab notebook tensorflow jupyterlab-git && \ python3 -m pip install jupyterlab notebook tensorflow jupyterlab-git && \
python3 -m pip install tqdm pandas ipywidgets pillow matplotlib && \ python3 -m pip install h5py tqdm pandas ipywidgets pillow matplotlib && \
python3 -m pip install scipy scikit-learn && \ python3 -m pip install scipy scikit-learn && \
mkdir /etc/jupyterhub/ && \ mkdir /etc/jupyterhub/ && \
cp jupyterhub_config.py /etc/jupyterhub/jupyterhub_config.py && \ cp jupyterhub_config.py /etc/jupyterhub/jupyterhub_config.py && \
cp jupyterhub.service /etc/systemd/system/jupyterhub.service && \ cp jupyterhub.service /etc/systemd/system/jupyterhub.service && \
systemctl enable jupyterhub && \ systemctl enable jupyterhub && \
systemctl start jupyterhub systemctl start jupyterhub
if [ $? -eq 0 ]; then
echo "\n"
echo "Setup successfully finished"
fi
#check nvidia drivers #check nvidia drivers
nvidia-smi nvidia-smi

View File

@ -20,12 +20,14 @@ fi
distribution=$(. /etc/os-release;echo $ID$VERSION_ID | sed -e 's/\.//g') distribution=$(. /etc/os-release;echo $ID$VERSION_ID | sed -e 's/\.//g')
architecture="x86_64" architecture="x86_64"
#Install drivers echo "\n"
echo "Install drivers..."
apt-get update && \ apt-get update && \
apt-get install -y linux-headers-$(uname -r) software-properties-common apt-get install -y linux-headers-$(uname -r) software-properties-common
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
#Install the CUDA repository public GPG key echo "\n"
echo "Install the CUDA repository public GPG key..."
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/$distribution/$architecture/7fa2af80.pub && \ apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/$distribution/$architecture/7fa2af80.pub && \
wget https://developer.download.nvidia.com/compute/cuda/repos/$distribution/$architecture/cuda-$distribution.pin && \ wget https://developer.download.nvidia.com/compute/cuda/repos/$distribution/$architecture/cuda-$distribution.pin && \
mv cuda-$distribution.pin /etc/apt/preferences.d/cuda-repository-pin-600 mv cuda-$distribution.pin /etc/apt/preferences.d/cuda-repository-pin-600
@ -33,11 +35,14 @@ if [ $? -eq 0 ]; then
fi fi
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
#Setup the CUDA network repository echo "\n"
echo "Setup the CUDA network repository..."
add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/$distribution/$architecture/ /" add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/$distribution/$architecture/ /"
fi fi
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
echo "\n"
echo "install CUDA..."
#Installs all CUDA Toolkit and Driver packages. Handles upgrading to the next version of the cuda package when it's released. #Installs all CUDA Toolkit and Driver packages. Handles upgrading to the next version of the cuda package when it's released.
#Use the --no-install-recommends option for a lean driver install without any dependencies on X packages #Use the --no-install-recommends option for a lean driver install without any dependencies on X packages
apt-get update && \ apt-get update && \
@ -46,6 +51,8 @@ if [ $? -eq 0 ]; then
fi fi
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
echo "\n"
echo "install libcudnn8..."
#Latest available version from ubuntu1804 repo: #Latest available version from ubuntu1804 repo:
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/libcudnn8_8.1.1.33-1+cuda11.2_amd64.deb && \ wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/libcudnn8_8.1.1.33-1+cuda11.2_amd64.deb && \
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/libcudnn8-dev_8.1.1.33-1+cuda11.2_amd64.deb && \ wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/libcudnn8-dev_8.1.1.33-1+cuda11.2_amd64.deb && \
@ -56,7 +63,8 @@ fi
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
#reboot system #reboot system
#systemctl reboot #systemctl reboot
echo "" echo "\n"
echo "Setup successfully finished"
echo "Type \"systemctl reboot\" to reboot system" echo "Type \"systemctl reboot\" to reboot system"
fi fi

31
setup_drives.sh Normal file
View File

@ -0,0 +1,31 @@
#!/bin/bash
#https://stackoverflow.com/questions/20797819/command-to-change-the-default-home-directory-of-a-user
#move user with files:
#usermod -m -d /newhome/username username
#Simply open this file using a text editor, type:
#vi /etc/default/useradd
#The default home directory defined by HOME variable, find line that read as follows:
#HOME=/home
#Replace with:
#HOME=/iscsi/user
#Save and close the file. Now you can add user using regular useradd command:
# useradd vivek
# passwd vivek
#Verify user information:
# finger vivek
apt-get update && \
apt-get install -y bcache-tools && \
sudo dd if=/dev/zero if=/dev/sdb bs=512 count=8 && \
sudo dd if=/dev/zero if=/dev/sdd bs=512 count=8 && \
wipefs -a /dev/sdb && \
wipefs -a /dev/sdd && \
make-bcache -C /dev/sdd -B /dev/sdb --discard --writeback && \
mkfs.ext4 /dev/bcache0 && \
mkdir /mnt/bcache && \
mount /dev/bcache0 /mnt/bcache && \
echo "/dev/bcache0 /mnt/bcache ext4 rw 0 0" >> /etc/fstab