提交 662d8b16 编写于 作者: F Felix Abecassis

Extract the hook into a standalone package

Tools like CRI-O or Red Hat's fork of Docker only need the OCI hook,
not the full runtime.

The hook is also likely to move at a different cadence than the full
runtime, which is tied to the upstream Docker releases.
上级 5bcece09
# Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved.
DOCKER ?= docker
VERSION := 1.1.1
PKG_REV := 1
DIST_DIR := $(CURDIR)/dist
.NOTPARALLEL:
.PHONY: all
all: xenial centos7 stretch
xenial: 17.12.0-xenial 17.09.1-xenial 17.09.0-xenial 17.06.2-xenial 17.03.2-xenial 1.13.1-xenial 1.12.6-xenial
centos7: 17.12.0-centos7 17.09.1-centos7 17.09.0-centos7 17.06.2-centos7 17.03.2-centos7 1.13.1-centos7 1.12.6-centos7
stretch: 17.12.0-stretch 17.09.1-stretch 17.09.0-stretch 17.06.2-stretch 17.03.2-stretch
17.12.0-xenial:
$(DOCKER) build --build-arg RUNC_COMMIT="b2567b37d7b75eb4cf325b77297b140ea686ce8f" \
--build-arg PKG_VERS="$(VERSION)+docker17.12.0" \
--build-arg PKG_REV="$(PKG_REV)" \
-t nvidia-container-runtime:$@ -f Dockerfile.xenial .
$(DOCKER) run --rm -v $(DIST_DIR)/xenial:/dist:Z nvidia-container-runtime:$@
17.09.1-xenial:
$(DOCKER) build --build-arg RUNC_COMMIT="3f2f8b84a77f73d38244dd690525642a72156c64" \
--build-arg PKG_VERS="$(VERSION)+docker17.09.1" \
--build-arg PKG_REV="$(PKG_REV)" \
-t nvidia-container-runtime:$@ -f Dockerfile.xenial .
$(DOCKER) run --rm -v $(DIST_DIR)/xenial:/dist:Z nvidia-container-runtime:$@
17.09.0-xenial:
$(DOCKER) build --build-arg RUNC_COMMIT="3f2f8b84a77f73d38244dd690525642a72156c64" \
--build-arg PKG_VERS="$(VERSION)+docker17.09.0" \
--build-arg PKG_REV="$(PKG_REV)" \
-t nvidia-container-runtime:$@ -f Dockerfile.xenial .
$(DOCKER) run --rm -v $(DIST_DIR)/xenial:/dist:Z nvidia-container-runtime:$@
17.06.2-xenial:
$(DOCKER) build --build-arg RUNC_COMMIT="810190ceaa507aa2727d7ae6f4790c76ec150bd2" \
--build-arg PKG_VERS="$(VERSION)+docker17.06.2" \
--build-arg PKG_REV="$(PKG_REV)" \
-t nvidia-container-runtime:$@ -f Dockerfile.xenial .
$(DOCKER) run --rm -v $(DIST_DIR)/xenial:/dist:Z nvidia-container-runtime:$@
17.03.2-xenial:
$(DOCKER) build --build-arg RUNC_COMMIT="54296cf40ad8143b62dbcaa1d90e520a2136ddfe" \
--build-arg PKG_VERS="$(VERSION)+docker17.03.2" \
--build-arg PKG_REV="$(PKG_REV)" \
-t nvidia-container-runtime:$@ -f Dockerfile.xenial .
$(DOCKER) run --rm -v $(DIST_DIR)/xenial:/dist:Z nvidia-container-runtime:$@
1.13.1-xenial:
$(DOCKER) build --build-arg RUNC_COMMIT="9df8b306d01f59d3a8029be411de015b7304dd8f" \
--build-arg PKG_VERS="$(VERSION)+docker1.13.1" \
--build-arg PKG_REV="$(PKG_REV)" \
-t nvidia-container-runtime:$@ -f Dockerfile.xenial .
$(DOCKER) run --rm -v $(DIST_DIR)/xenial:/dist:Z nvidia-container-runtime:$@
1.12.6-xenial:
$(DOCKER) build --build-arg RUNC_COMMIT="50a19c6ff828c58e5dab13830bd3dacde268afe5" \
--build-arg PKG_VERS="$(VERSION)+docker1.12.6" \
--build-arg PKG_REV="$(PKG_REV)" \
-t nvidia-container-runtime:$@ -f Dockerfile.xenial .
$(DOCKER) run --rm -v $(DIST_DIR)/xenial:/dist:Z nvidia-container-runtime:$@
17.12.0-centos7:
$(DOCKER) build --build-arg RUNC_COMMIT="b2567b37d7b75eb4cf325b77297b140ea686ce8f" \
--build-arg PKG_VERS="$(VERSION)" \
--build-arg PKG_REV="$(PKG_REV).docker17.12.0" \
-t nvidia-container-runtime:$@ -f Dockerfile.centos7 .
$(DOCKER) run --rm -v $(DIST_DIR)/centos7:/dist:Z nvidia-container-runtime:$@
17.09.1-centos7:
$(DOCKER) build --build-arg RUNC_COMMIT="3f2f8b84a77f73d38244dd690525642a72156c64" \
--build-arg PKG_VERS="$(VERSION)" \
--build-arg PKG_REV="$(PKG_REV).docker17.09.1" \
-t nvidia-container-runtime:$@ -f Dockerfile.centos7 .
$(DOCKER) run --rm -v $(DIST_DIR)/centos7:/dist:Z nvidia-container-runtime:$@
17.09.0-centos7:
$(DOCKER) build --build-arg RUNC_COMMIT="3f2f8b84a77f73d38244dd690525642a72156c64" \
--build-arg PKG_VERS="$(VERSION)" \
--build-arg PKG_REV="$(PKG_REV).docker17.09.0" \
-t nvidia-container-runtime:$@ -f Dockerfile.centos7 .
$(DOCKER) run --rm -v $(DIST_DIR)/centos7:/dist:Z nvidia-container-runtime:$@
17.06.2-centos7:
$(DOCKER) build --build-arg RUNC_COMMIT="810190ceaa507aa2727d7ae6f4790c76ec150bd2" \
--build-arg PKG_VERS="$(VERSION)" \
--build-arg PKG_REV="$(PKG_REV).docker17.06.2" \
-t nvidia-container-runtime:$@ -f Dockerfile.centos7 .
$(DOCKER) run --rm -v $(DIST_DIR)/centos7:/dist:Z nvidia-container-runtime:$@
# Build all packages for a specific distribution.
xenial: runtime-xenial hook-xenial
17.03.2-centos7:
$(DOCKER) build --build-arg RUNC_COMMIT="54296cf40ad8143b62dbcaa1d90e520a2136ddfe" \
--build-arg PKG_VERS="$(VERSION)" \
--build-arg PKG_REV="$(PKG_REV).docker17.03.2" \
-t nvidia-container-runtime:$@ -f Dockerfile.centos7 .
$(DOCKER) run --rm -v $(DIST_DIR)/centos7:/dist:Z nvidia-container-runtime:$@
centos7: runtime-centos7 hook-centos7
1.13.1-centos7:
$(DOCKER) build --build-arg RUNC_COMMIT="9df8b306d01f59d3a8029be411de015b7304dd8f" \
--build-arg PKG_VERS="$(VERSION)" \
--build-arg PKG_REV="$(PKG_REV).docker1.13.1" \
-t nvidia-container-runtime:$@ -f Dockerfile.centos7 .
$(DOCKER) run --rm -v $(DIST_DIR)/centos7:/dist:Z nvidia-container-runtime:$@
stretch: runtime-stretch hook-stretch
1.12.6-centos7:
$(DOCKER) build --build-arg RUNC_COMMIT="50a19c6ff828c58e5dab13830bd3dacde268afe5" \
--build-arg PKG_VERS="$(VERSION)" \
--build-arg PKG_REV="$(PKG_REV).docker1.12.6" \
-t nvidia-container-runtime:$@ -f Dockerfile.centos7 .
$(DOCKER) run --rm -v $(DIST_DIR)/centos7:/dist:Z nvidia-container-runtime:$@
base-%: $(CURDIR)/base/Dockerfile.%
make -C $(CURDIR)/base $*
17.12.0-stretch:
$(DOCKER) build --build-arg RUNC_COMMIT="b2567b37d7b75eb4cf325b77297b140ea686ce8f" \
--build-arg PKG_VERS="$(VERSION)+docker17.12.0" \
--build-arg PKG_REV="$(PKG_REV)" \
-t nvidia-container-runtime:$@ -f Dockerfile.stretch .
$(DOCKER) run --rm -v $(DIST_DIR)/stretch:/dist:Z nvidia-container-runtime:$@
hook-%: base-% $(CURDIR)/hook/Dockerfile.%
make -C $(CURDIR)/hook $*
17.09.1-stretch:
$(DOCKER) build --build-arg RUNC_COMMIT="3f2f8b84a77f73d38244dd690525642a72156c64" \
--build-arg PKG_VERS="$(VERSION)+docker17.09.1" \
--build-arg PKG_REV="$(PKG_REV)" \
-t nvidia-container-runtime:$@ -f Dockerfile.stretch .
$(DOCKER) run --rm -v $(DIST_DIR)/stretch:/dist:Z nvidia-container-runtime:$@
runtime-%: base-% $(CURDIR)/runtime/Dockerfile.%
make -C $(CURDIR)/runtime $*
17.09.0-stretch:
$(DOCKER) build --build-arg RUNC_COMMIT="3f2f8b84a77f73d38244dd690525642a72156c64" \
--build-arg PKG_VERS="$(VERSION)+docker17.09.0" \
--build-arg PKG_REV="$(PKG_REV)" \
-t nvidia-container-runtime:$@ -f Dockerfile.stretch .
$(DOCKER) run --rm -v $(DIST_DIR)/stretch:/dist:Z nvidia-container-runtime:$@
# Build nvidia-container-runtime for specific versions of docker.
%-runtime-xenial: base-xenial
make -C $(CURDIR)/runtime $*-xenial
17.06.2-stretch:
$(DOCKER) build --build-arg RUNC_COMMIT="810190ceaa507aa2727d7ae6f4790c76ec150bd2" \
--build-arg PKG_VERS="$(VERSION)+docker17.06.2" \
--build-arg PKG_REV="$(PKG_REV)" \
-t nvidia-container-runtime:$@ -f Dockerfile.stretch .
$(DOCKER) run --rm -v $(DIST_DIR)/stretch:/dist:Z nvidia-container-runtime:$@
%-runtime-stretch: base-stretch
make -C $(CURDIR)/runtime $*-stretch
17.03.2-stretch:
$(DOCKER) build --build-arg RUNC_COMMIT="54296cf40ad8143b62dbcaa1d90e520a2136ddfe" \
--build-arg PKG_VERS="$(VERSION)+docker17.03.2" \
--build-arg PKG_REV="$(PKG_REV)" \
-t nvidia-container-runtime:$@ -f Dockerfile.stretch .
$(DOCKER) run --rm -v $(DIST_DIR)/stretch:/dist:Z nvidia-container-runtime:$@
%-runtime-centos7: base-centos7
make -C $(CURDIR)/runtime $*-centos7
FROM centos:7
RUN yum install -y \
ca-certificates \
wget \
git \
rpm-build && \
rm -rf /var/cache/yum/*
ARG GOLANG_VERSION=0.0.0
RUN set -eux; \
\
arch="$(uname -m)"; \
case "${arch##*-}" in \
x86_64 | amd64) ARCH='amd64' ;; \
ppc64el | ppc64le) ARCH='ppc64le' ;; \
*) echo "unsupported architecture"; exit 1 ;; \
esac; \
wget -nv -O - https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linux-${ARCH}.tar.gz \
| tar -C /usr/local -xz
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
FROM debian:stretch
RUN apt-get update && apt-get install -y --no-install-recommends \
wget \
ca-certificates \
git \
build-essential \
dh-make \
fakeroot \
devscripts && \
rm -rf /var/lib/apt/lists/*
ARG GOLANG_VERSION=0.0.0
RUN set -eux; \
\
arch="$(uname -m)"; \
case "${arch##*-}" in \
x86_64 | amd64) ARCH='amd64' ;; \
ppc64el | ppc64le) ARCH='ppc64le' ;; \
*) echo "unsupported architecture" ; exit 1 ;; \
esac; \
wget -nv -O - https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linux-${ARCH}.tar.gz \
| tar -C /usr/local -xz
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
FROM ubuntu:xenial
RUN apt-get update && apt-get install -y --no-install-recommends \
wget \
ca-certificates \
git \
build-essential \
dh-make \
fakeroot \
devscripts && \
rm -rf /var/lib/apt/lists/*
ARG GOLANG_VERSION=0.0.0
RUN set -eux; \
\
arch="$(uname -m)"; \
case "${arch##*-}" in \
x86_64 | amd64) ARCH='amd64' ;; \
ppc64el | ppc64le) ARCH='ppc64le' ;; \
*) echo "unsupported architecture" ; exit 1 ;; \
esac; \
wget -nv -O - https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linux-${ARCH}.tar.gz \
| tar -C /usr/local -xz
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
# Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved.
DOCKER ?= docker
GOLANG_VERSION := 1.9.4
.NOTPARALLEL:
.PHONY: all
all: xenial centos7 stretch
%: $(CURDIR)/Dockerfile.%
$(DOCKER) build --build-arg GOLANG_VERSION="$(GOLANG_VERSION)" \
-t nvidia/build-base:$@ -f Dockerfile.$@ .
FROM nvidia/build-base:centos7
# packaging
ARG PKG_VERS
ARG PKG_REV
ENV VERSION $PKG_VERS
ENV RELEASE $PKG_REV
# output directory
ENV DIST_DIR=/tmp/nvidia-container-runtime-hook-$PKG_VERS/SOURCES
RUN mkdir -p $DIST_DIR
# nvidia-container-runtime-hook
COPY nvidia-container-runtime-hook/ $GOPATH/src/nvidia-container-runtime-hook
RUN go get -v nvidia-container-runtime-hook && \
mv $GOPATH/bin/nvidia-container-runtime-hook $DIST_DIR/nvidia-container-runtime-hook
COPY config.toml.centos7 $DIST_DIR/config.toml
WORKDIR $DIST_DIR/..
COPY rpm .
CMD arch=$(uname -m) && \
rpmbuild --clean --target=$arch -bb \
-D "_topdir $PWD" \
-D "version $VERSION" \
-D "release $RELEASE" \
SPECS/nvidia-container-runtime-hook.spec && \
mv RPMS/$arch/*.rpm /dist
FROM nvidia/build-base:stretch
# packaging
ARG PKG_VERS
ARG PKG_REV
ARG PKG_ARCH
ENV DEBFULLNAME "NVIDIA CORPORATION"
ENV DEBEMAIL "cudatools@nvidia.com"
ENV REVISION "$PKG_VERS-$PKG_REV"
ENV DISTRIB "UNRELEASED"
ENV SECTION ""
# output directory
ENV DIST_DIR=/tmp/nvidia-container-runtime-hook-$PKG_VERS
RUN mkdir -p $DIST_DIR
# nvidia-container-runtime-hook
COPY nvidia-container-runtime-hook/ $GOPATH/src/nvidia-container-runtime-hook
RUN go get -v nvidia-container-runtime-hook && \
mv $GOPATH/bin/nvidia-container-runtime-hook $DIST_DIR/nvidia-container-runtime-hook
COPY config.toml.stretch $DIST_DIR/config.toml
WORKDIR $DIST_DIR
COPY debian ./debian
RUN dch --create --package nvidia-container-runtime-hook -v "$REVISION" "v$REVISION" -D "$DISTRIB" && \
dch -r ""
CMD debuild -eSECTION --dpkg-buildpackage-hook='sh debian/prepare' -i -us -uc -b && \
mv /tmp/nvidia-container-runtime-hook_*.deb /dist
FROM nvidia/build-base:xenial
# packaging
ARG PKG_VERS
ARG PKG_REV
ARG PKG_ARCH
ENV DEBFULLNAME "NVIDIA CORPORATION"
ENV DEBEMAIL "cudatools@nvidia.com"
ENV REVISION "$PKG_VERS-$PKG_REV"
ENV DISTRIB "UNRELEASED"
ENV SECTION ""
# output directory
ENV DIST_DIR=/tmp/nvidia-container-runtime-hook-$PKG_VERS
RUN mkdir -p $DIST_DIR
# nvidia-container-runtime-hook
COPY nvidia-container-runtime-hook/ $GOPATH/src/nvidia-container-runtime-hook
RUN go get -v nvidia-container-runtime-hook && \
mv $GOPATH/bin/nvidia-container-runtime-hook $DIST_DIR/nvidia-container-runtime-hook
COPY config.toml.xenial $DIST_DIR/config.toml
WORKDIR $DIST_DIR
COPY debian ./debian
RUN dch --create --package nvidia-container-runtime-hook -v "$REVISION" "v$REVISION" -D "$DISTRIB" && \
dch -r ""
CMD debuild -eSECTION --dpkg-buildpackage-hook='sh debian/prepare' -i -us -uc -b && \
mv /tmp/*.deb /dist
# Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved.
DOCKER ?= docker
VERSION := 1.2.1
PKG_REV := 1
DIST_DIR := $(CURDIR)/../dist
.NOTPARALLEL:
.PHONY: all
all: xenial centos7 stretch
%: $(CURDIR)/Dockerfile.%
$(DOCKER) build --build-arg PKG_VERS="$(VERSION)" \
--build-arg PKG_REV="$(PKG_REV)" \
-t nvidia-container-runtime-hook:$@ -f Dockerfile.$@ .
$(DOCKER) run --rm -v $(DIST_DIR)/$@:/dist:Z nvidia-container-runtime-hook:$@
Source: nvidia-container-runtime-hook
Section: @SECTION@utils
Priority: optional
Maintainer: NVIDIA CORPORATION <cudatools@nvidia.com>
Standards-Version: 3.9.8
Homepage: https://github.com/NVIDIA/nvidia-container-runtime/wiki
Vcs-Git: https://github.com/NVIDIA/nvidia-container-runtime
Vcs-Browser: https://github.com/NVIDIA/nvidia-container-runtime
Build-Depends: debhelper (>= 9)
Package: nvidia-container-runtime-hook
Architecture: any
Depends: ${misc:Depends}, libnvidia-container-tools (>= 0.1.0), libnvidia-container-tools (<< 2.0.0)
Breaks: nvidia-container-runtime (<< 2.0.0)
Replaces: nvidia-container-runtime (<< 2.0.0)
Description: NVIDIA container runtime hook
Provides a OCI hook to enable GPU support in containers.
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: nvidia-container-runtime
Upstream-Name: nvidia-container-runtime-hook
Source: https://github.com/NVIDIA/nvidia-container-runtime
Files: *
Copyright: 2017-2018 NVIDIA CORPORATION <cudatools@nvidia.com>
License: BSD-3-Clause
Files: runc/*
Copyright: 2017-2018 NVIDIA CORPORATION <cudatools@nvidia.com>
License: Apache-2
Comment: https://github.com/opencontainers/runc/blob/master/NOTICE
License: Apache-2
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
.
http://www.apache.org/licenses/LICENSE-2.0
.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
.
On Debian systems, the complete text of the Apache License 2.0 can
be found in "/usr/share/common-licenses/Apache-2.0"
License: BSD-3-clause
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
......
config.toml /etc/nvidia-container-runtime
nvidia-* /usr/bin
\ No newline at end of file
nvidia-container-runtime-hook /usr/bin
\ No newline at end of file
new-package-should-close-itp-bug
binary-without-manpage
statically-linked-binary
description-is-pkg-name
Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of NVIDIA CORPORATION nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Name: nvidia-container-runtime-hook
Version: %{version}
Release: %{release}
Group: Development Tools
Vendor: NVIDIA CORPORATION
Packager: NVIDIA CORPORATION <cudatools@nvidia.com>
Summary: NVIDIA container runtime hook
URL: https://github.com/NVIDIA/nvidia-container-runtime
License: BSD
Source0: nvidia-container-runtime-hook
Source1: config.toml
Source2: LICENSE
Obsoletes: nvidia-container-runtime < 2.0.0
Requires: libnvidia-container-tools >= 0.1.0, libnvidia-container-tools < 2.0.0
%description
Provides a OCI hook to enable GPU support in containers.
%prep
cp %{SOURCE0} %{SOURCE1} %{SOURCE2} .
%install
mkdir -p %{buildroot}%{_bindir}
install -m 755 -t %{buildroot}%{_bindir} nvidia-container-runtime-hook
mkdir -p %{buildroot}/etc/nvidia-container-runtime
install -m 644 -t %{buildroot}/etc/nvidia-container-runtime config.toml
%files
%license LICENSE
%{_bindir}/nvidia-container-runtime-hook
/etc/nvidia-container-runtime/config.toml
%changelog
FROM centos:7
FROM nvidia/build-base:centos7
# Install a more version of git (for vndr)
RUN yum install -y \
......@@ -21,35 +21,19 @@ RUN GIT_DOWNLOAD_SUM=e19d450648d6d100eb93abaa5d06ffbc778394fb502354b7026d73e9bcb
# runc dependencies
RUN yum install -y \
ca-certificates \
wget \
pkgconfig \
gcc \
libseccomp-devel \
libselinux-devel && \
rm -rf /var/cache/yum/*
ENV GOLANG_VERSION 1.9.4
RUN set -eux; \
\
arch="$(uname -m)"; \
case "${arch##*-}" in \
x86_64 | amd64) ARCH='amd64' ;; \
ppc64el | ppc64le) ARCH='ppc64le' ;; \
*) echo "unsupported architecture"; exit 1 ;; \
esac; \
wget -nv -O - https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linux-${ARCH}.tar.gz \
| tar -C /usr/local -xz
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
RUN go get github.com/LK4D4/vndr
# packaging dependencies
RUN yum install -y \
rpm-build && \
rm -rf /var/cache/yum/*
# runc
WORKDIR $GOPATH/src/github.com/opencontainers/runc
RUN git clone https://github.com/docker/runc.git . && \
git fetch https://github.com/opencontainers/runc.git
# packaging
ARG PKG_VERS
......@@ -62,27 +46,15 @@ ENV RELEASE $PKG_REV
ENV DIST_DIR=/tmp/nvidia-container-runtime-$PKG_VERS/SOURCES
RUN mkdir -p $DIST_DIR
# runc
WORKDIR $GOPATH/src/github.com/opencontainers/runc
ARG RUNC_COMMIT
COPY runc/$RUNC_COMMIT/ /tmp/patches/runc
RUN git clone https://github.com/docker/runc.git . && \
git fetch https://github.com/opencontainers/runc.git && \
git checkout $RUNC_COMMIT && \
RUN git checkout $RUNC_COMMIT && \
git apply /tmp/patches/runc/* && \
if [ -f vendor.conf ]; then vndr; fi && \
make BUILDTAGS="seccomp selinux" && \
mv runc $DIST_DIR/nvidia-container-runtime
# nvidia-container-runtime-hook
COPY nvidia-container-runtime-hook/ $GOPATH/src/nvidia-container-runtime-hook
RUN go get -v nvidia-container-runtime-hook && \
mv $GOPATH/bin/nvidia-container-runtime-hook $DIST_DIR/nvidia-container-runtime-hook
COPY config.toml.centos7 $DIST_DIR/config.toml
WORKDIR $DIST_DIR/..
COPY rpm .
......
FROM debian:stretch
FROM nvidia/build-base:stretch
# runc dependencies
RUN apt-get update && apt-get install -y \
wget \
git \
make \
pkg-config \
gcc \
libseccomp-dev \
libapparmor-dev \
libselinux1-dev && \
rm -rf /var/lib/apt/lists/*
ENV GOLANG_VERSION 1.9.4
RUN set -eux; \
\
arch="$(uname -m)"; \
case "${arch##*-}" in \
x86_64 | amd64) ARCH='amd64' ;; \
ppc64el | ppc64le) ARCH='ppc64le' ;; \
*) echo "unsupported architecture" ; exit 1 ;; \
esac; \
wget -nv -O - https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linux-${ARCH}.tar.gz \
| tar -C /usr/local -xz
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
RUN go get github.com/LK4D4/vndr
# packaging dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
dh-make \
fakeroot \
devscripts && \
rm -rf /var/lib/apt/lists/*
# runc
WORKDIR $GOPATH/src/github.com/opencontainers/runc
RUN git clone https://github.com/docker/runc.git . && \
git fetch https://github.com/opencontainers/runc.git
# packaging
ARG PKG_VERS
......@@ -52,27 +31,15 @@ ENV SECTION ""
ENV DIST_DIR=/tmp/nvidia-container-runtime-$PKG_VERS
RUN mkdir -p $DIST_DIR
# runc
WORKDIR $GOPATH/src/github.com/opencontainers/runc
ARG RUNC_COMMIT
COPY runc/$RUNC_COMMIT/ /tmp/patches/runc
RUN git clone https://github.com/docker/runc.git . && \
git fetch https://github.com/opencontainers/runc.git && \
git checkout $RUNC_COMMIT && \
RUN git checkout $RUNC_COMMIT && \
git apply /tmp/patches/runc/* && \
if [ -f vendor.conf ]; then vndr; fi && \
make BUILDTAGS="seccomp apparmor selinux" && \
mv runc $DIST_DIR/nvidia-container-runtime
# nvidia-container-runtime-hook
COPY nvidia-container-runtime-hook/ $GOPATH/src/nvidia-container-runtime-hook
RUN go get -v nvidia-container-runtime-hook && \
mv $GOPATH/bin/nvidia-container-runtime-hook $DIST_DIR/nvidia-container-runtime-hook
COPY config.toml.stretch $DIST_DIR/config.toml
WORKDIR $DIST_DIR
COPY debian ./debian
......
FROM ubuntu:xenial
FROM nvidia/build-base:xenial
# runc dependencies
RUN apt-get update && apt-get install -y \
wget \
git \
make \
pkg-config \
gcc \
libseccomp-dev \
libapparmor-dev \
libselinux1-dev && \
rm -rf /var/lib/apt/lists/*
ENV GOLANG_VERSION 1.9.4
RUN set -eux; \
\
arch="$(uname -m)"; \
case "${arch##*-}" in \
x86_64 | amd64) ARCH='amd64' ;; \
ppc64el | ppc64le) ARCH='ppc64le' ;; \
*) echo "unsupported architecture" ; exit 1 ;; \
esac; \
wget -nv -O - https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linux-${ARCH}.tar.gz \
| tar -C /usr/local -xz
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
RUN go get github.com/LK4D4/vndr
# packaging dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
dh-make \
fakeroot \
devscripts && \
rm -rf /var/lib/apt/lists/*
# runc
WORKDIR $GOPATH/src/github.com/opencontainers/runc
RUN git clone https://github.com/docker/runc.git . && \
git fetch https://github.com/opencontainers/runc.git
# packaging
ARG PKG_VERS
......@@ -51,27 +31,15 @@ ENV SECTION ""
ENV DIST_DIR=/tmp/nvidia-container-runtime-$PKG_VERS
RUN mkdir -p $DIST_DIR
# runc
WORKDIR $GOPATH/src/github.com/opencontainers/runc
ARG RUNC_COMMIT
COPY runc/$RUNC_COMMIT/ /tmp/patches/runc
RUN git clone https://github.com/docker/runc.git . && \
git fetch https://github.com/opencontainers/runc.git && \
git checkout $RUNC_COMMIT && \
RUN git checkout $RUNC_COMMIT && \
git apply /tmp/patches/runc/* && \
if [ -f vendor.conf ]; then vndr; fi && \
make BUILDTAGS="seccomp apparmor selinux" && \
mv runc $DIST_DIR/nvidia-container-runtime
# nvidia-container-runtime-hook
COPY nvidia-container-runtime-hook/ $GOPATH/src/nvidia-container-runtime-hook
RUN go get -v nvidia-container-runtime-hook && \
mv $GOPATH/bin/nvidia-container-runtime-hook $DIST_DIR/nvidia-container-runtime-hook
COPY config.toml.xenial $DIST_DIR/config.toml
WORKDIR $DIST_DIR
COPY debian ./debian
......
# Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved.
DOCKER ?= docker
VERSION := 2.0.0
PKG_REV := 1
DIST_DIR := $(CURDIR)/../dist
.NOTPARALLEL:
.PHONY: all
all: xenial centos7 stretch
xenial: 17.12.0-xenial 17.09.1-xenial 17.09.0-xenial 17.06.2-xenial 17.03.2-xenial 1.13.1-xenial 1.12.6-xenial
centos7: 17.12.0-centos7 17.09.1-centos7 17.09.0-centos7 17.06.2-centos7 17.03.2-centos7 1.13.1-centos7 1.12.6-centos7
stretch: 17.12.0-stretch 17.09.1-stretch 17.09.0-stretch 17.06.2-stretch 17.03.2-stretch
17.12.0-xenial:
$(DOCKER) build --build-arg RUNC_COMMIT="b2567b37d7b75eb4cf325b77297b140ea686ce8f" \
--build-arg PKG_VERS="$(VERSION)+docker17.12.0" \
--build-arg PKG_REV="$(PKG_REV)" \
-t nvidia-container-runtime:$@ -f Dockerfile.xenial .
$(DOCKER) run --rm -v $(DIST_DIR)/xenial:/dist:Z nvidia-container-runtime:$@
17.09.1-xenial:
$(DOCKER) build --build-arg RUNC_COMMIT="3f2f8b84a77f73d38244dd690525642a72156c64" \
--build-arg PKG_VERS="$(VERSION)+docker17.09.1" \
--build-arg PKG_REV="$(PKG_REV)" \
-t nvidia-container-runtime:$@ -f Dockerfile.xenial .
$(DOCKER) run --rm -v $(DIST_DIR)/xenial:/dist:Z nvidia-container-runtime:$@
17.09.0-xenial:
$(DOCKER) build --build-arg RUNC_COMMIT="3f2f8b84a77f73d38244dd690525642a72156c64" \
--build-arg PKG_VERS="$(VERSION)+docker17.09.0" \
--build-arg PKG_REV="$(PKG_REV)" \
-t nvidia-container-runtime:$@ -f Dockerfile.xenial .
$(DOCKER) run --rm -v $(DIST_DIR)/xenial:/dist:Z nvidia-container-runtime:$@
17.06.2-xenial:
$(DOCKER) build --build-arg RUNC_COMMIT="810190ceaa507aa2727d7ae6f4790c76ec150bd2" \
--build-arg PKG_VERS="$(VERSION)+docker17.06.2" \
--build-arg PKG_REV="$(PKG_REV)" \
-t nvidia-container-runtime:$@ -f Dockerfile.xenial .
$(DOCKER) run --rm -v $(DIST_DIR)/xenial:/dist:Z nvidia-container-runtime:$@
17.03.2-xenial:
$(DOCKER) build --build-arg RUNC_COMMIT="54296cf40ad8143b62dbcaa1d90e520a2136ddfe" \
--build-arg PKG_VERS="$(VERSION)+docker17.03.2" \
--build-arg PKG_REV="$(PKG_REV)" \
-t nvidia-container-runtime:$@ -f Dockerfile.xenial .
$(DOCKER) run --rm -v $(DIST_DIR)/xenial:/dist:Z nvidia-container-runtime:$@
1.13.1-xenial:
$(DOCKER) build --build-arg RUNC_COMMIT="9df8b306d01f59d3a8029be411de015b7304dd8f" \
--build-arg PKG_VERS="$(VERSION)+docker1.13.1" \
--build-arg PKG_REV="$(PKG_REV)" \
-t nvidia-container-runtime:$@ -f Dockerfile.xenial .
$(DOCKER) run --rm -v $(DIST_DIR)/xenial:/dist:Z nvidia-container-runtime:$@
1.12.6-xenial:
$(DOCKER) build --build-arg RUNC_COMMIT="50a19c6ff828c58e5dab13830bd3dacde268afe5" \
--build-arg PKG_VERS="$(VERSION)+docker1.12.6" \
--build-arg PKG_REV="$(PKG_REV)" \
-t nvidia-container-runtime:$@ -f Dockerfile.xenial .
$(DOCKER) run --rm -v $(DIST_DIR)/xenial:/dist:Z nvidia-container-runtime:$@
17.12.0-centos7:
$(DOCKER) build --build-arg RUNC_COMMIT="b2567b37d7b75eb4cf325b77297b140ea686ce8f" \
--build-arg PKG_VERS="$(VERSION)" \
--build-arg PKG_REV="$(PKG_REV).docker17.12.0" \
-t nvidia-container-runtime:$@ -f Dockerfile.centos7 .
$(DOCKER) run --rm -v $(DIST_DIR)/centos7:/dist:Z nvidia-container-runtime:$@
17.09.1-centos7:
$(DOCKER) build --build-arg RUNC_COMMIT="3f2f8b84a77f73d38244dd690525642a72156c64" \
--build-arg PKG_VERS="$(VERSION)" \
--build-arg PKG_REV="$(PKG_REV).docker17.09.1" \
-t nvidia-container-runtime:$@ -f Dockerfile.centos7 .
$(DOCKER) run --rm -v $(DIST_DIR)/centos7:/dist:Z nvidia-container-runtime:$@
17.09.0-centos7:
$(DOCKER) build --build-arg RUNC_COMMIT="3f2f8b84a77f73d38244dd690525642a72156c64" \
--build-arg PKG_VERS="$(VERSION)" \
--build-arg PKG_REV="$(PKG_REV).docker17.09.0" \
-t nvidia-container-runtime:$@ -f Dockerfile.centos7 .
$(DOCKER) run --rm -v $(DIST_DIR)/centos7:/dist:Z nvidia-container-runtime:$@
17.06.2-centos7:
$(DOCKER) build --build-arg RUNC_COMMIT="810190ceaa507aa2727d7ae6f4790c76ec150bd2" \
--build-arg PKG_VERS="$(VERSION)" \
--build-arg PKG_REV="$(PKG_REV).docker17.06.2" \
-t nvidia-container-runtime:$@ -f Dockerfile.centos7 .
$(DOCKER) run --rm -v $(DIST_DIR)/centos7:/dist:Z nvidia-container-runtime:$@
17.03.2-centos7:
$(DOCKER) build --build-arg RUNC_COMMIT="54296cf40ad8143b62dbcaa1d90e520a2136ddfe" \
--build-arg PKG_VERS="$(VERSION)" \
--build-arg PKG_REV="$(PKG_REV).docker17.03.2" \
-t nvidia-container-runtime:$@ -f Dockerfile.centos7 .
$(DOCKER) run --rm -v $(DIST_DIR)/centos7:/dist:Z nvidia-container-runtime:$@
1.13.1-centos7:
$(DOCKER) build --build-arg RUNC_COMMIT="9df8b306d01f59d3a8029be411de015b7304dd8f" \
--build-arg PKG_VERS="$(VERSION)" \
--build-arg PKG_REV="$(PKG_REV).docker1.13.1" \
-t nvidia-container-runtime:$@ -f Dockerfile.centos7 .
$(DOCKER) run --rm -v $(DIST_DIR)/centos7:/dist:Z nvidia-container-runtime:$@
1.12.6-centos7:
$(DOCKER) build --build-arg RUNC_COMMIT="50a19c6ff828c58e5dab13830bd3dacde268afe5" \
--build-arg PKG_VERS="$(VERSION)" \
--build-arg PKG_REV="$(PKG_REV).docker1.12.6" \
-t nvidia-container-runtime:$@ -f Dockerfile.centos7 .
$(DOCKER) run --rm -v $(DIST_DIR)/centos7:/dist:Z nvidia-container-runtime:$@
17.12.0-stretch:
$(DOCKER) build --build-arg RUNC_COMMIT="b2567b37d7b75eb4cf325b77297b140ea686ce8f" \
--build-arg PKG_VERS="$(VERSION)+docker17.12.0" \
--build-arg PKG_REV="$(PKG_REV)" \
-t nvidia-container-runtime:$@ -f Dockerfile.stretch .
$(DOCKER) run --rm -v $(DIST_DIR)/stretch:/dist:Z nvidia-container-runtime:$@
17.09.1-stretch:
$(DOCKER) build --build-arg RUNC_COMMIT="3f2f8b84a77f73d38244dd690525642a72156c64" \
--build-arg PKG_VERS="$(VERSION)+docker17.09.1" \
--build-arg PKG_REV="$(PKG_REV)" \
-t nvidia-container-runtime:$@ -f Dockerfile.stretch .
$(DOCKER) run --rm -v $(DIST_DIR)/stretch:/dist:Z nvidia-container-runtime:$@
17.09.0-stretch:
$(DOCKER) build --build-arg RUNC_COMMIT="3f2f8b84a77f73d38244dd690525642a72156c64" \
--build-arg PKG_VERS="$(VERSION)+docker17.09.0" \
--build-arg PKG_REV="$(PKG_REV)" \
-t nvidia-container-runtime:$@ -f Dockerfile.stretch .
$(DOCKER) run --rm -v $(DIST_DIR)/stretch:/dist:Z nvidia-container-runtime:$@
17.06.2-stretch:
$(DOCKER) build --build-arg RUNC_COMMIT="810190ceaa507aa2727d7ae6f4790c76ec150bd2" \
--build-arg PKG_VERS="$(VERSION)+docker17.06.2" \
--build-arg PKG_REV="$(PKG_REV)" \
-t nvidia-container-runtime:$@ -f Dockerfile.stretch .
$(DOCKER) run --rm -v $(DIST_DIR)/stretch:/dist:Z nvidia-container-runtime:$@
17.03.2-stretch:
$(DOCKER) build --build-arg RUNC_COMMIT="54296cf40ad8143b62dbcaa1d90e520a2136ddfe" \
--build-arg PKG_VERS="$(VERSION)+docker17.03.2" \
--build-arg PKG_REV="$(PKG_REV)" \
-t nvidia-container-runtime:$@ -f Dockerfile.stretch .
$(DOCKER) run --rm -v $(DIST_DIR)/stretch:/dist:Z nvidia-container-runtime:$@
......@@ -10,7 +10,7 @@ Build-Depends: debhelper (>= 9)
Package: nvidia-container-runtime
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, libnvidia-container-tools (>= 0.1.0), libnvidia-container-tools (<< 2.0.0), libseccomp2
Depends: ${shlibs:Depends}, ${misc:Depends}, nvidia-container-runtime-hook (<< 2.0.0), libseccomp2
Description: NVIDIA container runtime
Provides a modified version of runc allowing users to run GPU enabled
containers.
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: nvidia-container-runtime
Source: https://github.com/NVIDIA/nvidia-container-runtime
Files: *
Copyright: 2017-2018 NVIDIA CORPORATION <cudatools@nvidia.com>
License: Apache-2
Comment: https://github.com/opencontainers/runc/blob/master/NOTICE
License: Apache-2
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
.
http://www.apache.org/licenses/LICENSE-2.0
.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
.
On Debian systems, the complete text of the Apache License 2.0 can
be found in "/usr/share/common-licenses/Apache-2.0"
nvidia-container-runtime /usr/bin
\ No newline at end of file
new-package-should-close-itp-bug
binary-without-manpage
description-is-pkg-name
#! /bin/sh
set -e
sed -i "s;@SECTION@;${SECTION:+$SECTION/};g" debian/control
#!/usr/bin/make -f
# -*- makefile -*-
#export DH_VERBOSE=1
%:
dh $@
Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of NVIDIA CORPORATION nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
For runc/*:
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
......
......@@ -8,16 +8,14 @@ Packager: NVIDIA CORPORATION <cudatools@nvidia.com>
Summary: NVIDIA container runtime
URL: https://github.com/NVIDIA/nvidia-container-runtime
# The entire source code is BSD except runc/* which is ASL 2.0
# runc NOTICE file: https://github.com/opencontainers/runc/blob/master/NOTICE
License: BSD and ASL 2.0
License: ASL 2.0
Source0: nvidia-container-runtime
Source1: nvidia-container-runtime-hook
Source2: config.toml
Source3: LICENSE
Source1: LICENSE
Requires: libnvidia-container-tools >= 0.1.0, libnvidia-container-tools < 2.0.0
Obsoletes: nvidia-container-runtime < 2.0.0
Requires: nvidia-container-runtime-hook < 2.0.0
Requires: libseccomp
%description
......@@ -25,19 +23,14 @@ Provides a modified version of runc allowing users to run GPU enabled
containers.
%prep
cp %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} .
cp %{SOURCE0} %{SOURCE1} .
%install
mkdir -p %{buildroot}%{_bindir}
install -m 755 -t %{buildroot}%{_bindir} nvidia-container-runtime
install -m 755 -t %{buildroot}%{_bindir} nvidia-container-runtime-hook
mkdir -p %{buildroot}/etc/nvidia-container-runtime
install -m 644 -t %{buildroot}/etc/nvidia-container-runtime config.toml
%files
%license LICENSE
%{_bindir}/nvidia-container-runtime-hook
%{_bindir}/nvidia-container-runtime
/etc/nvidia-container-runtime/config.toml
%changelog
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册