summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2021-02-05 23:05:48 -0500
committerBruce Ashfield <bruce.ashfield@gmail.com>2021-02-05 23:05:48 -0500
commite0cd8599f17280321d9aaf346fca0717bdde6ce6 (patch)
tree0bf2b7fe5ea4f40d4750faaf761ab5474a8ae0cf
parentcd6feb72b84aab9655af6c8c0774a180ea2a4f60 (diff)
downloadmeta-virtualization-e0cd8599f17280321d9aaf346fca0717bdde6ce6.tar.gz
containerd: remove container-docker and consolidate .inc files
There has been a warning in the containerd-docker recipe for quite some time, which indicates that it will be removed in the future. That time has come and we delete that recipe. It is no longer updated and everyone should be using the opencontainers variant. Now that we don't need the .inc, we delete it and consolidate in the single recipe. We also enable the systemd service by default, since docker is no longer in the picture and starting the daemon/service. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r--recipes-containers/containerd/containerd-docker_git.bb22
-rw-r--r--recipes-containers/containerd/containerd-opencontainers_git.bb106
-rw-r--r--recipes-containers/containerd/containerd.inc105
3 files changed, 104 insertions, 129 deletions
diff --git a/recipes-containers/containerd/containerd-docker_git.bb b/recipes-containers/containerd/containerd-docker_git.bb
deleted file mode 100644
index 8d1a27aa..00000000
--- a/recipes-containers/containerd/containerd-docker_git.bb
+++ /dev/null
@@ -1,22 +0,0 @@
1SRCREV = "3addd840653146c90a254301d6c3a663c7fd6429"
2SRC_URI = "\
3 git://github.com/docker/containerd.git;branch=v0.2.x;destsuffix=git/src/github.com/containerd/containerd \
4 "
5
6
7LIC_FILES_CHKSUM = "file://LICENSE.code;md5=aadc30f9c14d876ded7bedc0afd2d3d7"
8
9include containerd.inc
10
11CONTAINERD_VERSION = "v0.2.x"
12S = "${WORKDIR}/git/src/github.com/containerd/containerd"
13
14PROVIDES += "virtual/containerd"
15RPROVIDES_${PN} = "virtual/containerd"
16
17DEPENDS += "btrfs-tools"
18
19do_compile_prepend() {
20 bberror "${PN} is depreciated and will be removed in the future"
21 bbfatal "use container-opencontainers for a working configuration"
22}
diff --git a/recipes-containers/containerd/containerd-opencontainers_git.bb b/recipes-containers/containerd/containerd-opencontainers_git.bb
index 01e2cc78..e9f43ea9 100644
--- a/recipes-containers/containerd/containerd-opencontainers_git.bb
+++ b/recipes-containers/containerd/containerd-opencontainers_git.bb
@@ -1,11 +1,19 @@
1HOMEPAGE = "https://github.com/docker/containerd"
2SUMMARY = "containerd is a daemon to control runC"
3DESCRIPTION = "containerd is a daemon to control runC, built for performance and density. \
4 containerd leverages runC's advanced features such as seccomp and user namespace \
5 support as well as checkpoint and restore for cloning and live migration of containers."
6
7
1SRCREV = "33d90b72d1e44987118ac111d4f7a108d412099b" 8SRCREV = "33d90b72d1e44987118ac111d4f7a108d412099b"
2SRC_URI = "git://github.com/containerd/containerd;branch=release/1.4 \ 9SRC_URI = "git://github.com/containerd/containerd;branch=release/1.4 \
3 file://0001-build-use-oe-provided-GO-and-flags.patch \ 10 file://0001-build-use-oe-provided-GO-and-flags.patch \
4 file://0001-Add-build-option-GODEBUG-1.patch \ 11 file://0001-Add-build-option-GODEBUG-1.patch \
12 file://containerd.service \
5 " 13 "
6 14
7include containerd.inc 15# Apache-2.0 for containerd
8 16LICENSE = "Apache-2.0"
9LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=1269f40c0d099c21a871163984590d89" 17LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=1269f40c0d099c21a871163984590d89"
10 18
11CONTAINERD_VERSION = "v1.4.3" 19CONTAINERD_VERSION = "v1.4.3"
@@ -14,3 +22,97 @@ EXTRA_OEMAKE += "GODEBUG=1"
14 22
15PROVIDES += "virtual/containerd" 23PROVIDES += "virtual/containerd"
16RPROVIDES_${PN} = "virtual/containerd" 24RPROVIDES_${PN} = "virtual/containerd"
25
26
27S = "${WORKDIR}/git"
28
29PV = "${CONTAINERD_VERSION}+git${SRCPV}"
30
31inherit go
32inherit goarch
33
34GO_IMPORT = "import"
35
36CONTAINERD_PKG="github.com/containerd/containerd"
37
38INSANE_SKIP_${PN} += "ldflags"
39
40do_configure[noexec] = "1"
41
42do_compile() {
43 export GOARCH="${TARGET_GOARCH}"
44
45 # link fixups for compilation
46 rm -f ${S}/src/import/vendor/src
47 ln -sf ./ ${S}/src/import/vendor/src
48
49 mkdir -p ${S}/src/import/vendor/src/github.com/containerd/containerd/
50 mkdir -p ${S}/src/import/vendor/src/github.com/containerd/containerd/pkg/
51 mkdir -p ${S}/src/import/vendor/src/github.com/containerd/containerd/contrib/
52 # without this, the stress test parts of the build fail
53 cp ${S}/src/import/*.go ${S}/src/import/vendor/src/github.com/containerd/containerd
54
55 for c in content timeout ttrpcutil oom stdio process errdefs fs images mount snapshots linux api runtimes defaults progress \
56 protobuf reference diff platforms runtime remotes version archive dialer gc metadata \
57 metrics filters identifiers labels leases plugin server services \
58 cmd cio containers namespaces oci events log reaper sys rootfs nvidia seed apparmor seccomp; do
59 if [ -d ${S}/src/import/${c} ]; then
60 ln -sfn ${S}/src/import/${c} ${S}/src/import/vendor/github.com/containerd/containerd/${c}
61 fi
62 if [ -d ${S}/src/import/pkg/${c} ]; then
63 ln -sfn ${S}/src/import/pkg/${c} ${S}/src/import/vendor/github.com/containerd/containerd/pkg/${c}
64 fi
65 if [ -d ${S}/src/import/contrib/${c} ]; then
66 ln -sfn ${S}/src/import/contrib/${c} ${S}/src/import/vendor/github.com/containerd/containerd/contrib/${c}
67 fi
68 done
69
70 export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go"
71 export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go"
72
73 # Pass the needed cflags/ldflags so that cgo
74 # can find the needed headers files and libraries
75 export CGO_ENABLED="1"
76 export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
77 export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
78 export BUILDTAGS="no_btrfs static_build netgo"
79 export CFLAGS="${CFLAGS}"
80 export LDFLAGS="${LDFLAGS}"
81 export SHIM_CGO_ENABLED="${CGO_ENABLED}"
82
83 cd ${S}/src/import
84 oe_runmake binaries
85}
86
87inherit systemd
88SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}"
89SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','containerd.service','',d)}"
90
91do_install() {
92 mkdir -p ${D}/${bindir}
93
94 cp ${S}/src/import/bin/containerd ${D}/${bindir}/containerd
95 cp ${S}/src/import/bin/containerd-shim ${D}/${bindir}/containerd-shim
96 cp ${S}/src/import/bin/containerd-shim-runc-v1 ${D}/${bindir}/containerd-shim-runc-v1
97 cp ${S}/src/import/bin/containerd-shim-runc-v2 ${D}/${bindir}/containerd-shim-runc-v2
98 cp ${S}/src/import/bin/ctr ${D}/${bindir}/containerd-ctr
99
100 ln -sf containerd ${D}/${bindir}/docker-containerd
101 ln -sf containerd-shim ${D}/${bindir}/docker-containerd-shim
102 ln -sf containerd-ctr ${D}/${bindir}/docker-containerd-ctr
103
104 ln -sf containerd-ctr ${D}/${bindir}/ctr
105
106 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
107 install -d ${D}${systemd_unitdir}/system
108 install -m 644 ${WORKDIR}/containerd.service ${D}/${systemd_unitdir}/system
109 # adjust from /usr/local/bin to /usr/bin/
110 sed -e "s:/usr/local/bin/containerd:${bindir}/docker-containerd:g" -i ${D}/${systemd_unitdir}/system/containerd.service
111 fi
112}
113
114FILES_${PN} += "${systemd_system_unitdir}/*"
115
116INSANE_SKIP_${PN} += "ldflags already-stripped"
117
118COMPATIBLE_HOST = "^(?!(qemu)?mips).*"
diff --git a/recipes-containers/containerd/containerd.inc b/recipes-containers/containerd/containerd.inc
deleted file mode 100644
index 2a14a44b..00000000
--- a/recipes-containers/containerd/containerd.inc
+++ /dev/null
@@ -1,105 +0,0 @@
1HOMEPAGE = "https://github.com/docker/containerd"
2SUMMARY = "containerd is a daemon to control runC"
3DESCRIPTION = "containerd is a daemon to control runC, built for performance and density. \
4 containerd leverages runC's advanced features such as seccomp and user namespace \
5 support as well as checkpoint and restore for cloning and live migration of containers."
6
7# Apache-2.0 for containerd
8LICENSE = "Apache-2.0"
9LIC_FILES_CHKSUM ?= "file://src/import/LICENSE.code;md5=aadc30f9c14d876ded7bedc0afd2d3d7"
10
11SRC_URI += "file://containerd.service"
12
13S = "${WORKDIR}/git"
14
15PV = "${CONTAINERD_VERSION}+git${SRCPV}"
16
17inherit go
18inherit goarch
19
20GO_IMPORT = "import"
21
22CONTAINERD_PKG="github.com/containerd/containerd"
23
24INSANE_SKIP_${PN} += "ldflags"
25
26do_configure[noexec] = "1"
27
28do_compile() {
29 export GOARCH="${TARGET_GOARCH}"
30
31 # link fixups for compilation
32 rm -f ${S}/src/import/vendor/src
33 ln -sf ./ ${S}/src/import/vendor/src
34
35 mkdir -p ${S}/src/import/vendor/src/github.com/containerd/containerd/
36 mkdir -p ${S}/src/import/vendor/src/github.com/containerd/containerd/pkg/
37 mkdir -p ${S}/src/import/vendor/src/github.com/containerd/containerd/contrib/
38 # without this, the stress test parts of the build fail
39 cp ${S}/src/import/*.go ${S}/src/import/vendor/src/github.com/containerd/containerd
40
41 for c in content timeout ttrpcutil oom stdio process errdefs fs images mount snapshots linux api runtimes defaults progress \
42 protobuf reference diff platforms runtime remotes version archive dialer gc metadata \
43 metrics filters identifiers labels leases plugin server services \
44 cmd cio containers namespaces oci events log reaper sys rootfs nvidia seed apparmor seccomp; do
45 if [ -d ${S}/src/import/${c} ]; then
46 ln -sfn ${S}/src/import/${c} ${S}/src/import/vendor/github.com/containerd/containerd/${c}
47 fi
48 if [ -d ${S}/src/import/pkg/${c} ]; then
49 ln -sfn ${S}/src/import/pkg/${c} ${S}/src/import/vendor/github.com/containerd/containerd/pkg/${c}
50 fi
51 if [ -d ${S}/src/import/contrib/${c} ]; then
52 ln -sfn ${S}/src/import/contrib/${c} ${S}/src/import/vendor/github.com/containerd/containerd/contrib/${c}
53 fi
54 done
55
56 export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go"
57 export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go"
58
59 # Pass the needed cflags/ldflags so that cgo
60 # can find the needed headers files and libraries
61 export CGO_ENABLED="1"
62 export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
63 export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
64 export BUILDTAGS="no_btrfs static_build netgo"
65 export CFLAGS="${CFLAGS}"
66 export LDFLAGS="${LDFLAGS}"
67 export SHIM_CGO_ENABLED="${CGO_ENABLED}"
68
69 cd ${S}/src/import
70 oe_runmake binaries
71}
72
73# Note: disabled for now, since docker is launching containerd
74# inherit systemd
75# SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}"
76# SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','containerd.service','',d)}"
77
78do_install() {
79 mkdir -p ${D}/${bindir}
80
81 cp ${S}/src/import/bin/containerd ${D}/${bindir}/containerd
82 cp ${S}/src/import/bin/containerd-shim ${D}/${bindir}/containerd-shim
83 cp ${S}/src/import/bin/containerd-shim-runc-v1 ${D}/${bindir}/containerd-shim-runc-v1
84 cp ${S}/src/import/bin/containerd-shim-runc-v2 ${D}/${bindir}/containerd-shim-runc-v2
85 cp ${S}/src/import/bin/ctr ${D}/${bindir}/containerd-ctr
86
87 ln -sf containerd ${D}/${bindir}/docker-containerd
88 ln -sf containerd-shim ${D}/${bindir}/docker-containerd-shim
89 ln -sf containerd-ctr ${D}/${bindir}/docker-containerd-ctr
90
91 ln -sf containerd-ctr ${D}/${bindir}/ctr
92
93 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
94 install -d ${D}${systemd_unitdir}/system
95 install -m 644 ${WORKDIR}/containerd.service ${D}/${systemd_unitdir}/system
96 # adjust from /usr/local/bin to /usr/bin/
97 sed -e "s:/usr/local/bin/containerd:${bindir}/docker-containerd:g" -i ${D}/${systemd_unitdir}/system/containerd.service
98 fi
99}
100
101FILES_${PN} += "${systemd_system_unitdir}/*"
102
103INSANE_SKIP_${PN} += "ldflags already-stripped"
104
105COMPATIBLE_HOST = "^(?!(qemu)?mips).*"