This commit is contained in:
Dict Xiong 2023-11-22 20:14:14 +08:00
parent ed5b5f1e14
commit bf5f6d8da8

View File

@ -22,14 +22,14 @@ apt update
apt install -y make cmake python3 python3-pip gcc-10 g++-10 dkms net-tools ethtool apt install -y make cmake python3 python3-pip gcc-10 g++-10 dkms net-tools ethtool
ethtool -s eno1 wol g ethtool -s eno1 wol g
cd /tmp cd /tmp
wget http://192.168.16.118/MLNX_OFED_LINUX-5.8-2.0.3.0-ubuntu22.04-x86_64.tgz wget http://192.168.16.118/MLNX_OFED_LINUX-5.8-3.0.7.0-ubuntu22.04-x86_64.tgz
wget http://192.168.16.118/NVIDIA-Linux-x86_64-460.106.00.run wget http://192.168.16.118/NVIDIA-Linux-x86_64-460.106.00.run
wget http://192.168.16.118/cuda_11.2.0_460.27.04_linux.run # wget http://192.168.16.118/cuda_11.2.0_460.27.04_linux.run
# mlnx ofed # mlnx ofed
apt install -y pkg-config swig bison dpatch m4 libnl-3-dev autoconf automake libnl-route-3-dev chrpath quilt libgfortran5 libltdl-dev libfuse2 debhelper flex gfortran autotools-dev tk graphviz libnl-route-3-200 apt install -y pkg-config swig bison dpatch m4 libnl-3-dev autoconf automake libnl-route-3-dev chrpath quilt libgfortran5 libltdl-dev libfuse2 debhelper flex gfortran autotools-dev tk graphviz libnl-route-3-200
x MLNX_OFED_LINUX-5.8-2.0.3.0-ubuntu22.04-x86_64.tgz x MLNX_OFED_LINUX-5.8-3.0.7.0-ubuntu22.04-x86_64.tgz
cd MLNX_OFED_LINUX-5.8-2.0.3.0-ubuntu22.04-x86_64 cd MLNX_OFED_LINUX-5.8-3.0.7.0-ubuntu22.04-x86_64
./mlnxofedinstall --skip-unsupported-devices-check ./mlnxofedinstall --skip-unsupported-devices-check
/etc/init.d/openibd restart /etc/init.d/openibd restart
@ -39,9 +39,10 @@ cd /tmp
#update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10 #update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10
# see: https://louwrentius.com/unattended-automatic-installation-of-linux-nvidia-binary-driver.html # see: https://louwrentius.com/unattended-automatic-installation-of-linux-nvidia-binary-driver.html
sh /tmp/NVIDIA-Linux-x86_64-460.106.00.run -q -a -n -X -s sh /tmp/NVIDIA-Linux-x86_64-460.106.00.run -q -a -n -X -s
sh /tmp/cuda_11.2.0_460.27.04_linux.run # sh /tmp/cuda_11.2.0_460.27.04_linux.run
# container # container
export http_proxy=http://192.168.16.118:8118 https_proxy=$http_proxy
cd /tmp cd /tmp
curl -fsSL https://get.docker.com -o get-docker.sh && sudo sh get-docker.sh --mirror Aliyun curl -fsSL https://get.docker.com -o get-docker.sh && sudo sh get-docker.sh --mirror Aliyun
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \ distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
@ -51,7 +52,7 @@ distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
apt update apt update
apt install nvidia-container-runtime nvidia-container-toolkit apt install -y nvidia-container-runtime nvidia-container-toolkit
nvidia-ctk runtime configure --runtime=docker nvidia-ctk runtime configure --runtime=docker
systemctl restart docker systemctl restart docker
mkdir /etc/systemd/system/docker.service.d mkdir /etc/systemd/system/docker.service.d
@ -75,14 +76,14 @@ insert_if_not_exist()
} }
cd /opt cd /opt
git clone https://git.nasp.ob.ac.cn/NASP/configurations git clone https://git.nasp.ob.ac.cn/NASP/configurations
insert_if_not_exist "/etc/crontab" "59 23 * * * root \"$THIS_DIR\"/schedule-poweroff.sh" insert_if_not_exist "/etc/crontab" "59 22 * * * root /opt/configurations/testbed/scripts/schedule-poweroff.sh"
cd /opt cd /opt
git clone https://git.nasp.ob.ac.cn/NASP/registry git clone https://git.nasp.ob.ac.cn/NASP/registry
cd registry/scripts cd registry/scripts
./testbed_deploy.sh ./testbed_deploy.sh
# scripts # scripts
cp "$THIS_DIR"/dnew /usr/local/bin/ cp /opt/configurations/testbed/scripts/dnew /usr/local/bin/
echo "will reboot in 10 seconds... press ctrl-c to cancel." echo "will reboot in 10 seconds... press ctrl-c to cancel."