Initial Cezen AI Suite installer — Entry tier
This commit is contained in:
commit
a071602cf1
18 files changed
+1195
No files matched your search
@@ -0,0 +1,83 @@
|
||||
---
|
||||
# Docker CE + NVIDIA Container Toolkit
|
||||
- name: Add Docker GPG key
|
||||
apt_key:
|
||||
url: https://download.docker.com/linux/ubuntu/gpg
|
||||
state: present
|
||||
|
||||
- name: Add Docker apt repository
|
||||
apt_repository:
|
||||
repo: "deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable"
|
||||
state: present
|
||||
filename: docker
|
||||
|
||||
- name: Install Docker CE
|
||||
apt:
|
||||
name:
|
||||
- docker-ce
|
||||
- docker-ce-cli
|
||||
- containerd.io
|
||||
- docker-buildx-plugin
|
||||
- docker-compose-plugin
|
||||
state: present
|
||||
update_cache: yes
|
||||
|
||||
- name: Add cezen user to docker group
|
||||
user:
|
||||
name: cezen
|
||||
groups: docker
|
||||
append: yes
|
||||
|
||||
- name: Enable and start Docker
|
||||
systemd:
|
||||
name: docker
|
||||
enabled: yes
|
||||
state: started
|
||||
|
||||
# NVIDIA Container Toolkit (allows GPU passthrough into containers)
|
||||
- name: Add NVIDIA Container Toolkit repo
|
||||
shell: |
|
||||
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | \
|
||||
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' | \
|
||||
tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
|
||||
args:
|
||||
creates: /etc/apt/sources.list.d/nvidia-container-toolkit.list
|
||||
|
||||
- name: Install NVIDIA Container Toolkit
|
||||
apt:
|
||||
name: nvidia-container-toolkit
|
||||
state: present
|
||||
update_cache: yes
|
||||
|
||||
- name: Configure Docker to use NVIDIA runtime
|
||||
shell: nvidia-ctk runtime configure --runtime=docker
|
||||
notify: restart docker
|
||||
|
||||
- name: Set NVIDIA as default Docker runtime
|
||||
copy:
|
||||
dest: /etc/docker/daemon.json
|
||||
content: |
|
||||
{
|
||||
"default-runtime": "nvidia",
|
||||
"runtimes": {
|
||||
"nvidia": {
|
||||
"path": "nvidia-container-runtime",
|
||||
"runtimeArgs": []
|
||||
}
|
||||
},
|
||||
"log-driver": "json-file",
|
||||
"log-opts": {
|
||||
"max-size": "100m",
|
||||
"max-file": "3"
|
||||
}
|
||||
}
|
||||
mode: "0644"
|
||||
notify: restart docker
|
||||
|
||||
handlers:
|
||||
- name: restart docker
|
||||
systemd:
|
||||
name: docker
|
||||
state: restarted
|
||||
Reference in new issue
Block a user