summaryrefslogtreecommitdiffstats
path: root/recipes-containers/cri-o/cri-o_git.bb
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@windriver.com>2017-09-29 08:57:44 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2017-10-02 09:15:42 -0400
commit0ff8923f08ae9f7a0e8ec71e4d5a7edb1d027b43 (patch)
tree270fe64ca18412a27ca297a3a527c65426141a32 /recipes-containers/cri-o/cri-o_git.bb
parent6c3a6c31cc477dae7524f21b147783c0bd1c0a93 (diff)
downloadmeta-virtualization-0ff8923f08ae9f7a0e8ec71e4d5a7edb1d027b43.tar.gz
containers: cri-o: kubernetes runc backend
To prepare for native kubernetes support without docker on a target, we integrate the cri-o incubator project. cri-o is meant to provide an integration path between OCI conformant runtimes and the kubelet. Specifically, it implements the Kubelet Container Runtime Interface (CRI) using OCI conformant runtimes. The scope of cri-o is tied to the scope of the CRI. This initial introduction is build + packaging only. It is expected that configuration and deployment tweaks are done at the distro level. Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'recipes-containers/cri-o/cri-o_git.bb')
-rw-r--r--recipes-containers/cri-o/cri-o_git.bb130
1 files changed, 130 insertions, 0 deletions
diff --git a/recipes-containers/cri-o/cri-o_git.bb b/recipes-containers/cri-o/cri-o_git.bb
new file mode 100644
index 00000000..c14d54dc
--- /dev/null
+++ b/recipes-containers/cri-o/cri-o_git.bb
@@ -0,0 +1,130 @@
1HOMEPAGE = "https://github.com/kubernetes-incubator/cri-o"
2SUMMARY = "Open Container Initiative-based implementation of Kubernetes Container Runtime Interface"
3DESCRIPTION = "cri-o is meant to provide an integration path between OCI conformant \
4runtimes and the kubelet. Specifically, it implements the Kubelet Container Runtime \
5Interface (CRI) using OCI conformant runtimes. The scope of cri-o is tied to the scope of the CRI. \
6. \
7At a high level, we expect the scope of cri-o to be restricted to the following functionalities: \
8. \
9 - Support multiple image formats including the existing Docker image format \
10 - Support for multiple means to download images including trust & image verification \
11 - Container image management (managing image layers, overlay filesystems, etc) \
12 - Container process lifecycle management \
13 - Monitoring and logging required to satisfy the CRI \
14 - Resource isolation as required by the CRI \
15 "
16
17SRCREV_cri-o = "65faae67828fb3eb3eac05b582aae9f9d1dea51c"
18SRC_URI = "\
19 git://github.com/kubernetes-incubator/cri-o.git;nobranch=1;name=cri-o \
20 file://0001-Makefile-force-symlinks.patch \
21 file://crio.conf \
22 "
23
24# Apache-2.0 for docker
25LICENSE = "Apache-2.0"
26LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
27
28GO_IMPORT = "import"
29
30PV = "1.0.0-rc3-dev+git${SRCREV_cri-o}"
31
32DEPENDS = " \
33 glib-2.0 \
34 btrfs-tools \
35 gpgme \
36 ostree \
37 libdevmapper \
38 "
39RDEPENDS_${PN} = " \
40 cni \
41 "
42
43PACKAGES =+ "${PN}-config"
44
45RDEPENDS_${PN} += " virtual/containerd virtual/runc"
46RDEPENDS_${PN} += " e2fsprogs-mke2fs"
47
48inherit systemd
49inherit go
50inherit goarch
51inherit pkgconfig
52
53EXTRA_OEMAKE="BUILDTAGS=''"
54
55do_compile() {
56 export GOARCH="${TARGET_GOARCH}"
57 export GOROOT="${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go"
58 export GOPATH="${S}/src/import:${S}/src/import/vendor"
59
60 # Pass the needed cflags/ldflags so that cgo
61 # can find the needed headers files and libraries
62 export CGO_ENABLED="1"
63 export CFLAGS=""
64 export LDFLAGS=""
65 export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
66 export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
67
68 # link fixups for compilation
69 rm -f ${S}/src/import/vendor/src
70 ln -sf ./ ${S}/src/import/vendor/src
71
72 mkdir -p ${S}/src/import/vendor/github.com/kubernetes-incubator/cri-o
73 ln -sf ../../../../cmd ${S}/src/import/vendor/github.com/kubernetes-incubator/cri-o/cmd
74 ln -sf ../../../../test ${S}/src/import/vendor/github.com/kubernetes-incubator/cri-o/test
75 ln -sf ../../../../oci ${S}/src/import/vendor/github.com/kubernetes-incubator/cri-o/oci
76 ln -sf ../../../../server ${S}/src/import/vendor/github.com/kubernetes-incubator/cri-o/server
77 ln -sf ../../../../pkg ${S}/src/import/vendor/github.com/kubernetes-incubator/cri-o/pkg
78 ln -sf ../../../../libpod ${S}/src/import/vendor/github.com/kubernetes-incubator/cri-o/libpod
79 ln -sf ../../../../libkpod ${S}/src/import/vendor/github.com/kubernetes-incubator/cri-o/libkpod
80 ln -sf ../../../../utils ${S}/src/import/vendor/github.com/kubernetes-incubator/cri-o/utils
81
82 export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go"
83 export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go"
84
85 # Pass the needed cflags/ldflags so that cgo
86 # can find the needed headers files and libraries
87 export CGO_ENABLED="1"
88 export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
89 export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
90
91 cd ${S}/src/import
92
93 oe_runmake binaries
94}
95
96SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}"
97SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','crio.service','',d)}"
98SYSTEMD_AUTO_ENABLE_${PN} = "enable"
99
100do_install() {
101 localbindir="/usr/local/bin"
102
103 install -d ${D}${localbindir}
104 install -d ${D}/${libexecdir}/crio
105 install -d ${D}/${sysconfdir}/crio
106 install -d ${D}${systemd_unitdir}/system/
107
108 install ${WORKDIR}/crio.conf ${D}/${sysconfdir}/crio/crio.conf
109
110 # sample config files, they'll go in the ${PN}-config below
111 install -d ${D}/${sysconfdir}/crio/config/
112 install -m 755 -D ${S}/src/import/test/testdata/* ${D}/${sysconfdir}/crio/config/
113
114 install ${S}/src/import/crio ${D}/${localbindir}
115 install ${S}/src/import/crioctl ${D}/${localbindir}
116 install ${S}/src/import/kpod ${D}/${localbindir}
117
118 install ${S}/src/import/conmon/conmon ${D}/${libexecdir}/crio
119 install ${S}/src/import/pause/pause ${D}/${libexecdir}/crio
120
121 install -m 0644 ${S}/src/import/contrib/systemd/crio.service ${D}${systemd_unitdir}/system/
122 install -m 0644 ${S}/src/import/contrib/systemd/crio-shutdown.service ${D}${systemd_unitdir}/system/
123}
124
125FILES_${PN}-config = "${sysconfdir}/crio/config/*"
126FILES_${PN} += "${systemd_unitdir}/system/*"
127FILES_${PN} += "/usr/local/bin/*"
128
129INHIBIT_PACKAGE_STRIP = "1"
130INSANE_SKIP_${PN} += "ldflags already-stripped"