Accepting request 428677 from Virtualization:containers

1

OBS-URL: https://build.opensuse.org/request/show/428677
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/containerd?expand=0&rev=6
This commit is contained in:
Dominique Leuenberger 2016-09-21 16:49:24 +00:00 committed by Git OBS Bridge
commit 6f4425e447
10 changed files with 97 additions and 3723 deletions

View File

@ -3,8 +3,8 @@
<param name="url">https://github.com/docker/containerd.git</param>
<param name="scm">git</param>
<param name="filename">containerd</param>
<param name="versionformat">0.2.2</param>
<param name="revision">v0.2.2</param>
<param name="versionformat">0.2.3</param>
<param name="revision">v0.2.3</param>
<param name="exclude">.git</param>
</service>
<service name="recompress" mode="disabled">

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:75730533b14022abf5f90daba44c8790848a1ad066b611f7bc6764f7929c9a3e
size 464324

3
containerd-0.2.3.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0132d7340455052f404650d20a22644b3e2dc545447c212c10be51d1033c8699
size 477748

View File

@ -1,3 +1,46 @@
-------------------------------------------------------------------
Mon Sep 19 11:58:44 UTC 2016 - jmassaguerpla@suse.com
- fix go_arches definition: use global instead of define, otherwise
it fails to build
-------------------------------------------------------------------
Thu Aug 25 15:54:38 UTC 2016 - jmassaguerpla@suse.com
- Remove GOPATH at the end of the GOPATH assignment
cause GOPATH is empty and if we do that, we get the path ""
appended, which causes gcc6-go to complain
-------------------------------------------------------------------
Wed Aug 24 12:25:46 UTC 2016 - jmassaguerpla@suse.com
- add go_arches in project configuration: this way, we can use the
same spec file but decide in the project configuration if to
use gc-go or gcc-go for some archs.
-------------------------------------------------------------------
Mon Aug 22 18:14:40 UTC 2016 - jmassaguerpla@suse.com
- update to v2.3.0 (bsc#995058)
- Remove patches which were already merged upstream:
* socket-activation-01-vendor.patch
* socket-activation-02-daemon.patch
* socket-activation-03-ctr.patch
-------------------------------------------------------------------
Thu Aug 18 10:34:29 UTC 2016 - jmassaguerpla@suse.com
- use gcc6-go instead of gcc5-go (bsc#988408)
- build ppc64le with gc-go because this version builds with gc-go 1.6
-------------------------------------------------------------------
Thu Aug 18 10:33:29 UTC 2016 - cbrauner@suse.com
- bump git commit id to the one required by docker v1.12.0
- run test during build
- only run tests on architectures that provide the go list and got test tools
- add aarch64 to go arches
-------------------------------------------------------------------
Thu Aug 18 09:44:56 UTC 2016 - cbrauner@suse.de
@ -85,6 +128,18 @@ Thu Mar 31 03:42:39 UTC 2016 - asarai@suse.de
issues in the future.
* Update to containerd 0.1.0. This required quite a few fixes.
-------------------------------------------------------------------
Thu Mar 31 03:42:39 UTC 2016 - asarai@suse.de
* Update to containerd 0.1.0. This required quite a few fixes.
* Use socket activation with the containerd daemon. This requires a
not-yet-upstream patchset (https://github.com/docker/containerd/pull/178):
+ socket-activation-01-vendor.patch
+ socket-activation-02-daemon.patch
+ socket-activation-03-ctr.patch
* Remove MountFlags=slave since it's not relevant to containerd and might cause
issues in the future.
-------------------------------------------------------------------
Sun Mar 27 10:19:02 UTC 2016 - asarai@suse.de
@ -93,3 +148,9 @@ Sun Mar 27 10:19:02 UTC 2016 - asarai@suse.de
* Separately package the client from the server.
* Install to /usr/sbin.
-------------------------------------------------------------------
Sun Mar 27 10:19:02 UTC 2016 - asarai@suse.de
* Add initial packaging of containerd 0.0.5.
* Install to /usr/sbin.
* Separately package the client from the server.

View File

@ -6,7 +6,7 @@ Requires=containerd.socket
[Service]
EnvironmentFile=/etc/sysconfig/containerd
ExecStart=/usr/sbin/containerd --listen fd:// --runtime /usr/sbin/runc $CONTAINERD_OPTS
ExecStart=/usr/sbin/containerd --listen fd:// $CONTAINERD_OPTS
LimitNOFILE=1048576
LimitNPROC=1048576
LimitCORE=infinity

View File

@ -4,7 +4,7 @@ PartOf=containerd.service
[Socket]
ListenStream=/run/containerd/containerd.sock
SocketMode=0600
SocketMode=0660
SocketUser=root
SocketGroup=root

View File

@ -16,20 +16,33 @@
#
%define go_arches %ix86 x86_64 aarch64
# Check if go_arches is defined in the project configuration
# Otherwise, define it here
# In order to define it in the project configuration, see
#
# https://en.opensuse.org/openSUSE:Build%20Service%20prjconf#Macros
#
# The Macros tag is the one that defines the go_arches variable to be used
# in the spec file.
# The "define" one is to help the specfile parser of the buildservice
# to see what packages are being built. You also want to define it here
# for keeping things consistent.
%{!?go_arches: %global go_arches %ix86 x86_64 aarch64 ppc64le}
%ifarch %go_arches
%define go_tool go
%define GO_BUILD_FLAGS %{nil}
%else
%define go_tool go-5
%define go_tool go-6
%define GO_BUILD_FLAGS "-gccgoflags=-Wl,--add-needed -Wl,--no-as-needed -static-libgo -ldl"
%endif
%define version_unconverted 0.2.2
%define git_version 973f21f
%define version_unconverted 0.2.3
Name: containerd
Version: 0.2.2
Version: 0.2.3
Release: 0
Summary: Standalone OCI Container Daemon
License: Apache-2.0
@ -39,15 +52,10 @@ Source: %{name}-%{version}.tar.xz
Source1: %{name}.service
Source2: %{name}.socket
Source3: sysconfig.%{name}
# Patches to implement systemd socket activation.
# https://github.com/docker/containerd/pull/178
Patch101: socket-activation-01-vendor.patch
Patch102: socket-activation-02-daemon.patch
Patch103: socket-activation-03-ctr.patch
%ifarch %go_arches
BuildRequires: go >= 1.5
%else
BuildRequires: gcc5-go >= 5.0
BuildRequires: gcc6-go >= 6.1
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# Currently runC is the only supported runtime for containerd. NOTE:
@ -55,7 +63,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build
# Dockerfile. However, for some reason the Dockerfile for containerd
# diverges from the one for Docker. As such, this cannot be a hard
# requirement (that would break Docker).
Requires: runc >= 0.1.0
Requires: runc = 0.1.1+gitcc29e3d
%define client ctr
%define daemon %{name}
@ -75,7 +83,7 @@ Requires: %{name} = %{version}
%ifarch %go_arches
BuildRequires: go >= 1.5
%else
BuildRequires: gcc5-go >= 5.0
BuildRequires: gcc6-go >= 6.1
%endif
%description ctr
@ -97,21 +105,17 @@ Test package for containerd. It contains the source code and the tests.
%prep
%setup -q
# Systemd socket activation patches.
%patch101 -p1
%patch102 -p1
%patch103 -p1
%build
# Do not use symlinks. If you want to run the unit tests for this package at
# some point during the build and you need to directly use go list directly it
# will get confused by symlinks.
export GOPATH=${HOME}/go:${HOME}/go/src/github.com/docker/containerd/vendor:${GOPATH}
export GOPATH=${HOME}/go:${HOME}/go/src/github.com/docker/containerd/vendor
mkdir -pv $HOME/go/src/github.com/docker/containerd
rm -rf $HOME/go/src/github.com/docker/containerd/*
cp -avr * $HOME/go/src/github.com/docker/containerd
# Build deamon.
# Build daemon.
%go_tool build %GO_BUILD_FLAGS -x -o %{daemon}-%{version} github.com/docker/%{name}/%{daemon}
# Build shim.
@ -120,6 +124,13 @@ cp -avr * $HOME/go/src/github.com/docker/containerd
# Build client.
%go_tool build %GO_BUILD_FLAGS -x -o %{client}-%{version} github.com/docker/%{name}/%{client}
%ifarch %go_arches
%check
export GOPATH=$HOME/go/src/github.com/docker/containerd/vendor:$GOPATH
cd $HOME/go/src/github.com/docker/containerd
go test -v $(go list ./... | grep github.com/docker/containerd | grep -v /integration-test)
%endif
%install
%{__install} -D -m755 %{daemon}-%{version} %{buildroot}/%{_sbindir}/%{daemon}
%{__install} -D -m755 %{shim}-%{version} %{buildroot}/%{_sbindir}/%{shim}

File diff suppressed because it is too large Load Diff

View File

@ -1,101 +0,0 @@
From f88d7012333fea526fe09133761023c790187598 Mon Sep 17 00:00:00 2001
From: Aleksa Sarai <asarai@suse.de>
Date: Thu, 31 Mar 2016 14:23:54 +1100
Subject: [PATCH 2/3] containerd: use docker/listeners to create the GRPC
socket
This allows for the use of socket activation with the flag `-l fd://`
and similar. The semantics are identical to Docker, but it's important
to note that the semantics of the --listen flag have changed to require
a proto://addr formatted string.
Signed-off-by: Aleksa Sarai <asarai@suse.de>
---
containerd/main.go | 26 ++++++++++++++++++--------
containerd/main_linux.go | 3 +--
2 files changed, 19 insertions(+), 10 deletions(-)
Index: containerd-0.2.2/containerd/main.go
===================================================================
--- containerd-0.2.2.orig/containerd/main.go
+++ containerd-0.2.2/containerd/main.go
@@ -2,9 +2,9 @@ package main
import (
"fmt"
- "net"
"os"
"os/signal"
+ "strings"
"sync"
"syscall"
"time"
@@ -18,6 +18,7 @@ import (
"github.com/docker/containerd/api/grpc/types"
"github.com/docker/containerd/osutils"
"github.com/docker/containerd/supervisor"
+ "github.com/docker/docker/pkg/listeners"
)
const (
@@ -43,7 +44,7 @@ var daemonFlags = []cli.Flag{
cli.StringFlag{
Name: "listen,l",
Value: defaultGRPCEndpoint,
- Usage: "Address on which GRPC API will listen",
+ Usage: "proto://address on which the GRPC API will listen",
},
cli.StringFlag{
Name: "runtime,r",
@@ -120,7 +121,13 @@ func daemon(context *cli.Context) error
if err := sv.Start(); err != nil {
return err
}
- server, err := startServer(context.String("listen"), sv)
+ // Split the listen string of the form proto://addr
+ listenSpec := context.String("listen")
+ listenParts := strings.SplitN(listenSpec, "://", 2)
+ if len(listenParts) != 2 {
+ return fmt.Errorf("bad listen address format %s, expected proto://address", listenSpec)
+ }
+ server, err := startServer(listenParts[0], listenParts[1], sv)
if err != nil {
return err
}
@@ -139,14 +146,17 @@ func daemon(context *cli.Context) error
return nil
}
-func startServer(address string, sv *supervisor.Supervisor) (*grpc.Server, error) {
- if err := os.RemoveAll(address); err != nil {
- return nil, err
- }
- l, err := net.Listen(defaultListenType, address)
+func startServer(protocol, address string, sv *supervisor.Supervisor) (*grpc.Server, error) {
+ // TODO: We should use TLS.
+ // TODO: Add an option for the SocketGroup.
+ sockets, err := listeners.Init(protocol, address, "", nil)
if err != nil {
return nil, err
}
+ if len(sockets) != 1 {
+ return nil, fmt.Errorf("incorrect number of listeners")
+ }
+ l := sockets[0]
s := grpc.NewServer()
types.RegisterAPIServer(s, server.NewServer(sv))
go func() {
Index: containerd-0.2.2/containerd/main_linux.go
===================================================================
--- containerd-0.2.2.orig/containerd/main_linux.go
+++ containerd-0.2.2/containerd/main_linux.go
@@ -20,8 +20,7 @@ import (
const (
defaultStateDir = "/run/containerd"
- defaultListenType = "unix"
- defaultGRPCEndpoint = "/run/containerd/containerd.sock"
+ defaultGRPCEndpoint = "unix:///run/containerd/containerd.sock"
)
func appendPlatformFlags() {

View File

@ -1,58 +0,0 @@
From 0ec0bb380fd395b57eb613eeca537899ef9e49e2 Mon Sep 17 00:00:00 2001
From: Aleksa Sarai <asarai@suse.de>
Date: Fri, 1 Apr 2016 22:09:02 +1100
Subject: [PATCH 3/3] ctr: support proto://address format for --address
In order to match the containerd --listen update, allow users to set any
address of the form proto://address.
Signed-off-by: Aleksa Sarai <asarai@suse.de>
---
ctr/container.go | 11 +++++++++--
ctr/main.go | 4 ++--
2 files changed, 11 insertions(+), 4 deletions(-)
Index: containerd-0.2.2/ctr/container.go
===================================================================
--- containerd-0.2.2.orig/ctr/container.go
+++ containerd-0.2.2/ctr/container.go
@@ -26,15 +26,22 @@ import (
// TODO: parse flags and pass opts
func getClient(ctx *cli.Context) types.APIClient {
+ // Parse proto://address form addresses.
+ bindSpec := ctx.GlobalString("address")
+ bindParts := strings.SplitN(bindSpec, "://", 2)
+ if len(bindParts) != 2 {
+ fatal(fmt.Sprintf("bad bind address format %s, expected proto://address", bindSpec), 1)
+ }
+
// reset the logger for grpc to log to dev/null so that it does not mess with our stdio
grpclog.SetLogger(log.New(ioutil.Discard, "", log.LstdFlags))
dialOpts := []grpc.DialOption{grpc.WithInsecure(), grpc.WithTimeout(ctx.GlobalDuration("conn-timeout"))}
dialOpts = append(dialOpts,
grpc.WithDialer(func(addr string, timeout time.Duration) (net.Conn, error) {
- return net.DialTimeout("unix", addr, timeout)
+ return net.DialTimeout(bindParts[0], bindParts[1], timeout)
},
))
- conn, err := grpc.Dial(ctx.GlobalString("address"), dialOpts...)
+ conn, err := grpc.Dial(bindSpec, dialOpts...)
if err != nil {
fatal(err.Error(), 1)
}
Index: containerd-0.2.2/ctr/main.go
===================================================================
--- containerd-0.2.2.orig/ctr/main.go
+++ containerd-0.2.2/ctr/main.go
@@ -41,8 +41,8 @@ func main() {
},
cli.StringFlag{
Name: "address",
- Value: "/run/containerd/containerd.sock",
- Usage: "address of GRPC API",
+ Value: "unix:///run/containerd/containerd.sock",
+ Usage: "proto://address of GRPC API",
},
cli.DurationFlag{
Name: "conn-timeout",