Skip to content

Commit

Permalink
pc setup mods
Browse files Browse the repository at this point in the history
  • Loading branch information
ll7 committed Sep 12, 2024
1 parent aff0efe commit 1b18ed7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
8 changes: 8 additions & 0 deletions pc_setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# PC Setup

- Install Ubuntu 24.04 LTS
- Login to Admin user
- Create new pafxxx user
- execute `pc_setup_admin.sh` as admin user with `pafxxx` as argument
- change user to `pafxxx`
- execute `pc_setup_user.sh` as new user with `pafxxx` as argument
17 changes: 10 additions & 7 deletions pc_setup_admin.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
if [ $# -eq 0 ]; then
echo "Usage: $0 <paf-username> <paf-password>"
echo "Usage: $0 <pafxxx-username>"
exit 1
fi

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

sudo apt update
sudo apt upgrade
sudo apt upgrade -y
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 apt-get install -y 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
Expand All @@ -24,12 +22,13 @@ echo \
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 apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

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

# NVIDIA
# https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html

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 | \
Expand All @@ -40,7 +39,11 @@ 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 nvidia-ctk runtime configure --runtime=docker # configure the runtime to use nvidia-container-runtime

sudo systemctl restart docker

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

sudo systemctl restart docker

Expand Down
Empty file modified pc_setup_user.sh
100644 → 100755
Empty file.

0 comments on commit 1b18ed7

Please sign in to comment.