From e74fedab02982f7eae248e74b5651ff5a9c4d1ae Mon Sep 17 00:00:00 2001 From: Arnaldo Garcia Rincon Date: Thu, 21 Apr 2022 22:32:32 +0000 Subject: [PATCH] packages,sources: add NVIDIA docker configurations This adds the shimpei and docker configurations to set up the `nvidia` runtime for variants that use docker as their containers runtime. Signed-off-by: Arnaldo Garcia Rincon --- packages/docker-engine/daemon-nvidia-json | 19 +++++++++++++++++++ packages/docker-engine/docker-engine.spec | 3 +++ .../shared-defaults/docker-daemon-nvidia.toml | 3 +++ ...l => nvidia-oci-hooks-containerd-cri.toml} | 0 .../nvidia-oci-hooks-docker.toml | 17 +++++++++++++++++ .../defaults.d/70-oci-hooks.toml | 2 +- 6 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 packages/docker-engine/daemon-nvidia-json create mode 100644 sources/models/shared-defaults/docker-daemon-nvidia.toml rename sources/models/shared-defaults/{nvidia-oci-hooks.toml => nvidia-oci-hooks-containerd-cri.toml} (100%) create mode 100644 sources/models/shared-defaults/nvidia-oci-hooks-docker.toml diff --git a/packages/docker-engine/daemon-nvidia-json b/packages/docker-engine/daemon-nvidia-json new file mode 100644 index 00000000000..572775d7a5e --- /dev/null +++ b/packages/docker-engine/daemon-nvidia-json @@ -0,0 +1,19 @@ +{ + "log-driver": "journald", + "live-restore": true, + "max-concurrent-downloads": 10, + "storage-driver": "overlay2", + "exec-opts": ["native.cgroupdriver=cgroupfs"], + "data-root": "/var/lib/docker", + "default-runtime": "nvidia", + "runtimes": { "shimpei": { "path": "shimpei" }, "nvidia": { "path": "nvidia-oci" } }, + "selinux-enabled": true, + "default-ulimits": { "nofile": { "Name": "nofile", "Soft": 1024, "Hard": 4096 } } + {{#if settings.container-registry.mirrors}} + {{#each settings.container-registry.mirrors}} + {{#if (eq registry "docker.io" )}}, + "registry-mirrors": [{{join_array ", " endpoint}}] + {{/if}} + {{/each}} + {{/if}} +} diff --git a/packages/docker-engine/docker-engine.spec b/packages/docker-engine/docker-engine.spec index 118d50a95e6..50edfdafa03 100644 --- a/packages/docker-engine/docker-engine.spec +++ b/packages/docker-engine/docker-engine.spec @@ -22,6 +22,7 @@ Source1: docker.service Source2: docker.socket Source3: docker-sysusers.conf Source4: daemon-json +Source5: daemon-nvidia-json Source1000: clarify.toml BuildRequires: git @@ -69,6 +70,7 @@ install -p -m 0644 %{S:3} %{buildroot}%{_cross_sysusersdir}/docker.conf install -d %{buildroot}%{_cross_templatedir} install -p -m 0644 %{S:4} %{buildroot}%{_cross_templatedir}/docker-daemon-json +install -p -m 0644 %{S:5} %{buildroot}%{_cross_templatedir}/docker-daemon-nvidia-json %cross_scan_attribution --clarify %{S:1000} go-vendor vendor @@ -80,5 +82,6 @@ install -p -m 0644 %{S:4} %{buildroot}%{_cross_templatedir}/docker-daemon-json %{_cross_unitdir}/docker.socket %{_cross_sysusersdir}/docker.conf %{_cross_templatedir}/docker-daemon-json +%{_cross_templatedir}/docker-daemon-nvidia-json %changelog diff --git a/sources/models/shared-defaults/docker-daemon-nvidia.toml b/sources/models/shared-defaults/docker-daemon-nvidia.toml new file mode 100644 index 00000000000..1640a301e47 --- /dev/null +++ b/sources/models/shared-defaults/docker-daemon-nvidia.toml @@ -0,0 +1,3 @@ +[configuration-files.docker-daemon-config] +path = "/etc/docker/daemon.json" +template-path = "/usr/share/templates/docker-daemon-nvidia-json" diff --git a/sources/models/shared-defaults/nvidia-oci-hooks.toml b/sources/models/shared-defaults/nvidia-oci-hooks-containerd-cri.toml similarity index 100% rename from sources/models/shared-defaults/nvidia-oci-hooks.toml rename to sources/models/shared-defaults/nvidia-oci-hooks-containerd-cri.toml diff --git a/sources/models/shared-defaults/nvidia-oci-hooks-docker.toml b/sources/models/shared-defaults/nvidia-oci-hooks-docker.toml new file mode 100644 index 00000000000..1de919b4cf4 --- /dev/null +++ b/sources/models/shared-defaults/nvidia-oci-hooks-docker.toml @@ -0,0 +1,17 @@ +[settings.oci-hooks] +log4j-hotpatch-enabled = false + +[metadata.settings.oci-hooks] +affected-services = ["oci-hooks"] + +[services.oci-hooks] +configuration-files = ["oci-hooks", "nvidia-oci-hooks"] +restart-commands = [] + +[configuration-files.oci-hooks] +path = "/etc/shimpei/shimpei-hooks.json" +template-path = "/usr/share/templates/oci-default-hooks-json" + +[configuration-files.nvidia-oci-hooks] +path = "/etc/shimpei/nvidia-oci-hooks.json" +template-path = "/usr/share/templates/nvidia-oci-hooks-json" diff --git a/sources/models/src/aws-k8s-1.22-nvidia/defaults.d/70-oci-hooks.toml b/sources/models/src/aws-k8s-1.22-nvidia/defaults.d/70-oci-hooks.toml index 5b90b8a6234..d91eec45282 120000 --- a/sources/models/src/aws-k8s-1.22-nvidia/defaults.d/70-oci-hooks.toml +++ b/sources/models/src/aws-k8s-1.22-nvidia/defaults.d/70-oci-hooks.toml @@ -1 +1 @@ -../../../shared-defaults/nvidia-oci-hooks.toml \ No newline at end of file +../../../shared-defaults/nvidia-oci-hooks-containerd-cri.toml \ No newline at end of file