-
Notifications
You must be signed in to change notification settings - Fork 524
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
packages: add nvidia-container-toolkit
This package is required to support NVIDIA GPUs within orchestrated containers Signed-off-by: Arnaldo Garcia Rincon <agarrcia@amazon.com>
- Loading branch information
1 parent
89c26d2
commit 1786f62
Showing
7 changed files
with
111 additions
and
0 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,23 @@ | ||
[package] | ||
name = "nvidia-container-toolkit" | ||
version = "0.1.0" | ||
edition = "2018" | ||
publish = false | ||
build = "build.rs" | ||
|
||
[lib] | ||
path = "pkg.rs" | ||
|
||
[package.metadata.build-package] | ||
releases-url = "https://github.com/NVIDIA/nvidia-container-toolkit/releases" | ||
|
||
[[package.metadata.build-package.external-files]] | ||
url = "https://github.com/NVIDIA/nvidia-container-toolkit/archive/v1.7.0/v1.7.0.tar.gz" | ||
sha512 = "7bc3601ca5cca5b3ad7f30f9c2453d41452b425811d37209c20b7f375d557666a1369d756b52a007406996758b09d47635f2e8628bf363298ec247cb3d3f8845" | ||
|
||
[build-dependencies] | ||
glibc = { path = "../glibc" } | ||
libnvidia-container = { path = "../libnvidia-container" } | ||
# This package depends on `shimpei`, but it is built in the `os` package | ||
# which is expected to be pulled in | ||
# os = { path = "../os" } |
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,9 @@ | ||
use std::process::{exit, Command}; | ||
|
||
fn main() -> Result<(), std::io::Error> { | ||
let ret = Command::new("buildsys").arg("build-package").status()?; | ||
if !ret.success() { | ||
exit(1); | ||
} | ||
Ok(()) | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/nvidia-container-toolkit/nvidia-container-toolkit-config.toml
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,5 @@ | ||
[nvidia-container-cli] | ||
root = "/" | ||
path = "/usr/bin/nvidia-container-cli" | ||
environment = [] | ||
ldconfig = "@/sbin/ldconfig" |
1 change: 1 addition & 0 deletions
1
packages/nvidia-container-toolkit/nvidia-container-toolkit-tmpfiles.conf
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 @@ | ||
C /etc/nvidia-container-runtime/config.toml - - - - |
54 changes: 54 additions & 0 deletions
54
packages/nvidia-container-toolkit/nvidia-container-toolkit.spec
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,54 @@ | ||
%global goproject github.com/NVIDIA | ||
%global gorepo nvidia-container-toolkit | ||
%global goimport %{goproject}/%{gorepo} | ||
|
||
%global gover 1.7.0 | ||
%global rpmver %{gover} | ||
|
||
Name: %{_cross_os}nvidia-container-toolkit | ||
Version: %{rpmver} | ||
Release: 1%{?dist} | ||
Summary: Tool to build and run GPU accelerated containers | ||
License: Apache-2.0 | ||
URL: https://%{goimport} | ||
|
||
Source0: https://%{goimport}/archive/v%{gover}/v%{gover}.tar.gz | ||
Source1: nvidia-container-toolkit-config.toml | ||
Source2: nvidia-container-toolkit-tmpfiles.conf | ||
Source3: nvidia-oci-hooks-json | ||
|
||
BuildRequires: %{_cross_os}glibc-devel | ||
Requires: %{_cross_os}libnvidia-container | ||
Requires: %{_cross_os}shimpei | ||
|
||
%description | ||
%{summary}. | ||
|
||
%prep | ||
%autosetup -n %{gorepo}-%{gover} -p1 | ||
%cross_go_setup %{gorepo}-%{gover} %{goproject} %{goimport} | ||
|
||
%build | ||
%cross_go_configure %{goimport} | ||
go build -buildmode=pie -ldflags="${GOLDFLAGS}" -o nvidia-container-toolkit ./cmd/nvidia-container-toolkit | ||
|
||
%install | ||
install -d %{buildroot}%{_cross_bindir} | ||
install -d %{buildroot}%{_cross_tmpfilesdir} | ||
install -d %{buildroot}%{_cross_templatedir} | ||
install -d %{buildroot}%{_cross_datadir}/nvidia-container-toolkit | ||
install -d %{buildroot}%{_cross_factorydir}/etc/nvidia-container-runtime | ||
install -p -m 0755 nvidia-container-toolkit %{buildroot}%{_cross_bindir}/nvidia-container-runtime-hook | ||
install -m 0644 %{S:1} %{buildroot}%{_cross_factorydir}/etc/nvidia-container-runtime/config.toml | ||
install -m 0644 %{S:2} %{buildroot}%{_cross_tmpfilesdir}/nvidia-container-toolkit.conf | ||
install -m 0644 %{S:3} %{buildroot}%{_cross_templatedir}/nvidia-oci-hooks-json | ||
ln -s shimpei %{buildroot}%{_cross_bindir}/nvidia-oci | ||
|
||
%files | ||
%license LICENSE | ||
%{_cross_attribution_file} | ||
%{_cross_bindir}/nvidia-container-runtime-hook | ||
%{_cross_bindir}/nvidia-oci | ||
%{_cross_templatedir}/nvidia-oci-hooks-json | ||
%{_cross_factorydir}/etc/nvidia-container-runtime/config.toml | ||
%{_cross_tmpfilesdir}/nvidia-container-toolkit.conf |
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,18 @@ | ||
{ | ||
"hooks": { | ||
"prestart": [ | ||
{{#if settings.oci-hooks.log4j-hotpatch-enabled}} | ||
{ "path": "/usr/libexec/hotdog/hotdog-cc-hook" }, | ||
{{/if}} | ||
{ | ||
"path": "/usr/bin/nvidia-container-runtime-hook", | ||
"args": ["nvidia-container-runtime-hook", "prestart"] | ||
} | ||
], | ||
"poststart": [ | ||
{{#if settings.oci-hooks.log4j-hotpatch-enabled}} | ||
{ "path": "/usr/libexec/hotdog/hotdog-poststart-hook" } | ||
{{/if}} | ||
] | ||
} | ||
} |
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 @@ | ||
// not used |