Skip to content

Commit

Permalink
Added setup scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianTrommer committed Sep 12, 2024
1 parent 40ac660 commit b9ea478
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
49 changes: 49 additions & 0 deletions pc_setup_admin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
if [ $# -eq 0 ]; then
echo "Usage: $0 <paf-username> <paf-password>"
exit 1
fi

sudo useradd -m "$1" -p "$2" -s /bin/bash

sudo apt update
sudo apt upgrade
sudo apt install -y git gh python-is-python3 python3-pip openssh-server
sudo systemctl enable ssh

# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

sudo groupadd docker
sudo usermod -aG docker "$1"

# NVIDIA

curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
&& curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list

sudo apt-get update

sudo apt-get install -y nvidia-container-toolkit

nvidia-ctk runtime configure --runtime=docker --config=/home/"$1"/.config/docker/daemon.json

sudo systemctl restart docker

sudo nvidia-ctk config --set nvidia-container-cli.no-cgroups --in-place

sudo snap install --classic code
7 changes: 7 additions & 0 deletions pc_setup_user.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cd
mkdir git
cd git
git clone https://github.com/una-auxme/paf23.git

cd paf23
./dc-run-file.sh build/docker-compose.yaml

0 comments on commit b9ea478

Please sign in to comment.