diff options
| author | Bruce Ashfield <bruce.ashfield@windriver.com> | 2017-09-29 08:57:44 -0400 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2017-10-02 09:15:42 -0400 |
| commit | 0ff8923f08ae9f7a0e8ec71e4d5a7edb1d027b43 (patch) | |
| tree | 270fe64ca18412a27ca297a3a527c65426141a32 /recipes-containers/cri-o/cri-o_git.bb | |
| parent | 6c3a6c31cc477dae7524f21b147783c0bd1c0a93 (diff) | |
| download | meta-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.bb | 130 |
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 @@ | |||
| 1 | HOMEPAGE = "https://github.com/kubernetes-incubator/cri-o" | ||
| 2 | SUMMARY = "Open Container Initiative-based implementation of Kubernetes Container Runtime Interface" | ||
| 3 | DESCRIPTION = "cri-o is meant to provide an integration path between OCI conformant \ | ||
| 4 | runtimes and the kubelet. Specifically, it implements the Kubelet Container Runtime \ | ||
| 5 | Interface (CRI) using OCI conformant runtimes. The scope of cri-o is tied to the scope of the CRI. \ | ||
| 6 | . \ | ||
| 7 | At 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 | |||
| 17 | SRCREV_cri-o = "65faae67828fb3eb3eac05b582aae9f9d1dea51c" | ||
| 18 | SRC_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 | ||
| 25 | LICENSE = "Apache-2.0" | ||
| 26 | LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" | ||
| 27 | |||
| 28 | GO_IMPORT = "import" | ||
| 29 | |||
| 30 | PV = "1.0.0-rc3-dev+git${SRCREV_cri-o}" | ||
| 31 | |||
| 32 | DEPENDS = " \ | ||
| 33 | glib-2.0 \ | ||
| 34 | btrfs-tools \ | ||
| 35 | gpgme \ | ||
| 36 | ostree \ | ||
| 37 | libdevmapper \ | ||
| 38 | " | ||
| 39 | RDEPENDS_${PN} = " \ | ||
| 40 | cni \ | ||
| 41 | " | ||
| 42 | |||
| 43 | PACKAGES =+ "${PN}-config" | ||
| 44 | |||
| 45 | RDEPENDS_${PN} += " virtual/containerd virtual/runc" | ||
| 46 | RDEPENDS_${PN} += " e2fsprogs-mke2fs" | ||
| 47 | |||
| 48 | inherit systemd | ||
| 49 | inherit go | ||
| 50 | inherit goarch | ||
| 51 | inherit pkgconfig | ||
| 52 | |||
| 53 | EXTRA_OEMAKE="BUILDTAGS=''" | ||
| 54 | |||
| 55 | do_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 | |||
| 96 | SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}" | ||
| 97 | SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','crio.service','',d)}" | ||
| 98 | SYSTEMD_AUTO_ENABLE_${PN} = "enable" | ||
| 99 | |||
| 100 | do_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 | |||
| 125 | FILES_${PN}-config = "${sysconfdir}/crio/config/*" | ||
| 126 | FILES_${PN} += "${systemd_unitdir}/system/*" | ||
| 127 | FILES_${PN} += "/usr/local/bin/*" | ||
| 128 | |||
| 129 | INHIBIT_PACKAGE_STRIP = "1" | ||
| 130 | INSANE_SKIP_${PN} += "ldflags already-stripped" | ||
