Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ members = [
"packages/libcap",
"packages/libcrypto",
"packages/libdevmapper",
"packages/libdrm",
"packages/libelf",
"packages/libexpat",
"packages/libffi",
Expand Down Expand Up @@ -117,6 +118,7 @@ members = [
"packages/rdma-core",
"packages/readline",
"packages/release",
"packages/rocm-k8s-device-plugin",
"packages/runc",
"packages/selinux-policy",
"packages/soci-snapshotter",
Expand Down
2 changes: 2 additions & 0 deletions kits/bottlerocket-core-kit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ libcap = { path = "../../packages/libcap" }
libcrypto = { path = "../../packages/libcrypto" }
libcryptsetup = { path = "../../packages/libcryptsetup" }
libdevmapper = { path = "../../packages/libdevmapper" }
libdrm = { path = "../../packages/libdrm" }
libelf = { path = "../../packages/libelf" }
libexpat = { path = "../../packages/libexpat" }
libffi = { path = "../../packages/libffi" }
Expand Down Expand Up @@ -128,6 +129,7 @@ procps = { path = "../../packages/procps" }
rdma-core = { path = "../../packages/rdma-core" }
readline = { path = "../../packages/readline" }
release = { path = "../../packages/release" }
rocm-k8s-device-plugin = { path = "../../packages/rocm-k8s-device-plugin" }
rottweiler = { path = "../../packages/rottweiler" }
runc = { path = "../../packages/runc" }
selinux-policy = { path = "../../packages/selinux-policy" }
Expand Down
23 changes: 23 additions & 0 deletions packages/libdrm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[package]
name = "libdrm"
version = "0.1.0"
edition = "2021"
publish = false
build = "../build.rs"

[lib]
path = "../packages.rs"

[package.metadata.build-package]
releases-url = "https://dri.freedesktop.org/libdrm/"

[[package.metadata.build-package.external-files]]
url = "https://dri.freedesktop.org/libdrm/libdrm-2.4.129.tar.xz"
sha512 = "3ee702cc4a578e9ab231caf8a84700e4dff6f3da70731610121ac2c3390f42e42ad144ea61c53582e3a8adfb1d6bf8254993c5c6eaf85a51421e26d51d341cd4"

[[package.metadata.build-package.external-files]]
url = "https://dri.freedesktop.org/libdrm/libdrm-2.4.129.tar.xz.sig"
sha512 = "21baba37df19d0adf805e508f91e28f2bbdaa4d7fb6f99837d31c9d966833fbd8bdd93d97eab724b5a79e4d0ef4636fea176cd34db6c527da7e0b88907dd12db"

[build-dependencies]
glibc = { path = "../glibc" }
301 changes: 301 additions & 0 deletions packages/libdrm/gpgkey-34FF9526CFEF0E97A340E2E40FDE7BE0E88F5E48.asc

Large diffs are not rendered by default.

63 changes: 63 additions & 0 deletions packages/libdrm/libdrm.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
Name: %{_cross_os}libdrm
Version: 2.4.129
Release: 1%{?dist}
Summary: Direct rendering manager library
License: MIT
URL: https://dri.freedesktop.org
Source0: https://dri.freedesktop.org/libdrm/libdrm-%{version}.tar.xz
Source1: https://dri.freedesktop.org/libdrm/libdrm-%{version}.tar.xz.sig
Source2: gpgkey-34FF9526CFEF0E97A340E2E40FDE7BE0E88F5E48.asc

BuildRequires: %{_cross_os}glibc-devel
Requires: %{_cross_os}glibc

%description
%{summary}.

%package devel
Summary: Files for development using the direct rendering manager library
Requires: %{name}

%description devel
%{summary}.

%prep
%{gpgverify} --data=%{S:0} --signature=%{S:1} --keyring=%{S:2}
%autosetup -n libdrm-%{version} -p1

%build
CONFIGURE_OPTS=(
--auto-features=disabled
-Dcairo-tests=disabled
-Dman-pages=disabled
-Dvalgrind=disabled
-Dfreedreno=disabled
-Dvc4=disabled
-Detnaviv=disabled
-Dexynos=disabled
-Dtegra=disabled
-Domap=disabled
-Dintel=disabled
-Dradeon=disabled
-Damdgpu=enabled
-Dnouveau=disabled
-Dtests=false
)

%cross_meson "${CONFIGURE_OPTS[@]}"
%cross_meson_build

%install
%cross_meson_install

%files
%{_cross_attribution_file}
%{_cross_libdir}/libdrm.so.*
%{_cross_libdir}/libdrm_amdgpu.so.*
%{_cross_datadir}/libdrm/amdgpu.ids

%files devel
%{_cross_libdir}/libdrm.so
%{_cross_libdir}/libdrm_amdgpu.so
%{_cross_includedir}/*
%{_cross_pkgconfigdir}/*.pc
21 changes: 21 additions & 0 deletions packages/rocm-k8s-device-plugin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "rocm-k8s-device-plugin"
version = "0.1.0"
edition = "2021"
publish = false
build = "../build.rs"

[lib]
path = "../packages.rs"

[package.metadata.build-package]
releases-url = "https://github.com/ROCm/k8s-device-plugin/releases"

[[package.metadata.build-package.external-files]]
url = "https://github.com/ROCm/k8s-device-plugin/archive/v1.31.0.8.tar.gz"
sha512 = "23a127b46ad15cabbdd9abe18a8b75140340dcb10f41c9efdcfd30b38db7142edabaf6a97ed2c621f0414c78c0cb87fdc81a30b5e3fb016d16cbd11210143326"

[build-dependencies]
glibc = { path = "../glibc" }
libdrm = { path = "../libdrm" }
hwloc = { path = "../hwloc" }
17 changes: 17 additions & 0 deletions packages/rocm-k8s-device-plugin/rocm-k8s-device-plugin.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[Unit]
Description=Start ROCm kubernetes device plugin
After=kubelet.service [email protected]
Wants=kubelet.service [email protected]

[Service]
# Ensure that the kubelet device plugin socket exists before we start
# A brief sleep is needed to avoid the `test` failing its first check
ExecStartPre=/usr/bin/sleep 0.1
ExecStartPre=/usr/bin/test -S /var/lib/kubelet/device-plugins/kubelet.sock
ExecStart=/usr/bin/rocm-device-plugin -logtostderr=true -stderrthreshold=INFO -v=5
TimeoutSec=0
RestartSec=2
Restart=always

[Install]
WantedBy=multi-user.target
74 changes: 74 additions & 0 deletions packages/rocm-k8s-device-plugin/rocm-k8s-device-plugin.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
%global goproject github.com/ROCm
%global gorepo k8s-device-plugin
%global goimport %{goproject}/%{gorepo}

%global gover 1.31.0.8
%global rpmver %{gover}

Name: %{_cross_os}rocm-k8s-device-plugin
Version: %{rpmver}
Release: 1%{?dist}
Summary: Kubernetes device plugin for AMD GPUs
License: Apache-2.0
URL: https://github.com/ROCm/k8s-device-plugin
Source0: https://github.com/ROCm/k8s-device-plugin/archive/v%{gover}.tar.gz
Source1: rocm-k8s-device-plugin.service

BuildRequires: %{_cross_os}glibc-devel
BuildRequires: %{_cross_os}libdrm-devel
BuildRequires: %{_cross_os}hwloc-devel
Requires: %{name}(binaries)
Requires: %{_cross_os}libdrm
Requires: %{_cross_os}hwloc

%description
%{summary}.

%package bin
Summary: Kubernetes device plugin for AMD GPUs binaries
Provides: %{name}(binaries)
Requires: (%{_cross_os}image-feature(no-fips) and %{name})
Conflicts: (%{_cross_os}image-feature(fips) or %{name}-fips-bin)

%description bin
%{summary}.

%package fips-bin
Summary: Kubernetes device plugin for AMD GPUs binaries, FIPS edition
Provides: %{name}(binaries)
Requires: (%{_cross_os}image-feature(fips) and %{name})
Conflicts: (%{_cross_os}image-feature(no-fips) or %{name}-bin)

%description fips-bin
%{summary}.

%prep
%autosetup -n %{gorepo}-%{gover} -p1
%cross_go_setup %{gorepo}-%{gover} %{goproject} %{goimport}

%build
%cross_go_configure %{goimport}

go build -ldflags="${GOLDFLAGS}" -o rocm-device-plugin ./cmd/k8s-device-plugin/
gofips build -ldflags="${GOLDFLAGS}" -o fips/rocm-device-plugin ./cmd/k8s-device-plugin/

%install
install -d %{buildroot}%{_cross_bindir}
install -p -m 0755 rocm-device-plugin %{buildroot}%{_cross_bindir}

install -d %{buildroot}%{_cross_fips_bindir}
install -p -m 0755 fips/rocm-device-plugin %{buildroot}%{_cross_fips_bindir}

install -d %{buildroot}%{_cross_unitdir}
install -p -m 0644 %{S:1} %{buildroot}%{_cross_unitdir}

%files
%license LICENSE
%{_cross_attribution_file}
%{_cross_unitdir}/rocm-k8s-device-plugin.service

%files bin
%{_cross_bindir}/rocm-device-plugin

%files fips-bin
%{_cross_fips_bindir}/rocm-device-plugin