-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added cuda-init script for a worker and gitignore file
I have added .DS_Store files to gitignore, since MacOSX throws them all over the place. Furthermore, I added a init-worker-with-cuda.sh script, that initializes a worker with a fresh installation of cuda, nvidia drivers and more. I hope that this will solve a few bugs.
- Loading branch information
1 parent
8b40aaf
commit 0df4d84
Showing
3 changed files
with
48 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
## .DS_Store files of MacOsX | ||
*.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/sh | ||
# Following arguments are necessary: | ||
# 1. -> token , e.g. "f38242.e7f3XXXXXXXXe231e" | ||
# 2. -> IP:port of the master | ||
echo "The following token will be used: ${1}" | ||
echo "The master nodes IP:Port is: ${2}" | ||
sudo bash -c 'apt-get update && apt-get install -y apt-transport-https | ||
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - | ||
cat <<EOF >/etc/apt/sources.list.d/kubernetes.list | ||
deb http://apt.kubernetes.io/ kubernetes-xenial main | ||
EOF | ||
apt-get update' | ||
sudo apt-get install -y --allow-unauthenticated docker-engine | ||
sudo apt-get install -y --allow-unauthenticated kubelet kubeadm kubectl kubernetes-cni | ||
sudo groupadd docker | ||
sudo usermod -aG docker $USER | ||
|
||
# Install Cuda and Nvidia driver | ||
sudo apt-get install linux-headers-$(uname -r) | ||
sudo add-apt-repository ppa:graphics-drivers/ppa | ||
sudo apt-get update | ||
sudo apt-get install nvidia-375 | ||
sudo apt-get install nvidia-cuda-dev nvidia-cuda-toolkit nvidia-nsight | ||
|
||
sudo systemctl enable docker && systemctl start docker | ||
sudo systemctl enable kubelet && systemctl start kubelet | ||
|
||
echo 'You might need to reboot / relogin to make docker work correctly' | ||
|
||
for file in /etc/systemd/system/kubelet.service.d/*-kubeadm.conf | ||
do | ||
echo "Found ${file}" | ||
FILE_NAME=$file | ||
done | ||
|
||
echo "Chosen ${FILE_NAME} as kubeadm.conf" | ||
sudo sed -i '/^ExecStart=\/usr\/bin\/kubelet/ s/$/ --feature-gates="Accelerators=true"/' ${FILE_NAME} | ||
|
||
sudo systemctl daemon-reload | ||
sudo systemctl restart kubelet | ||
|
||
sudo kubeadm join --token $1 $2 |