cni: add 0.7.1 for cni and 0.7.5 for plugins
PATCH 1/4 cni: add 0.7.1 for cni and 0.7.5 for plugins
This version is proved to work well for simple k8s flannel setup.
--- recipes-networking/cni/cni_0.7.1.bb | 79 +++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 recipes-networking/cni/cni_0.7.1.bb
recipes-networking/cni/cni_0.7.1.bb new file +79 -0
@@ -0,0 +1,79 @@ +HOMEPAGE = "https://github.com/containernetworking/cni" +SUMMARY = "Container Network Interface - networking for Linux containers" +DESCRIPTION = "CNI (Container Network Interface), a Cloud Native Computing \ +Foundation project, consists of a specification and libraries for writing \ +plugins to configure network interfaces in Linux containers, along with a \ +number of supported plugins. CNI concerns itself only with network connectivity \ +of containers and removing allocated resources when the container is deleted. \ +Because of this focus, CNI has a wide range of support and the specification \ +is simple to implement. \ +" + +# 0.7.1 +SRCREV_cni = "4cfb7b568922a3c79a23e438dc52fe537fc9687e" +# 0.7.5 +SRCREV_plugins = "a62711a5da7a2dc2eb93eac47e103738ad923fd6" +SRC_URI = "\ + git://github.com/containernetworking/cni.git;branch=master;name=cni \ + git://github.com/containernetworking/plugins.git;branch=v0.7;destsuffix=plugins;name=plugins \ + " + +RPROVIDES_${PN} += "kubernetes-cni" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc" + +GO_IMPORT = "import" + +PV = "0.7.1" + +inherit go +inherit goarch + +do_compile() { + # link fixups for compilation + rm -f ${S}/src/import/vendor/src + mkdir -p ${S}/src/import/vendor/ + ln -sf ./ ${S}/src/import/vendor/src + rm -rf ${S}/src/import/plugins + rm -rf ${S}/src/import/vendor/github.com/containernetworking/plugins + + mkdir -p ${S}/src/import/vendor/github.com/containernetworking/cni + + ln -sf ../../../../libcni ${S}/src/import/vendor/github.com/containernetworking/cni/libcni + ln -sf ../../../../pkg ${S}/src/import/vendor/github.com/containernetworking/cni/pkg + ln -sf ../../../../cnitool ${S}/src/import/vendor/github.com/containernetworking/cni/cnitool + ln -sf ${WORKDIR}/plugins ${S}/src/import/vendor/github.com/containernetworking/plugins + + export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go" + export CGO_ENABLED="1" + + cd ${S}/src/import/vendor/github.com/containernetworking/cni/libcni + ${GO} build + + cd ${S}/src/import/vendor/github.com/containernetworking/cni/cnitool + ${GO} build + + cd ${S}/src/import/vendor/github.com/containernetworking/plugins/ + PLUGINS="$(ls -d plugins/meta/*; ls -d plugins/ipam/*; ls -d plugins/main/* | grep -v windows)" + mkdir -p ${WORKDIR}/plugins/bin/ + for p in $PLUGINS; do + plugin="$(basename "$p")" + echo "building: $p" + ${GO} build -o ${WORKDIR}/plugins/bin/$plugin github.com/containernetworking/plugins/$p + done +} + +do_install() { + localbindir="/opt/cni/bin" + + install -d ${D}${localbindir} + install -d ${D}/${sysconfdir}/cni/net.d + + install -m 755 ${S}/src/import/cnitool/cnitool ${D}/${localbindir} + install -m 755 -D ${WORKDIR}/plugins/bin/* ${D}/${localbindir} +} + +FILES_${PN} += "/opt/cni/bin/*" + +INSANE_SKIP_${PN} += "ldflags already-stripped"
Signature · 1 line
2.17.1
PATCH 2/4 cni: extract common settings to cni.inc
Extract common settings of two cni recipe into cni.inc.
Add comment in recipe file to explicitly state what the version is for. More sepcifically, the git version is used to track latest upstream, while the 0.7.1 version is used to ensure basic setup works for k8s.
--- recipes-networking/cni/cni.inc | 79 +++++++++++++++++++++++++++++ recipes-networking/cni/cni_0.7.1.bb | 71 +------------------------- recipes-networking/cni/cni_git.bb | 73 +------------------------- 3 files changed, 83 insertions(+), 140 deletions(-) create mode 100644 recipes-networking/cni/cni.inc
recipes-networking/cni/cni.inc new file +79 -0
@@ -0,0 +1,79 @@ +HOMEPAGE = "https://github.com/containernetworking/cni" +SUMMARY = "Container Network Interface - networking for Linux containers" +DESCRIPTION = "CNI (Container Network Interface), a Cloud Native Computing \ +Foundation project, consists of a specification and libraries for writing \ +plugins to configure network interfaces in Linux containers, along with a \ +number of supported plugins. CNI concerns itself only with network connectivity \ +of containers and removing allocated resources when the container is deleted. \ +Because of this focus, CNI has a wide range of support and the specification \ +is simple to implement. \ +" + +# 0.7.1 +SRCREV_cni = "4cfb7b568922a3c79a23e438dc52fe537fc9687e" +# 0.7.5 +SRCREV_plugins = "a62711a5da7a2dc2eb93eac47e103738ad923fd6" +SRC_URI = "\ + git://github.com/containernetworking/cni.git;branch=master;name=cni \ + git://github.com/containernetworking/plugins.git;branch=v0.7;destsuffix=plugins;name=plugins \ + " + +RPROVIDES_${PN} += "kubernetes-cni" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc" + +GO_IMPORT = "import" + +PV = "0.7.1" + +inherit go +inherit goarch + +do_compile() { + # link fixups for compilation + rm -f ${S}/src/import/vendor/src + mkdir -p ${S}/src/import/vendor/ + ln -sf ./ ${S}/src/import/vendor/src + rm -rf ${S}/src/import/plugins + rm -rf ${S}/src/import/vendor/github.com/containernetworking/plugins + + mkdir -p ${S}/src/import/vendor/github.com/containernetworking/cni + + ln -sf ../../../../libcni ${S}/src/import/vendor/github.com/containernetworking/cni/libcni + ln -sf ../../../../pkg ${S}/src/import/vendor/github.com/containernetworking/cni/pkg + ln -sf ../../../../cnitool ${S}/src/import/vendor/github.com/containernetworking/cni/cnitool + ln -sf ${WORKDIR}/plugins ${S}/src/import/vendor/github.com/containernetworking/plugins + + export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go" + export CGO_ENABLED="1" + + cd ${S}/src/import/vendor/github.com/containernetworking/cni/libcni + ${GO} build + + cd ${S}/src/import/vendor/github.com/containernetworking/cni/cnitool + ${GO} build + + cd ${S}/src/import/vendor/github.com/containernetworking/plugins/ + PLUGINS="$(ls -d plugins/meta/*; ls -d plugins/ipam/*; ls -d plugins/main/* | grep -v windows)" + mkdir -p ${WORKDIR}/plugins/bin/ + for p in $PLUGINS; do + plugin="$(basename "$p")" + echo "building: $p" + ${GO} build -o ${WORKDIR}/plugins/bin/$plugin github.com/containernetworking/plugins/$p + done +} + +do_install() { + localbindir="/opt/cni/bin" + + install -d ${D}${localbindir} + install -d ${D}/${sysconfdir}/cni/net.d + + install -m 755 ${S}/src/import/cnitool/cnitool ${D}/${localbindir} + install -m 755 -D ${WORKDIR}/plugins/bin/* ${D}/${localbindir} +} + +FILES_${PN} += "/opt/cni/bin/*" + +INSANE_SKIP_${PN} += "ldflags already-stripped"
recipes-networking/cni/cni_0.7.1.bb +2 -69
78 lines not on this page · raw message
recipes-networking/cni/cni_git.bb +2 -71
80 lines not on this page · raw message
Signature · 1 line
2.17.1
Re: [PATCH 2/4] cni: extract common settings to cni.inc
Quoted 5 lines · Chen Qi
Extract common settings of two cni recipe into cni.inc.
Add comment in recipe file to explicitly state what the version is for. More sepcifically, the git version is used to track latest upstream, while the 0.7.1 version is used to ensure basic setup works for k8s.
As I mentioned, we won't do this. It doubles the maintenance and shows a fundamental API / ABI incompatibility if we can't use the different versions against a released k8s.
There is one version of the recipe, and I've always had it working for the released kubernetes and master. I'm not seeing any issues with the latest and my k8s configs, so I'm not sure what you are running into that I'm not.
Bruce
Quoted 336 lines
Signed-off-by Chen Qi <[email protected]>--- recipes-networking/cni/cni.inc | 79 +++++++++++++++++++++++++++++ recipes-networking/cni/cni_0.7.1.bb | 71 +------------------------- recipes-networking/cni/cni_git.bb | 73 +------------------------- 3 files changed, 83 insertions(+), 140 deletions(-) create mode 100644 recipes-networking/cni/cni.increcipes-networking/cni/cni.inc new file +3
-0@@ -0,0 +1,79 @@ +HOMEPAGE = "https://github.com/containernetworking/cni" +SUMMARY = "Container Network Interface - networking for Linux containers" +DESCRIPTION = "CNI (Container Network Interface), a Cloud NativeComputing \
+Foundation project, consists of a specification and libraries for writing \
+plugins to configure network interfaces in Linux containers, along with a \
+number of supported plugins. CNI concerns itself only with network connectivity \
+of containers and removing allocated resources when the container is deleted. \
+Because of this focus, CNI has a wide range of support and the specification \recipes-networking/cni/cni.inc new file +9
-0+is simple to implement. \ +" + +# 0.7.1 +SRCREV_cni = "4cfb7b568922a3c79a23e438dc52fe537fc9687e" +# 0.7.5 +SRCREV_plugins = "a62711a5da7a2dc2eb93eac47e103738ad923fd6" +SRC_URI = "\ + git://github.com/containernetworking/cni.git;branch=master;name=cni \
+git://
github.com/containernetworking/plugins.git;branch=v0.7;destsuffix=plugins;name=plugins \recipes-networking/cni/cni.inc new file +6
-0+ " + +RPROVIDES_${PN} += "kubernetes-cni" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM ="file://src/import/LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc"
recipes-networking/cni/cni.inc new file +15
-0+ +GO_IMPORT = "import" + +PV = "0.7.1" + +inherit go +inherit goarch + +do_compile() { + # link fixups for compilation + rm -f ${S}/src/import/vendor/src + mkdir -p ${S}/src/import/vendor/ + ln -sf ./ ${S}/src/import/vendor/src + rm -rf ${S}/src/import/plugins + rm -rf ${S}/src/import/vendor/github.com/containernetworking/plugins
recipes-networking/cni/cni.inc new file +4
-0+ + mkdir -p ${S}/src/import/vendor/github.com/containernetworking/cni + + ln -sf ../../../../libcni ${S}/src/import/vendor/github.com/containernetworking/cni/libcni
+ ln -sf ../../../../pkg ${S}/src/import/vendor/
github.com/containernetworking/cni/pkg
+ ln -sf ../../../../cnitool ${S}/src/import/vendor/
github.com/containernetworking/cni/cnitool
+ ln -sf ${WORKDIR}/plugins ${S}/src/import/vendor/
github.com/containernetworking/pluginsrecipes-networking/cni/cni.inc new file +2
-0+ + exportGOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go"
recipes-networking/cni/cni.inc new file +3
-0+ export CGO_ENABLED="1" + + cd ${S}/src/import/vendor/github.com/containernetworking/cni/libcni
recipes-networking/cni/cni.inc new file +3
-0+ ${GO} build + + cd ${S}/src/import/vendor/github.com/containernetworking/cni/cnitool
recipes-networking/cni/cni.inc new file +4
-0+ ${GO} build + + cd ${S}/src/import/vendor/github.com/containernetworking/plugins/ + PLUGINS="$(ls -d plugins/meta/*; ls -d plugins/ipam/*; ls -dplugins/main/* | grep -v windows)"
recipes-networking/cni/cni.inc new file +5
-0+ mkdir -p ${WORKDIR}/plugins/bin/ + for p in $PLUGINS; do + plugin="$(basename "$p")" + echo "building: $p" + ${GO} build -o ${WORKDIR}/plugins/bin/$plugingithub.com/containernetworking/plugins/$p
recipes-networking/cni/cni.inc new file +16
-0+ done +} + +do_install() { + localbindir="/opt/cni/bin" + + install -d ${D}${localbindir} + install -d ${D}/${sysconfdir}/cni/net.d + + install -m 755 ${S}/src/import/cnitool/cnitool ${D}/${localbindir} + install -m 755 -D ${WORKDIR}/plugins/bin/* ${D}/${localbindir} +} + +FILES_${PN} += "/opt/cni/bin/*" + +INSANE_SKIP_${PN} += "ldflags already-stripped"recipes-networking/cni/ renamed from recipes-networking/cni/cni_0.7.1.bb +0
-0cni_0.7.1.bb
index 7a3b87f..7977040 100644recipes-networking/cni/cni_0.7.1.bb +0
-8@@ -1,13 +1,5 @@ -HOMEPAGE = "https://github.com/containernetworking/cni" -SUMMARY = "Container Network Interface - networking for Linux containers" -DESCRIPTION = "CNI (Container Network Interface), a Cloud Native Computing \ -Foundation project, consists of a specification and libraries for writing \ -plugins to configure network interfaces in Linux containers, along with a \ -number of supported plugins. CNI concerns itself only with network connectivity \ -of containers and removing allocated resources when the container is deleted. \ -Because of this focus, CNI has a wide range of support and thespecification \
recipes-networking/cni/cni_0.7.1.bb +1
-2-is simple to implement. \ -" +# This cni version is here to ensure that basic k8s setup with flannelcould work.
recipes-networking/cni/cni_0.7.1.bb +1
-0+require cni.inc # 0.7.1 SRCREV_cni = "4cfb7b568922a3c79a23e438dc52fe537fc9687e"@@ -17,63 +9,4 @@ SRC_URI = "\ git:// github.com/containernetworking/cni.git;branch=master;name=cni \ git://github.com/containernetworking/plugins.git;branch=v0.7;destsuffix=plugins;name=plugins
\ "recipes-networking/cni/cni_0.7.1.bb +0
-5- -RPROVIDES_${PN} += "kubernetes-cni" - -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM ="file://src/import/LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc"
recipes-networking/cni/cni_0.7.1.bb +0
-14- -GO_IMPORT = "import" - PV = "0.7.1" - -inherit go -inherit goarch - -do_compile() { - # link fixups for compilation - rm -f ${S}/src/import/vendor/src - mkdir -p ${S}/src/import/vendor/ - ln -sf ./ ${S}/src/import/vendor/src - rm -rf ${S}/src/import/plugins - rm -rf ${S}/src/import/vendor/github.com/containernetworking/plugins
recipes-networking/cni/cni_0.7.1.bb +0
-4- - mkdir -p ${S}/src/import/vendor/github.com/containernetworking/cni - - ln -sf ../../../../libcni ${S}/src/import/vendor/github.com/containernetworking/cni/libcni
- ln -sf ../../../../pkg ${S}/src/import/vendor/
github.com/containernetworking/cni/pkg
- ln -sf ../../../../cnitool ${S}/src/import/vendor/
github.com/containernetworking/cni/cnitool
- ln -sf ${WORKDIR}/plugins ${S}/src/import/vendor/
github.com/containernetworking/pluginsrecipes-networking/cni/cni_0.7.1.bb +0
-2- - exportGOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go"
recipes-networking/cni/cni_0.7.1.bb +0
-3- export CGO_ENABLED="1" - - cd ${S}/src/import/vendor/github.com/containernetworking/cni/libcni
recipes-networking/cni/cni_0.7.1.bb +0
-3- ${GO} build - - cd ${S}/src/import/vendor/github.com/containernetworking/cni/cnitool
recipes-networking/cni/cni_0.7.1.bb +0
-4- ${GO} build - - cd ${S}/src/import/vendor/github.com/containernetworking/plugins/ - PLUGINS="$(ls -d plugins/meta/*; ls -d plugins/ipam/*; ls -dplugins/main/* | grep -v windows)"
recipes-networking/cni/cni_0.7.1.bb +0
-5- mkdir -p ${WORKDIR}/plugins/bin/ - for p in $PLUGINS; do - plugin="$(basename "$p")" - echo "building: $p" - ${GO} build -o ${WORKDIR}/plugins/bin/$plugingithub.com/containernetworking/plugins/$p
recipes-networking/cni/cni_0.7.1.bb +0
-16- done -} - -do_install() { - localbindir="/opt/cni/bin" - - install -d ${D}${localbindir} - install -d ${D}/${sysconfdir}/cni/net.d - - install -m 755 ${S}/src/import/cnitool/cnitool ${D}/${localbindir} - install -m 755 -D ${WORKDIR}/plugins/bin/* ${D}/${localbindir} -} - -FILES_${PN} += "/opt/cni/bin/*" - -INSANE_SKIP_${PN} += "ldflags already-stripped"recipes-networking/cni/ renamed from recipes-networking/cni/cni_git.bb +0
-0cni_git.bb
index 5348b95..06b37a4 100644recipes-networking/cni/cni_git.bb +0
-8@@ -1,13 +1,5 @@ -HOMEPAGE = "https://github.com/containernetworking/cni" -SUMMARY = "Container Network Interface - networking for Linux containers" -DESCRIPTION = "CNI (Container Network Interface), a Cloud Native Computing \ -Foundation project, consists of a specification and libraries for writing \ -plugins to configure network interfaces in Linux containers, along with a \ -number of supported plugins. CNI concerns itself only with network connectivity \ -of containers and removing allocated resources when the container is deleted. \ -Because of this focus, CNI has a wide range of support and thespecification \
recipes-networking/cni/cni_git.bb +2
-2-is simple to implement. \ -" +# This cni version is supposed to track latest upstream. +require cni.inc SRCREV_cni = "dc71cd2ba60c452c56a0a259f2a23d2afe42b688" SRCREV_plugins = "0eddc554c0747200b7b112ce5322dcfa525298cf"@@ -15,65 +7,4 @@ SRC_URI = "\ git://github.com/containernetworking/cni.git;nobranch=1;name=cni \ git://github.com/containernetworking/plugins.git;nobranch=1;destsuffix=plugins;name=plugins
\ "recipes-networking/cni/cni_git.bb +0
-5- -RPROVIDES_${PN} += "kubernetes-cni" - -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM ="file://src/import/LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc"
recipes-networking/cni/cni_git.bb +0
-14- -GO_IMPORT = "import" - PV = "0.7.0+git${SRCREV_cni}" - -inherit go -inherit goarch - -do_compile() { - # link fixups for compilation - rm -f ${S}/src/import/vendor/src - mkdir -p ${S}/src/import/vendor/ - ln -sf ./ ${S}/src/import/vendor/src - rm -rf ${S}/src/import/plugins - rm -rf ${S}/src/import/vendor/github.com/containernetworking/plugins
recipes-networking/cni/cni_git.bb +0
-4- - mkdir -p ${S}/src/import/vendor/github.com/containernetworking/cni - - ln -sf ../../../../libcni ${S}/src/import/vendor/github.com/containernetworking/cni/libcni
- ln -sf ../../../../pkg ${S}/src/import/vendor/
github.com/containernetworking/cni/pkg
- ln -sf ../../../../cnitool ${S}/src/import/vendor/
github.com/containernetworking/cni/cnitool
- ln -sf ${WORKDIR}/plugins ${S}/src/import/vendor/
github.com/containernetworking/pluginsrecipes-networking/cni/cni_git.bb +0
-2- - exportGOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go"
recipes-networking/cni/cni_git.bb +0
-3- export CGO_ENABLED="1" - - cd ${S}/src/import/vendor/github.com/containernetworking/cni/libcni
recipes-networking/cni/cni_git.bb +0
-3- ${GO} build - - cd ${S}/src/import/vendor/github.com/containernetworking/cni/cnitool
recipes-networking/cni/cni_git.bb +0
-4- ${GO} build - - cd ${S}/src/import/vendor/github.com/containernetworking/plugins/ - PLUGINS="$(ls -d plugins/meta/*; ls -d plugins/ipam/*; ls -dplugins/main/* | grep -v windows)"
recipes-networking/cni/cni_git.bb +0
-5- mkdir -p ${WORKDIR}/plugins/bin/ - for p in $PLUGINS; do - plugin="$(basename "$p")" - echo "building: $p" - ${GO} build -o ${WORKDIR}/plugins/bin/$plugingithub.com/containernetworking/plugins/$p
recipes-networking/cni/cni_git.bb +0
-19- done -} - -do_install() { - localbindir="/opt/cni/bin" - - install -d ${D}${localbindir} - install -d ${D}/${sysconfdir}/cni/net.d - - install -m 755 ${S}/src/import/cnitool/cnitool ${D}/${localbindir} - install -m 755 -D ${WORKDIR}/plugins/bin/* ${D}/${localbindir} -} - -FILES_${PN} += "/opt/cni/bin/*" - -INSANE_SKIP_${PN} += "ldflags already-stripped" - -deltask compile_ptest_base --2.17.1
--
_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization
Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end - "Use the force Harry" - Gandalf, Star Trek II
Re: [PATCH 2/4] cni: extract common settings to cni.inc
Quoted 11 lines · Bruce Ashfield
On Tue, Aug 13, 2019 at 3:52 AM Chen Qi <[email protected] <mailto:[email protected]>> wrote:
Extract common settings of two cni recipe into cni.inc. Add comment in recipe file to explicitly state what the version is for.
More sepcifically, the git version is used to track latest upstream, while the 0.7.1 version is used to ensure basic setup works for k8s.
Quoted 6 lines
As I mentioned, we won't do this. It doubles the maintenance and shows a fundamental API / ABI incompatibility if we can't use the different versions against a released k8s.
There is one version of the recipe, and I've always had it working for the released kubernetes and master. I'm not seeing any issues with the latest and my k8s configs, so I'm not sure what you are running into that I'm not.
Bruce
I've filed an issue for upstream. https://github.com/containernetworking/plugins/issues/370#issuecomment-520718048
Please check it.
How do you setup you k8s cluster? Are you using flannel?
I can confirm that the current versions in meta-virtualization would result in "failed to create bridge "cni0": could not add "cni0": operation not supported" error. This can be reproduced on both virtual machines and physical machines.
Execute the following commands on target, and you should see the coredns is not running, and when describing the pod, you see the failure. swapoff -a
kubeadm init --pod-network-cidr=10.244.0.0/16
mkdir -p $HOME/.kube
cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
chown $(id -u):$(id -g) $HOME/.kube/config
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
Please help double check if this could be reproduced on your side.
Best Regards,
Chen Qi
Quoted 400 lines
Signed-off-by: Chen Qi <[email protected] <mailto:[email protected]>> --- recipes-networking/cni/cni.inc | 79 +++++++++++++++++++++++++++++ recipes-networking/cni/cni_0.7.1.bb <http://cni_0.7.1.bb> | 71 +------------------------- recipes-networking/cni/cni_git.bb <http://cni_git.bb> | 73 +------------------------- 3 files changed, 83 insertions(+), 140 deletions(-) create mode 100644 recipes-networking/cni/cni.inc diff --git a/recipes-networking/cni/cni.inc b/recipes-networking/cni/cni.inc new file mode 100644 index 0000000..7a3b87f --- /dev/null +++ b/recipes-networking/cni/cni.inc @@ -0,0 +1,79 @@ +HOMEPAGE = "https://github.com/containernetworking/cni" +SUMMARY = "Container Network Interface - networking for Linux containers" +DESCRIPTION = "CNI (Container Network Interface), a Cloud Native Computing \ +Foundation project, consists of a specification and libraries for writing \ +plugins to configure network interfaces in Linux containers, along with a \ +number of supported plugins. CNI concerns itself only with network connectivity \ +of containers and removing allocated resources when the container is deleted. \ +Because of this focus, CNI has a wide range of support and the specification \ +is simple to implement. \ +" + +# 0.7.1 +SRCREV_cni = "4cfb7b568922a3c79a23e438dc52fe537fc9687e" +# 0.7.5 +SRCREV_plugins = "a62711a5da7a2dc2eb93eac47e103738ad923fd6" +SRC_URI = "\ + git://github.com/containernetworking/cni.git;branch=master;name=cni <http://github.com/containernetworking/cni.git;branch=master;name=cni> \ + git://github.com/containernetworking/plugins.git;branch=v0.7;destsuffix=plugins;name=plugins <http://github.com/containernetworking/plugins.git;branch=v0.7;destsuffix=plugins;name=plugins> \ + " + +RPROVIDES_${PN} += "kubernetes-cni" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc" + +GO_IMPORT = "import" + +PV = "0.7.1" + +inherit go +inherit goarch + +do_compile() { + # link fixups for compilation + rm -f ${S}/src/import/vendor/src + mkdir -p ${S}/src/import/vendor/ + ln -sf ./ ${S}/src/import/vendor/src + rm -rf ${S}/src/import/plugins + rm -rf ${S}/src/import/vendor/github.com/containernetworking/plugins <http://github.com/containernetworking/plugins> + + mkdir -p ${S}/src/import/vendor/github.com/containernetworking/cni <http://github.com/containernetworking/cni> + + ln -sf ../../../../libcni ${S}/src/import/vendor/github.com/containernetworking/cni/libcni <http://github.com/containernetworking/cni/libcni> + ln -sf ../../../../pkg ${S}/src/import/vendor/github.com/containernetworking/cni/pkg <http://github.com/containernetworking/cni/pkg> + ln -sf ../../../../cnitool ${S}/src/import/vendor/github.com/containernetworking/cni/cnitool <http://github.com/containernetworking/cni/cnitool> + ln -sf ${WORKDIR}/plugins ${S}/src/import/vendor/github.com/containernetworking/plugins <http://github.com/containernetworking/plugins> + + export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go" + export CGO_ENABLED="1" + + cd ${S}/src/import/vendor/github.com/containernetworking/cni/libcni <http://github.com/containernetworking/cni/libcni> + ${GO} build + + cd ${S}/src/import/vendor/github.com/containernetworking/cni/cnitool <http://github.com/containernetworking/cni/cnitool> + ${GO} build + + cd ${S}/src/import/vendor/github.com/containernetworking/plugins/ <http://github.com/containernetworking/plugins/> + PLUGINS="$(ls -d plugins/meta/*; ls -d plugins/ipam/*; ls -d plugins/main/* | grep -v windows)" + mkdir -p ${WORKDIR}/plugins/bin/ + for p in $PLUGINS; do + plugin="$(basename "$p")" + echo "building: $p" + ${GO} build -o ${WORKDIR}/plugins/bin/$plugin github.com/containernetworking/plugins/$p <http://github.com/containernetworking/plugins/$p> + done +} + +do_install() { + localbindir="/opt/cni/bin" + + install -d ${D}${localbindir} + install -d ${D}/${sysconfdir}/cni/net.d + + install -m 755 ${S}/src/import/cnitool/cnitool ${D}/${localbindir} + install -m 755 -D ${WORKDIR}/plugins/bin/* ${D}/${localbindir} +} + +FILES_${PN} += "/opt/cni/bin/*" + +INSANE_SKIP_${PN} += "ldflags already-stripped" diff --git a/recipes-networking/cni/cni_0.7.1.bb <http://cni_0.7.1.bb> b/recipes-networking/cni/cni_0.7.1.bb <http://cni_0.7.1.bb> index 7a3b87f..7977040 100644 --- a/recipes-networking/cni/cni_0.7.1.bb <http://cni_0.7.1.bb> +++ b/recipes-networking/cni/cni_0.7.1.bb <http://cni_0.7.1.bb> @@ -1,13 +1,5 @@ -HOMEPAGE = "https://github.com/containernetworking/cni" -SUMMARY = "Container Network Interface - networking for Linux containers" -DESCRIPTION = "CNI (Container Network Interface), a Cloud Native Computing \ -Foundation project, consists of a specification and libraries for writing \ -plugins to configure network interfaces in Linux containers, along with a \ -number of supported plugins. CNI concerns itself only with network connectivity \ -of containers and removing allocated resources when the container is deleted. \ -Because of this focus, CNI has a wide range of support and the specification \ -is simple to implement. \ -" +# This cni version is here to ensure that basic k8s setup with flannel could work. +require cni.inc # 0.7.1 SRCREV_cni = "4cfb7b568922a3c79a23e438dc52fe537fc9687e" @@ -17,63 +9,4 @@ SRC_URI = "\ git://github.com/containernetworking/cni.git;branch=master;name=cni <http://github.com/containernetworking/cni.git;branch=master;name=cni> \ git://github.com/containernetworking/plugins.git;branch=v0.7;destsuffix=plugins;name=plugins <http://github.com/containernetworking/plugins.git;branch=v0.7;destsuffix=plugins;name=plugins> \ " - -RPROVIDES_${PN} += "kubernetes-cni" - -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc" - -GO_IMPORT = "import" - PV = "0.7.1" - -inherit go -inherit goarch - -do_compile() { - # link fixups for compilation - rm -f ${S}/src/import/vendor/src - mkdir -p ${S}/src/import/vendor/ - ln -sf ./ ${S}/src/import/vendor/src - rm -rf ${S}/src/import/plugins - rm -rf ${S}/src/import/vendor/github.com/containernetworking/plugins <http://github.com/containernetworking/plugins> - - mkdir -p ${S}/src/import/vendor/github.com/containernetworking/cni <http://github.com/containernetworking/cni> - - ln -sf ../../../../libcni ${S}/src/import/vendor/github.com/containernetworking/cni/libcni <http://github.com/containernetworking/cni/libcni> - ln -sf ../../../../pkg ${S}/src/import/vendor/github.com/containernetworking/cni/pkg <http://github.com/containernetworking/cni/pkg> - ln -sf ../../../../cnitool ${S}/src/import/vendor/github.com/containernetworking/cni/cnitool <http://github.com/containernetworking/cni/cnitool> - ln -sf ${WORKDIR}/plugins ${S}/src/import/vendor/github.com/containernetworking/plugins <http://github.com/containernetworking/plugins> - - export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go" - export CGO_ENABLED="1" - - cd ${S}/src/import/vendor/github.com/containernetworking/cni/libcni <http://github.com/containernetworking/cni/libcni> - ${GO} build - - cd ${S}/src/import/vendor/github.com/containernetworking/cni/cnitool <http://github.com/containernetworking/cni/cnitool> - ${GO} build - - cd ${S}/src/import/vendor/github.com/containernetworking/plugins/ <http://github.com/containernetworking/plugins/> - PLUGINS="$(ls -d plugins/meta/*; ls -d plugins/ipam/*; ls -d plugins/main/* | grep -v windows)" - mkdir -p ${WORKDIR}/plugins/bin/ - for p in $PLUGINS; do - plugin="$(basename "$p")" - echo "building: $p" - ${GO} build -o ${WORKDIR}/plugins/bin/$plugin github.com/containernetworking/plugins/$p <http://github.com/containernetworking/plugins/$p> - done -} - -do_install() { - localbindir="/opt/cni/bin" - - install -d ${D}${localbindir} - install -d ${D}/${sysconfdir}/cni/net.d - - install -m 755 ${S}/src/import/cnitool/cnitool ${D}/${localbindir} - install -m 755 -D ${WORKDIR}/plugins/bin/* ${D}/${localbindir} -} - -FILES_${PN} += "/opt/cni/bin/*" - -INSANE_SKIP_${PN} += "ldflags already-stripped" diff --git a/recipes-networking/cni/cni_git.bb <http://cni_git.bb> b/recipes-networking/cni/cni_git.bb <http://cni_git.bb> index 5348b95..06b37a4 100644 --- a/recipes-networking/cni/cni_git.bb <http://cni_git.bb> +++ b/recipes-networking/cni/cni_git.bb <http://cni_git.bb> @@ -1,13 +1,5 @@ -HOMEPAGE = "https://github.com/containernetworking/cni" -SUMMARY = "Container Network Interface - networking for Linux containers" -DESCRIPTION = "CNI (Container Network Interface), a Cloud Native Computing \ -Foundation project, consists of a specification and libraries for writing \ -plugins to configure network interfaces in Linux containers, along with a \ -number of supported plugins. CNI concerns itself only with network connectivity \ -of containers and removing allocated resources when the container is deleted. \ -Because of this focus, CNI has a wide range of support and the specification \ -is simple to implement. \ -" +# This cni version is supposed to track latest upstream. +require cni.inc SRCREV_cni = "dc71cd2ba60c452c56a0a259f2a23d2afe42b688" SRCREV_plugins = "0eddc554c0747200b7b112ce5322dcfa525298cf" @@ -15,65 +7,4 @@ SRC_URI = "\ git://github.com/containernetworking/cni.git;nobranch=1;name=cni <http://github.com/containernetworking/cni.git;nobranch=1;name=cni> \ git://github.com/containernetworking/plugins.git;nobranch=1;destsuffix=plugins;name=plugins <http://github.com/containernetworking/plugins.git;nobranch=1;destsuffix=plugins;name=plugins> \ " - -RPROVIDES_${PN} += "kubernetes-cni" - -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc" - -GO_IMPORT = "import" - PV = "0.7.0+git${SRCREV_cni}" - -inherit go -inherit goarch - -do_compile() { - # link fixups for compilation - rm -f ${S}/src/import/vendor/src - mkdir -p ${S}/src/import/vendor/ - ln -sf ./ ${S}/src/import/vendor/src - rm -rf ${S}/src/import/plugins - rm -rf ${S}/src/import/vendor/github.com/containernetworking/plugins <http://github.com/containernetworking/plugins> - - mkdir -p ${S}/src/import/vendor/github.com/containernetworking/cni <http://github.com/containernetworking/cni> - - ln -sf ../../../../libcni ${S}/src/import/vendor/github.com/containernetworking/cni/libcni <http://github.com/containernetworking/cni/libcni> - ln -sf ../../../../pkg ${S}/src/import/vendor/github.com/containernetworking/cni/pkg <http://github.com/containernetworking/cni/pkg> - ln -sf ../../../../cnitool ${S}/src/import/vendor/github.com/containernetworking/cni/cnitool <http://github.com/containernetworking/cni/cnitool> - ln -sf ${WORKDIR}/plugins ${S}/src/import/vendor/github.com/containernetworking/plugins <http://github.com/containernetworking/plugins> - - export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go" - export CGO_ENABLED="1" - - cd ${S}/src/import/vendor/github.com/containernetworking/cni/libcni <http://github.com/containernetworking/cni/libcni> - ${GO} build - - cd ${S}/src/import/vendor/github.com/containernetworking/cni/cnitool <http://github.com/containernetworking/cni/cnitool> - ${GO} build - - cd ${S}/src/import/vendor/github.com/containernetworking/plugins/ <http://github.com/containernetworking/plugins/> - PLUGINS="$(ls -d plugins/meta/*; ls -d plugins/ipam/*; ls -d plugins/main/* | grep -v windows)" - mkdir -p ${WORKDIR}/plugins/bin/ - for p in $PLUGINS; do - plugin="$(basename "$p")" - echo "building: $p" - ${GO} build -o ${WORKDIR}/plugins/bin/$plugin github.com/containernetworking/plugins/$p <http://github.com/containernetworking/plugins/$p> - done -} - -do_install() { - localbindir="/opt/cni/bin" - - install -d ${D}${localbindir} - install -d ${D}/${sysconfdir}/cni/net.d - - install -m 755 ${S}/src/import/cnitool/cnitool ${D}/${localbindir} - install -m 755 -D ${WORKDIR}/plugins/bin/* ${D}/${localbindir} -} - -FILES_${PN} += "/opt/cni/bin/*" - -INSANE_SKIP_${PN} += "ldflags already-stripped" - -deltask compile_ptest_base -- 2.17.1 -- _______________________________________________ meta-virtualization mailing list [email protected] <mailto:[email protected]> https://lists.yoctoproject.org/listinfo/meta-virtualizationSignature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end - "Use the force Harry" - Gandalf, Star Trek II
Re: [PATCH 2/4] cni: extract common settings to cni.inc
Quoted 17 lines · ChenQi
On 08/13/2019 08:34 PM, Bruce Ashfield wrote:
Quoted 5 lines · Chen Qi
Extract common settings of two cni recipe into cni.inc.
Add comment in recipe file to explicitly state what the version is for. More sepcifically, the git version is used to track latest upstream, while the 0.7.1 version is used to ensure basic setup works for k8s.As I mentioned, we won't do this. It doubles the maintenance and shows a fundamental API / ABI incompatibility if we can't use the different versions against a released k8s.
There is one version of the recipe, and I've always had it working for the released kubernetes and master. I'm not seeing any issues with the latest and my k8s configs, so I'm not sure what you are running into that I'm not.
Quoted 7 lines
Bruce
I've filed an issue for upstream. https://github.com/containernetworking/plugins/issues/370#issuecomment-520718048
Please check it.How do you setup you k8s cluster? Are you using flannel?
I'm not using flannel for my networking. It is typically weave or some custom CNI drivers in most of my tests.
Quoted 11 lines
I can confirm that the current versions in meta-virtualization would result in "failed to create bridge "cni0": could not add "cni0": operation not supported" error. This can be reproduced on both virtual machines and physical machines.
Execute the following commands on target, and you should see the coredns is not running, and when describing the pod, you see the failure. swapoff -a
kubeadm init --pod-network-cidr=10.244.0.0/16
mkdir -p $HOME/.kube
cp -i/etc/kubernetes/admin.conf$HOME/.kube/config
chown $(id -u):$(id -g) $HOME/.kube/config
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.ymlPlease help double check if this could be reproduced on your side.
I won't have time to check this for a few days. I have a lot of release deliverables to get moved along.
But issues like this are expected, since we are still in a development cycle. Splitting and maintaining multiple locked version variants of the recipe is not a good long term strategy. What happens when someone wants another version. Do we keep three around ? Four ? Who's going to maintain, bug fix and eventually test/remove them ?
I'd suggest keeping a bbappend with a set SRCREV in your local layer to not block your development while upstream works through the issue .. or we debug and try and contribute a fix to the upstream project.
Bruce
Quoted 286 lines
Best Regards,
Chen QiQuoted 268 lines
Signed-off-by Chen Qi <[email protected]>--- recipes-networking/cni/cni.inc | 79 +++++++++++++++++++++++++++++ recipes-networking/cni/cni_0.7.1.bb | 71 +------------------------- recipes-networking/cni/cni_git.bb | 73 +------------------------- 3 files changed, 83 insertions(+), 140 deletions(-) create mode 100644 recipes-networking/cni/cni.increcipes-networking/cni/cni.inc new file +79
-0@@ -0,0 +1,79 @@ +HOMEPAGE = "https://github.com/containernetworking/cni" +SUMMARY = "Container Network Interface - networking for Linux containers" +DESCRIPTION = "CNI (Container Network Interface), a Cloud Native Computing \ +Foundation project, consists of a specification and libraries for writing \ +plugins to configure network interfaces in Linux containers, along with a \ +number of supported plugins. CNI concerns itself only with network connectivity \ +of containers and removing allocated resources when the container is deleted. \ +Because of this focus, CNI has a wide range of support and the specification \ +is simple to implement. \ +" + +# 0.7.1 +SRCREV_cni = "4cfb7b568922a3c79a23e438dc52fe537fc9687e" +# 0.7.5 +SRCREV_plugins = "a62711a5da7a2dc2eb93eac47e103738ad923fd6" +SRC_URI = "\ + git://github.com/containernetworking/cni.git;branch=master;name=cni \ + git://github.com/containernetworking/plugins.git;branch=v0.7;destsuffix=plugins;name=plugins \ + " + +RPROVIDES_${PN} += "kubernetes-cni" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc" + +GO_IMPORT = "import" + +PV = "0.7.1" + +inherit go +inherit goarch + +do_compile() { + # link fixups for compilation + rm -f ${S}/src/import/vendor/src + mkdir -p ${S}/src/import/vendor/ + ln -sf ./ ${S}/src/import/vendor/src + rm -rf ${S}/src/import/plugins + rm -rf ${S}/src/import/vendor/github.com/containernetworking/plugins + + mkdir -p ${S}/src/import/vendor/github.com/containernetworking/cni + + ln -sf ../../../../libcni ${S}/src/import/vendor/github.com/containernetworking/cni/libcni + ln -sf ../../../../pkg ${S}/src/import/vendor/github.com/containernetworking/cni/pkg + ln -sf ../../../../cnitool ${S}/src/import/vendor/github.com/containernetworking/cni/cnitool + ln -sf ${WORKDIR}/plugins ${S}/src/import/vendor/github.com/containernetworking/plugins + + export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go" + export CGO_ENABLED="1" + + cd ${S}/src/import/vendor/github.com/containernetworking/cni/libcni + ${GO} build + + cd ${S}/src/import/vendor/github.com/containernetworking/cni/cnitool + ${GO} build + + cd ${S}/src/import/vendor/github.com/containernetworking/plugins/ + PLUGINS="$(ls -d plugins/meta/*; ls -d plugins/ipam/*; ls -d plugins/main/* | grep -v windows)" + mkdir -p ${WORKDIR}/plugins/bin/ + for p in $PLUGINS; do + plugin="$(basename "$p")" + echo "building: $p" + ${GO} build -o ${WORKDIR}/plugins/bin/$plugin github.com/containernetworking/plugins/$p + done +} + +do_install() { + localbindir="/opt/cni/bin" + + install -d ${D}${localbindir} + install -d ${D}/${sysconfdir}/cni/net.d + + install -m 755 ${S}/src/import/cnitool/cnitool ${D}/${localbindir} + install -m 755 -D ${WORKDIR}/plugins/bin/* ${D}/${localbindir} +} + +FILES_${PN} += "/opt/cni/bin/*" + +INSANE_SKIP_${PN} += "ldflags already-stripped"recipes-networking/cni/cni_0.7.1.bb +2
-69@@ -1,13 +1,5 @@ -HOMEPAGE = "https://github.com/containernetworking/cni" -SUMMARY = "Container Network Interface - networking for Linux containers" -DESCRIPTION = "CNI (Container Network Interface), a Cloud Native Computing \ -Foundation project, consists of a specification and libraries for writing \ -plugins to configure network interfaces in Linux containers, along with a \ -number of supported plugins. CNI concerns itself only with network connectivity \ -of containers and removing allocated resources when the container is deleted. \ -Because of this focus, CNI has a wide range of support and the specification \ -is simple to implement. \ -" +# This cni version is here to ensure that basic k8s setup with flannel could work. +require cni.inc # 0.7.1 SRCREV_cni = "4cfb7b568922a3c79a23e438dc52fe537fc9687e"@@ -17,63 +9,4 @@ SRC_URI = "\ git://github.com/containernetworking/cni.git;branch=master;name=cni \ git://github.com/containernetworking/plugins.git;branch=v0.7;destsuffix=plugins;name=plugins \ " - -RPROVIDES_${PN} += "kubernetes-cni" - -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc" - -GO_IMPORT = "import" - PV = "0.7.1" - -inherit go -inherit goarch - -do_compile() { - # link fixups for compilation - rm -f ${S}/src/import/vendor/src - mkdir -p ${S}/src/import/vendor/ - ln -sf ./ ${S}/src/import/vendor/src - rm -rf ${S}/src/import/plugins - rm -rf ${S}/src/import/vendor/github.com/containernetworking/plugins - - mkdir -p ${S}/src/import/vendor/github.com/containernetworking/cni - - ln -sf ../../../../libcni ${S}/src/import/vendor/github.com/containernetworking/cni/libcni - ln -sf ../../../../pkg ${S}/src/import/vendor/github.com/containernetworking/cni/pkg - ln -sf ../../../../cnitool ${S}/src/import/vendor/github.com/containernetworking/cni/cnitool - ln -sf ${WORKDIR}/plugins ${S}/src/import/vendor/github.com/containernetworking/plugins - - export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go" - export CGO_ENABLED="1" - - cd ${S}/src/import/vendor/github.com/containernetworking/cni/libcni - ${GO} build - - cd ${S}/src/import/vendor/github.com/containernetworking/cni/cnitool - ${GO} build - - cd ${S}/src/import/vendor/github.com/containernetworking/plugins/ - PLUGINS="$(ls -d plugins/meta/*; ls -d plugins/ipam/*; ls -d plugins/main/* | grep -v windows)" - mkdir -p ${WORKDIR}/plugins/bin/ - for p in $PLUGINS; do - plugin="$(basename "$p")" - echo "building: $p" - ${GO} build -o ${WORKDIR}/plugins/bin/$plugin github.com/containernetworking/plugins/$p - done -} - -do_install() { - localbindir="/opt/cni/bin" - - install -d ${D}${localbindir} - install -d ${D}/${sysconfdir}/cni/net.d - - install -m 755 ${S}/src/import/cnitool/cnitool ${D}/${localbindir} - install -m 755 -D ${WORKDIR}/plugins/bin/* ${D}/${localbindir} -} - -FILES_${PN} += "/opt/cni/bin/*" - -INSANE_SKIP_${PN} += "ldflags already-stripped"recipes-networking/cni/cni_git.bb +2
-72@@ -1,13 +1,5 @@ -HOMEPAGE = "https://github.com/containernetworking/cni" -SUMMARY = "Container Network Interface - networking for Linux containers" -DESCRIPTION = "CNI (Container Network Interface), a Cloud Native Computing \ -Foundation project, consists of a specification and libraries for writing \ -plugins to configure network interfaces in Linux containers, along with a \ -number of supported plugins. CNI concerns itself only with network connectivity \ -of containers and removing allocated resources when the container is deleted. \ -Because of this focus, CNI has a wide range of support and the specification \ -is simple to implement. \ -" +# This cni version is supposed to track latest upstream. +require cni.inc SRCREV_cni = "dc71cd2ba60c452c56a0a259f2a23d2afe42b688" SRCREV_plugins = "0eddc554c0747200b7b112ce5322dcfa525298cf"@@ -15,65 +7,4 @@ SRC_URI = "\ git://github.com/containernetworking/cni.git;nobranch=1;name=cni \ git://github.com/containernetworking/plugins.git;nobranch=1;destsuffix=plugins;name=plugins \ " - -RPROVIDES_${PN} += "kubernetes-cni" - -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc" - -GO_IMPORT = "import" - PV = "0.7.0+git${SRCREV_cni}" - -inherit go -inherit goarch - -do_compile() { - # link fixups for compilation - rm -f ${S}/src/import/vendor/src - mkdir -p ${S}/src/import/vendor/ - ln -sf ./ ${S}/src/import/vendor/src - rm -rf ${S}/src/import/plugins - rm -rf ${S}/src/import/vendor/github.com/containernetworking/plugins - - mkdir -p ${S}/src/import/vendor/github.com/containernetworking/cni - - ln -sf ../../../../libcni ${S}/src/import/vendor/github.com/containernetworking/cni/libcni - ln -sf ../../../../pkg ${S}/src/import/vendor/github.com/containernetworking/cni/pkg - ln -sf ../../../../cnitool ${S}/src/import/vendor/github.com/containernetworking/cni/cnitool - ln -sf ${WORKDIR}/plugins ${S}/src/import/vendor/github.com/containernetworking/plugins - - export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go" - export CGO_ENABLED="1" - - cd ${S}/src/import/vendor/github.com/containernetworking/cni/libcni - ${GO} build - - cd ${S}/src/import/vendor/github.com/containernetworking/cni/cnitool - ${GO} build - - cd ${S}/src/import/vendor/github.com/containernetworking/plugins/ - PLUGINS="$(ls -d plugins/meta/*; ls -d plugins/ipam/*; ls -d plugins/main/* | grep -v windows)" - mkdir -p ${WORKDIR}/plugins/bin/ - for p in $PLUGINS; do - plugin="$(basename "$p")" - echo "building: $p" - ${GO} build -o ${WORKDIR}/plugins/bin/$plugin github.com/containernetworking/plugins/$p - done -} - -do_install() { - localbindir="/opt/cni/bin" - - install -d ${D}${localbindir} - install -d ${D}/${sysconfdir}/cni/net.d - - install -m 755 ${S}/src/import/cnitool/cnitool ${D}/${localbindir} - install -m 755 -D ${WORKDIR}/plugins/bin/* ${D}/${localbindir} -} - -FILES_${PN} += "/opt/cni/bin/*" - -INSANE_SKIP_${PN} += "ldflags already-stripped" - -deltask compile_ptest_base --2.17.1
Quoted 5 lines
--
_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end - "Use the force Harry" - Gandalf, Star Trek II
PATCH 3/4 cni: upgrade git version to latest master
In reply to Chen QiUpgrade the git version to latest master to make the recipe truly serve its purpose.
This upgrades both cni and plugins repos.
--- recipes-networking/cni/cni_git.bb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
recipes-networking/cni/cni_git.bb +3 -3
@@ -1,10 +1,10 @@ # This cni version is supposed to track latest upstream. require cni.inc -SRCREV_cni = "dc71cd2ba60c452c56a0a259f2a23d2afe42b688" -SRCREV_plugins = "0eddc554c0747200b7b112ce5322dcfa525298cf" +SRCREV_cni = "8c6c47d1c7fcf51c8d0c939d2af06dd108f876da" +SRCREV_plugins = "2d6d4b260a98973a206fde18bdde4f2511c72c60" SRC_URI = "\ git://github.com/containernetworking/cni.git;nobranch=1;name=cni \ git://github.com/containernetworking/plugins.git;nobranch=1;destsuffix=plugins;name=plugins \ " -PV = "0.7.0+git${SRCREV_cni}" +PV = "0.7.1+git${SRCREV_cni}"
Signature · 1 line
2.17.1
Re: [PATCH 3/4] cni: upgrade git version to latest master
Quoted 3 lines · Chen Qi
Upgrade the git version to latest master to make the recipe truly serve its purpose.
That's not a good reason to do the uprev, this is a git recipe because it makes sense for it to be git .. not because it is tracking the tip of master all the time.
What *actual* functionality are we getting from this ? How was it tested ?
Bruce
Quoted 38 lines
This upgrades both cni and plugins repos.
Signed-off-by Chen Qi <[email protected]>--- recipes-networking/cni/cni_git.bb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)recipes-networking/cni/ renamed from recipes-networking/cni/cni_git.bb +0
-0cni_git.bb
index 06b37a4..60c39f1 100644recipes-networking/cni/cni_git.bb +2
-2@@ -1,10 +1,10 @@ # This cni version is supposed to track latest upstream. require cni.inc -SRCREV_cni = "dc71cd2ba60c452c56a0a259f2a23d2afe42b688" -SRCREV_plugins = "0eddc554c0747200b7b112ce5322dcfa525298cf" +SRCREV_cni = "8c6c47d1c7fcf51c8d0c939d2af06dd108f876da" +SRCREV_plugins = "2d6d4b260a98973a206fde18bdde4f2511c72c60" SRC_URI = "\ git://github.com/containernetworking/cni.git;nobranch=1;name=cni \ git://github.com/containernetworking/plugins.git;nobranch=1;destsuffix=plugins;name=plugins
\ "recipes-networking/cni/cni_git.bb +1
-2-PV = "0.7.0+git${SRCREV_cni}" +PV = "0.7.1+git${SRCREV_cni}" --2.17.1
--
_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization
Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end - "Use the force Harry" - Gandalf, Star Trek II
Re: [PATCH 3/4] cni: upgrade git version to latest master
Quoted 8 lines · Bruce Ashfield
Quoted 3 lines · Chen Qi
Upgrade the git version to latest master to make the recipe truly serve its purpose.
Quoted 6 lines
That's not a good reason to do the uprev, this is a git recipe because it makes sense for it to be git .. not because it is tracking the tip of master all the time.
What *actual* functionality are we getting from this ? How was it tested ?
Ignore this comment, since I was reviewing the patches in order, and I saw the locked version split after writing this comment.
But the comment I made to the other patches still stands. We don't want extra/double maintenance, so just uprev the recipe to where it works with k8s (preferably the latest version at the time, since that is what I always do), and we'll support that.
Since it is a _git recipe, it is trivial for people to bump it for local testing, there's no need for the two variants.
Bruce
Quoted 52 lines
Bruce
Quoted 33 lines
This upgrades both cni and plugins repos.
Signed-off-by Chen Qi <[email protected]>--- recipes-networking/cni/cni_git.bb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)recipes-networking/cni/ renamed from recipes-networking/cni/cni_git.bb +0
-0cni_git.bb
index 06b37a4..60c39f1 100644recipes-networking/cni/cni_git.bb +2
-2@@ -1,10 +1,10 @@ # This cni version is supposed to track latest upstream. require cni.inc -SRCREV_cni = "dc71cd2ba60c452c56a0a259f2a23d2afe42b688" -SRCREV_plugins = "0eddc554c0747200b7b112ce5322dcfa525298cf" +SRCREV_cni = "8c6c47d1c7fcf51c8d0c939d2af06dd108f876da" +SRCREV_plugins = "2d6d4b260a98973a206fde18bdde4f2511c72c60" SRC_URI = "\ git://github.com/containernetworking/cni.git;nobranch=1;name=cni \ git://github.com/containernetworking/plugins.git;nobranch=1;destsuffix=plugins;name=plugins
\ "recipes-networking/cni/cni_git.bb +1
-2-PV = "0.7.0+git${SRCREV_cni}" +PV = "0.7.1+git${SRCREV_cni}" --2.17.1
Quoted 6 lines
--
_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end - "Use the force Harry" - Gandalf, Star Trek II
PATCH 4/4 cni: mark as incompatible with mips for 0.7.1 version
In reply to Chen QiThis version does not build successfully for mips. So mark it as incompatible to make things clear.
--- recipes-networking/cni/cni_0.7.1.bb | 1 + 1 file changed, 1 insertion(+)
recipes-networking/cni/cni_0.7.1.bb +1 -0
@@ -10,3 +10,4 @@ SRC_URI = "\ git://github.com/containernetworking/plugins.git;branch=v0.7;destsuffix=plugins;name=plugins \ " PV = "0.7.1" +COMPATIBLE_HOST_mips = "null"
Signature · 1 line
2.17.1
Quoted 3 lines · Chen Qi
This version is proved to work well for simple k8s flannel setup.
Nope. We have no reason to use version locked recipes for this. I want one version for the layer, not a _git and a versioned set of plugins.
Upgrade the main _cni plugin to the latest version, make sure it works with kubernetes and that's the version we'll use.
Cheers,
Bruce
Quoted 121 lines
Signed-off-by Chen Qi <[email protected]>--- recipes-networking/cni/cni_0.7.1.bb | 79 +++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 recipes-networking/cni/cni_0.7.1.bbrecipes-networking/cni/ renamed from recipes-networking/cni/cni_0.7.1.bb +0
-0cni_0.7.1.bb
new file mode 100644
index 0000000..7a3b87frecipes-networking/cni/cni_0.7.1.bb new file +3
-0@@ -0,0 +1,79 @@ +HOMEPAGE = "https://github.com/containernetworking/cni" +SUMMARY = "Container Network Interface - networking for Linux containers" +DESCRIPTION = "CNI (Container Network Interface), a Cloud NativeComputing \
+Foundation project, consists of a specification and libraries for writing \
+plugins to configure network interfaces in Linux containers, along with a \
+number of supported plugins. CNI concerns itself only with network connectivity \
+of containers and removing allocated resources when the container is deleted. \
+Because of this focus, CNI has a wide range of support and the specification \recipes-networking/cni/cni_0.7.1.bb new file +9
-0+is simple to implement. \ +" + +# 0.7.1 +SRCREV_cni = "4cfb7b568922a3c79a23e438dc52fe537fc9687e" +# 0.7.5 +SRCREV_plugins = "a62711a5da7a2dc2eb93eac47e103738ad923fd6" +SRC_URI = "\ + git://github.com/containernetworking/cni.git;branch=master;name=cni \
+git://
github.com/containernetworking/plugins.git;branch=v0.7;destsuffix=plugins;name=plugins \recipes-networking/cni/cni_0.7.1.bb new file +6
-0+ " + +RPROVIDES_${PN} += "kubernetes-cni" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM ="file://src/import/LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc"
recipes-networking/cni/cni_0.7.1.bb new file +15
-0+ +GO_IMPORT = "import" + +PV = "0.7.1" + +inherit go +inherit goarch + +do_compile() { + # link fixups for compilation + rm -f ${S}/src/import/vendor/src + mkdir -p ${S}/src/import/vendor/ + ln -sf ./ ${S}/src/import/vendor/src + rm -rf ${S}/src/import/plugins + rm -rf ${S}/src/import/vendor/github.com/containernetworking/plugins
recipes-networking/cni/cni_0.7.1.bb new file +4
-0+ + mkdir -p ${S}/src/import/vendor/github.com/containernetworking/cni + + ln -sf ../../../../libcni ${S}/src/import/vendor/github.com/containernetworking/cni/libcni
+ ln -sf ../../../../pkg ${S}/src/import/vendor/
github.com/containernetworking/cni/pkg
+ ln -sf ../../../../cnitool ${S}/src/import/vendor/
github.com/containernetworking/cni/cnitool
+ ln -sf ${WORKDIR}/plugins ${S}/src/import/vendor/
github.com/containernetworking/pluginsrecipes-networking/cni/cni_0.7.1.bb new file +2
-0+ + exportGOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go"
recipes-networking/cni/cni_0.7.1.bb new file +3
-0+ export CGO_ENABLED="1" + + cd ${S}/src/import/vendor/github.com/containernetworking/cni/libcni
recipes-networking/cni/cni_0.7.1.bb new file +3
-0+ ${GO} build + + cd ${S}/src/import/vendor/github.com/containernetworking/cni/cnitool
recipes-networking/cni/cni_0.7.1.bb new file +4
-0+ ${GO} build + + cd ${S}/src/import/vendor/github.com/containernetworking/plugins/ + PLUGINS="$(ls -d plugins/meta/*; ls -d plugins/ipam/*; ls -dplugins/main/* | grep -v windows)"
recipes-networking/cni/cni_0.7.1.bb new file +5
-0+ mkdir -p ${WORKDIR}/plugins/bin/ + for p in $PLUGINS; do + plugin="$(basename "$p")" + echo "building: $p" + ${GO} build -o ${WORKDIR}/plugins/bin/$plugingithub.com/containernetworking/plugins/$p
recipes-networking/cni/cni_0.7.1.bb new file +16
-1+ done +} + +do_install() { + localbindir="/opt/cni/bin" + + install -d ${D}${localbindir} + install -d ${D}/${sysconfdir}/cni/net.d + + install -m 755 ${S}/src/import/cnitool/cnitool ${D}/${localbindir} + install -m 755 -D ${WORKDIR}/plugins/bin/* ${D}/${localbindir} +} + +FILES_${PN} += "/opt/cni/bin/*" + +INSANE_SKIP_${PN} += "ldflags already-stripped" --2.17.1
--
_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization
Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end - "Use the force Harry" - Gandalf, Star Trek II
Quoted 11 lines · Bruce Ashfield
On Tue, Aug 13, 2019 at 3:52 AM Chen Qi <[email protected] <mailto:[email protected]>> wrote:
This version is proved to work well for simple k8s flannel setup.
Nope. We have no reason to use version locked recipes for this. I want one version for the layer, not a
_gitand a versioned set of plugins.Upgrade the main
_cniplugin to the latest version, make sure it works with kubernetes and that's the version we'll use.
I've replied in another email what problem is with the current version of cni. Hope you can reproduce it on your side.
Apart form this, I have several questions, and I hope to hear your opinion.
1. Docker version with k8s
I've seen warnings from k8s telling me that the current docker
version is not supported/validated upstream. Do you think it's a problem? From what I know, k8s team is not very interested in validating latest docker.
2. Docker upstream
We are currently using moby. There's another recipe called
docker-ce, making use of docker-ce repo. Ubuntu is using docker-ce. I did a little investigation. Moby is actually the community version while docker-ce is maintained by Docker Inc. Do you think we should do something about it? Which one should we prefer? moby or docker-ce?
3. k8s version
The current version is not the latest stable version (1.15.2). I
hope this 1.16 version would come be released stable, but we cannot control it. Do you think we should have a stable version of k8s?
From what I know, OE's policy is using stable version unless there's some compelling reason. All these container/k8s things are being actively developed, and that could be a reason. But should we also have some stable versions? I don't think users would like to use unstable version in their production environment.
Best Regards,
Chen Qi
Quoted 154 lines
Cheers,
Bruce
Signed-off-by: Chen Qi <[email protected] <mailto:[email protected]>> --- recipes-networking/cni/cni_0.7.1.bb <http://cni_0.7.1.bb> | 79 +++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 recipes-networking/cni/cni_0.7.1.bb <http://cni_0.7.1.bb> diff --git a/recipes-networking/cni/cni_0.7.1.bb <http://cni_0.7.1.bb> b/recipes-networking/cni/cni_0.7.1.bb <http://cni_0.7.1.bb> new file mode 100644 index 0000000..7a3b87f --- /dev/null +++ b/recipes-networking/cni/cni_0.7.1.bb <http://cni_0.7.1.bb> @@ -0,0 +1,79 @@ +HOMEPAGE = "https://github.com/containernetworking/cni" +SUMMARY = "Container Network Interface - networking for Linux containers" +DESCRIPTION = "CNI (Container Network Interface), a Cloud Native Computing \ +Foundation project, consists of a specification and libraries for writing \ +plugins to configure network interfaces in Linux containers, along with a \ +number of supported plugins. CNI concerns itself only with network connectivity \ +of containers and removing allocated resources when the container is deleted. \ +Because of this focus, CNI has a wide range of support and the specification \ +is simple to implement. \ +" + +# 0.7.1 +SRCREV_cni = "4cfb7b568922a3c79a23e438dc52fe537fc9687e" +# 0.7.5 +SRCREV_plugins = "a62711a5da7a2dc2eb93eac47e103738ad923fd6" +SRC_URI = "\ + git://github.com/containernetworking/cni.git;branch=master;name=cni <http://github.com/containernetworking/cni.git;branch=master;name=cni> \ + git://github.com/containernetworking/plugins.git;branch=v0.7;destsuffix=plugins;name=plugins <http://github.com/containernetworking/plugins.git;branch=v0.7;destsuffix=plugins;name=plugins> \ + " + +RPROVIDES_${PN} += "kubernetes-cni" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc" + +GO_IMPORT = "import" + +PV = "0.7.1" + +inherit go +inherit goarch + +do_compile() { + # link fixups for compilation + rm -f ${S}/src/import/vendor/src + mkdir -p ${S}/src/import/vendor/ + ln -sf ./ ${S}/src/import/vendor/src + rm -rf ${S}/src/import/plugins + rm -rf ${S}/src/import/vendor/github.com/containernetworking/plugins <http://github.com/containernetworking/plugins> + + mkdir -p ${S}/src/import/vendor/github.com/containernetworking/cni <http://github.com/containernetworking/cni> + + ln -sf ../../../../libcni ${S}/src/import/vendor/github.com/containernetworking/cni/libcni <http://github.com/containernetworking/cni/libcni> + ln -sf ../../../../pkg ${S}/src/import/vendor/github.com/containernetworking/cni/pkg <http://github.com/containernetworking/cni/pkg> + ln -sf ../../../../cnitool ${S}/src/import/vendor/github.com/containernetworking/cni/cnitool <http://github.com/containernetworking/cni/cnitool> + ln -sf ${WORKDIR}/plugins ${S}/src/import/vendor/github.com/containernetworking/plugins <http://github.com/containernetworking/plugins> + + export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go" + export CGO_ENABLED="1" + + cd ${S}/src/import/vendor/github.com/containernetworking/cni/libcni <http://github.com/containernetworking/cni/libcni> + ${GO} build + + cd ${S}/src/import/vendor/github.com/containernetworking/cni/cnitool <http://github.com/containernetworking/cni/cnitool> + ${GO} build + + cd ${S}/src/import/vendor/github.com/containernetworking/plugins/ <http://github.com/containernetworking/plugins/> + PLUGINS="$(ls -d plugins/meta/*; ls -d plugins/ipam/*; ls -d plugins/main/* | grep -v windows)" + mkdir -p ${WORKDIR}/plugins/bin/ + for p in $PLUGINS; do + plugin="$(basename "$p")" + echo "building: $p" + ${GO} build -o ${WORKDIR}/plugins/bin/$plugin github.com/containernetworking/plugins/$p <http://github.com/containernetworking/plugins/$p> + done +} + +do_install() { + localbindir="/opt/cni/bin" + + install -d ${D}${localbindir} + install -d ${D}/${sysconfdir}/cni/net.d + + install -m 755 ${S}/src/import/cnitool/cnitool ${D}/${localbindir} + install -m 755 -D ${WORKDIR}/plugins/bin/* ${D}/${localbindir} +} + +FILES_${PN} += "/opt/cni/bin/*" + +INSANE_SKIP_${PN} += "ldflags already-stripped" -- 2.17.1 -- _______________________________________________ meta-virtualization mailing list [email protected] <mailto:[email protected]> https://lists.yoctoproject.org/listinfo/meta-virtualizationSignature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end - "Use the force Harry" - Gandalf, Star Trek II
Quoted 15 lines · ChenQi
On 08/13/2019 08:31 PM, Bruce Ashfield wrote:
Quoted 3 lines · Chen Qi
This version is proved to work well for simple k8s flannel setup.
Nope. We have no reason to use version locked recipes for this. I want one version for the layer, not a
_gitand a versioned set of plugins.Upgrade the main
_cniplugin to the latest version, make sure it works with kubernetes and that's the version we'll use.
Quoted 6 lines
I've replied in another email what problem is with the current version of cni. Hope you can reproduce it on your side.
Apart form this, I have several questions, and I hope to hear your opinion.
1. Docker version with k8s
I've seen warnings from k8s telling me that the current docker version is not supported/validated upstream. Do you think it's a problem? From what I know, k8s team is not very interested in validating latest docker.
I've never had any issues with using the latest Docker and k8s. Since there's much more to the container world than kubernetes, it can't dictate our version of docker. I'm also not willing to create frozen versions for all of the projects that may have not tested/validated with a particular version of docker. The frozen versions are a maintenance nightmare, they'll bitrot and become security issues.
Our integration and testing with meta-virt is where we make sure that our latest Docker version meets the needs of the projects, so we don't need the upstream's project to validate our version. We are like any other OS in that sense.
Quoted 4 lines
2. Docker upstream
We are currently using moby. There's another recipe called docker-ce, making use of docker-ce repo. Ubuntu is using docker-ce. I did a little investigation. Moby is actually the community version while docker-ce is maintained by Docker Inc. Do you think we should do something about it? Which one should we prefer? moby or docker-ce?
moby is the default, but I've always maintained a docker-ce recipe for people that really want to follow that "docker the company" is pushing out as a stamped version. But that curated version isn't truly the upstream project. We don't want to follow what the corporation blesses, we want the community version for a small/tight/new integratino. We are consuming the bits directly via moby, and hence can control exactly what we need.
For distros that want docker-ce, they can use the recipe in their package lists that they need.
I logged this in the docker recipe itself:
# - This could be called "docker-moby" or just "moby" in the future, but
# that would require the creation of a virtual/docker dependency, which # is possible, but overkill at the moment (while we wait for the upstream # to stop changing).
I likely won't make that change for the fall release, but was planning on doing it for the spring.
Quoted 4 lines
3. k8s version
The current version is not the latest stable version (1.15.2). I hope this 1.16 version would come be released stable, but we cannot control it. Do you think we should have a stable version of k8s?
With the rate of change of kubernetes and the small support window of meta-virt, following a stable doesn't make sense at this point. Tracking the tip/latest is what we do. Just like we do with the reference kernels. If there are every truly LTS kubernetes releases, it could be reconsidered, but keeping more than one version around is a version/maintenance issue. So going with the latest and greatest is the best bet.
Quoted 3 lines
From what I know, OE's policy is using stable version unless there's some compelling reason. All these container/k8s things are being actively developed, and that could be a reason. But should we also have some stable versions? I don't think users would like to use unstable version in their production environment.
The definition of stable varies per project. There's nothing particularly stable about any given release, so putting cycles into an older version and claiming it is stable is a false sense of security for anyone using it.
Bruce
Quoted 117 lines
Best Regards,
Chen QiCheers,
Bruce
Quoted 95 lines
Signed-off-by Chen Qi <[email protected]>--- recipes-networking/cni/cni_0.7.1.bb | 79 +++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 recipes-networking/cni/cni_0.7.1.bbrecipes-networking/cni/cni_0.7.1.bb new file +79
-1@@ -0,0 +1,79 @@ +HOMEPAGE = "https://github.com/containernetworking/cni" +SUMMARY = "Container Network Interface - networking for Linux containers" +DESCRIPTION = "CNI (Container Network Interface), a Cloud Native Computing \ +Foundation project, consists of a specification and libraries for writing \ +plugins to configure network interfaces in Linux containers, along with a \ +number of supported plugins. CNI concerns itself only with network connectivity \ +of containers and removing allocated resources when the container is deleted. \ +Because of this focus, CNI has a wide range of support and the specification \ +is simple to implement. \ +" + +# 0.7.1 +SRCREV_cni = "4cfb7b568922a3c79a23e438dc52fe537fc9687e" +# 0.7.5 +SRCREV_plugins = "a62711a5da7a2dc2eb93eac47e103738ad923fd6" +SRC_URI = "\ + git://github.com/containernetworking/cni.git;branch=master;name=cni \ + git://github.com/containernetworking/plugins.git;branch=v0.7;destsuffix=plugins;name=plugins \ + " + +RPROVIDES_${PN} += "kubernetes-cni" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc" + +GO_IMPORT = "import" + +PV = "0.7.1" + +inherit go +inherit goarch + +do_compile() { + # link fixups for compilation + rm -f ${S}/src/import/vendor/src + mkdir -p ${S}/src/import/vendor/ + ln -sf ./ ${S}/src/import/vendor/src + rm -rf ${S}/src/import/plugins + rm -rf ${S}/src/import/vendor/github.com/containernetworking/plugins + + mkdir -p ${S}/src/import/vendor/github.com/containernetworking/cni + + ln -sf ../../../../libcni ${S}/src/import/vendor/github.com/containernetworking/cni/libcni + ln -sf ../../../../pkg ${S}/src/import/vendor/github.com/containernetworking/cni/pkg + ln -sf ../../../../cnitool ${S}/src/import/vendor/github.com/containernetworking/cni/cnitool + ln -sf ${WORKDIR}/plugins ${S}/src/import/vendor/github.com/containernetworking/plugins + + export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go" + export CGO_ENABLED="1" + + cd ${S}/src/import/vendor/github.com/containernetworking/cni/libcni + ${GO} build + + cd ${S}/src/import/vendor/github.com/containernetworking/cni/cnitool + ${GO} build + + cd ${S}/src/import/vendor/github.com/containernetworking/plugins/ + PLUGINS="$(ls -d plugins/meta/*; ls -d plugins/ipam/*; ls -d plugins/main/* | grep -v windows)" + mkdir -p ${WORKDIR}/plugins/bin/ + for p in $PLUGINS; do + plugin="$(basename "$p")" + echo "building: $p" + ${GO} build -o ${WORKDIR}/plugins/bin/$plugin github.com/containernetworking/plugins/$p + done +} + +do_install() { + localbindir="/opt/cni/bin" + + install -d ${D}${localbindir} + install -d ${D}/${sysconfdir}/cni/net.d + + install -m 755 ${S}/src/import/cnitool/cnitool ${D}/${localbindir} + install -m 755 -D ${WORKDIR}/plugins/bin/* ${D}/${localbindir} +} + +FILES_${PN} += "/opt/cni/bin/*" + +INSANE_SKIP_${PN} += "ldflags already-stripped" --2.17.1
Quoted 5 lines
--
_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end - "Use the force Harry" - Gandalf, Star Trek II