diff options
-rw-r--r-- | .SRCINFO | 17 | ||||
-rw-r--r-- | PKGBUILD | 32 | ||||
-rw-r--r-- | README.md | 20 | ||||
-rwxr-xr-x | buildandcopy.sh | 26 | ||||
-rw-r--r-- | nvidia-docker.install | 20 |
5 files changed, 115 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..5a3643068fe0 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,17 @@ +pkgbase = nvidia-docker + pkgdesc = Build and run Docker containers leveraging NVIDIA GPUs + pkgver = 1.0.0.rc.3 + pkgrel = 1 + url = https://github.com/NVIDIA/nvidia-docker + install = nvidia-docker.install + arch = x86_64 + license = custom + makedepends = libarchive + optdepends = cuda + optdepends = nvidia + optdepends = opencl-nvidia + source_x86_64 = https://github.com/NVIDIA/nvidia-docker/releases/download/v1.0.0-rc.3/nvidia-docker-1.0.0.rc.3-1.x86_64.rpm + sha256sums_x86_64 = 67e087eaf1941c997a052a5b57e3520fd3589e958167a0d71c21a214f1a9956a + +pkgname = nvidia-docker + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..9e4e0621566b --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,32 @@ +# Maintainer: Marcel Huber <marcelhuberfoo@gmail.com> + +pkgname=nvidia-docker +pkgver=1.0.0.rc.3 +pkgrel=1 +pkgdesc="Build and run Docker containers leveraging NVIDIA GPUs" +license=('custom') +arch=('x86_64') +url='https://github.com/NVIDIA/nvidia-docker' +makedepends=(libarchive) +optdepends=(cuda nvidia opencl-nvidia) +install=${pkgname}.install +source_x86_64=(https://github.com/NVIDIA/nvidia-docker/releases/download/v1.0.0-rc.3/nvidia-docker-${pkgver}-1.${arch}.rpm) +sha256sums_x86_64=('67e087eaf1941c997a052a5b57e3520fd3589e958167a0d71c21a214f1a9956a') + +build() { + cd $srcdir + sed -r -i -e '/^User=/ d' \ + -e 's|^(.*SOCK_DIR=).*$|\1/run/docker/plugins"|' \ + -e 's|(SPEC_FILE=)/etc|\1/run|' \ + usr/lib/systemd/system/$pkgname.service +} + +package() { + cd $srcdir + install -m755 -d $pkgdir/usr/{bin,share/licenses/$pkgname,lib/systemd/system} + install -D -m755 usr/bin/$pkgname* "$pkgdir/usr/bin/" + install -D -m644 usr/lib/systemd/system/$pkgname.service "$pkgdir/usr/lib/systemd/system/" + install -D -m644 usr/share/licenses/$pkgname-*/LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" +} + +# vim: set ft=sh syn=sh ts=2 sw=2 et: diff --git a/README.md b/README.md new file mode 100644 index 000000000000..3675d377c689 --- /dev/null +++ b/README.md @@ -0,0 +1,20 @@ +arch-nvidia-docker +============ + + ArchLinux PKGBUILD for nvidia-docker tools https://github.com/NVIDIA/nvidia-docker + + The package source build is submitted to AUR at: https://aur.archlinux.org/packages/nvidia-docker/ + +Building and submitting the package +---------------------- + +* Update PKGBUILD and set `pkgver` to match new version from https://github.com/NVIDIA/nvidia-docker/releases +* Update the checksums using `updpkgsums` +* Make the package using `makepkg --force --nodeps --cleanbuild` +* Check the submitting guidelines at https://wiki.archlinux.org/index.php/Arch%20User%20Repository#Submitting%20packages +* `makepkg --printsrcinfo > .SRCINFO` +* `git add .SRCINFO` +* `git commit -m "useful commit message"` +* `git push origin` + +To automate most of the steps, you could also use the `buildandcopy.sh` script provided. diff --git a/buildandcopy.sh b/buildandcopy.sh new file mode 100755 index 000000000000..8593b99e2c6f --- /dev/null +++ b/buildandcopy.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +thedirs="." +repodir=/home/own-repo + +thingsToDo=( + 'for n in $thedirs; do ( cd $n && updpkgsums; makepkg --force --nodeps --nobuild; makepkg --printsrcinfo > .SRCINFO ); done' + 'git diff --quiet --no-ext-diff --exit-code && echo clean || ( git diff -b -w && git add -p && git commit ) || true' + 'for n in $thedirs; do ( cd $n && updpkgsums; makepkg --force --nodeps --cleanbuild ); done' + 'test -n "$repodir" -a -d "$repodir" && for n in $thedirs; do for pkgdir in $(find $n -name "*.tar.xz" -printf "%h\n" | sort | uniq); do cpfn=$(ls -tc1 $pkgdir/*.tar.xz | head -1); echo "move [$cpfn]? (y*|n)"; read v; if [ ! "$v" = "n" -a ! "$v" = "N" ]; then sh -c "mv --interactive --update $cpfn $repodir && ( repo-add --new --quiet ${repodir}/ownrepo.db.tar.gz $repodir/$(basename $cpfn); )"; fi; done; done' + 'git push origin' + 'for n in $thedirs; do ( cd $n && makepkg --nodeps --noextract --force --nobuild --noarchive --nocheck --noprepare --skipinteg --clean ); done' +) + +set -e + +for n in "${thingsToDo[@]}"; do + echo "Continue with [$n] (y*|n)?" + read v + if [ "$v" = "n" -o "$v" = "N" ]; then + echo "..command skipped.."; + else + eval "$n"; + fi +done + diff --git a/nvidia-docker.install b/nvidia-docker.install new file mode 100644 index 000000000000..7b0fccfe9cb3 --- /dev/null +++ b/nvidia-docker.install @@ -0,0 +1,20 @@ +post_install() { + cat << EOF +=> Prior to running 'CUDA'-containers, ensure that the nvidia-docker-plugin + is loaded. -> https://github.com/NVIDIA/nvidia-docker#other-distributions + +*) manually; sudo -b nohup nvidia-docker-plugin > /tmp/nvidia-docker.log + +*) automatically at startup; systemctl enable nvidia-docker.service +EOF +} + +post_upgrade() { + post_install +} + +post_remove() { + cat << EOF +=> Don't forget to disable/stop a potentially running nvidia-docker.service +EOF +} |