summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhijiang Hu <hu.zhijiang@zte.com.cn>2018-01-05 00:09:54 -0500
committerZhijiang Hu <hu.zhijiang@zte.com.cn>2018-01-05 02:37:24 -0500
commit7592d90de2c84d7db94e04dfa8b27055f7044047 (patch)
tree97013f210b7ea56a739e09f2326c9acab40440c6
parent9da43ddfc09e56b772e4304eef430e56aaf6013e (diff)
Add upstream patches
When we building kolla images in OPNFV jenkins job, we need to clone code directly from openstack/kolla project and patch it with necessary patches needed by OPNFV. This is the first patch focus on ODL and DPDK integration. To use it, please clone openstack/kolla's stable/pike branch first then apply patch by using git apply command. This PS also solved git clone risk found by Anteater by deleting url variable in git clone command. Change-Id: I9d02f0d4919b53fb33233399ed4efd57d27b21a1 Signed-off-by: Zhijiang Hu <hu.zhijiang@zte.com.cn>
-rwxr-xr-xci/kolla-build-vm.sh16
-rw-r--r--ci/kolla_patches/0000-kolla-odl-ovsdpdk.patch88
2 files changed, 95 insertions, 9 deletions
diff --git a/ci/kolla-build-vm.sh b/ci/kolla-build-vm.sh
index 011537ad..48a84894 100755
--- a/ci/kolla-build-vm.sh
+++ b/ci/kolla-build-vm.sh
@@ -13,7 +13,6 @@ set -o errexit
set -o nounset
set -o pipefail
-KOLLA_GIT="https://github.com/huzhijiang/kolla.git"
KOLLA_BRANCH="stable/ocata"
OPNFV_JOB_NAME=
KOLLA_TAG=
@@ -37,7 +36,6 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
usage: `basename $0` [options]
OPTIONS:
- -l Kolla git repo location
-b Kolla git repo branch
-j OPNFV job name
-t Kolla git repo code tag(base version of image)
@@ -45,8 +43,7 @@ OPTIONS:
-w working directroy
Examples:
-sudo `basename $0` -l https://git.openstack.org/openstack/kolla
- -b stable/ocata
+sudo `basename $0` -b stable/ocata
-j daisy-docker-build-euphrates
-t 4.0.2
-e .1
@@ -55,12 +52,9 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
EOF
}
-while getopts "l:b:j:t:e:w:h" OPTION
+while getopts "b:j:t:e:w:h" OPTION
do
case $OPTION in
- l)
- KOLLA_GIT=${OPTARG}
- ;;
b)
KOLLA_BRANCH=${OPTARG}
;;
@@ -259,7 +253,7 @@ function update_kolla_code {
mkdir -p $KOLLA_GIT_DIR
pushd $KOLLA_GIT_DIR
- git clone $KOLLA_GIT
+ git clone https://git.openstack.org/openstack/kolla
pushd $KOLLA_GIT_DIR/kolla
git checkout $KOLLA_BRANCH
@@ -267,6 +261,10 @@ function update_kolla_code {
git checkout $KOLLA_TAG
fi
+ # Apply patches for openstack/kolla project
+ cp $WORKSPACE/ci/kolla_patches/*.patch ./
+ git apply *.patch
+
KOLLA_GIT_VERSION=$(git log -1 --pretty="%H")
tox -e genconfig
KOLLA_IMAGE_VERSION=$(cat $KOLLA_GIT_DIR/kolla/etc/kolla/kolla-build.conf \
diff --git a/ci/kolla_patches/0000-kolla-odl-ovsdpdk.patch b/ci/kolla_patches/0000-kolla-odl-ovsdpdk.patch
new file mode 100644
index 00000000..6504d998
--- /dev/null
+++ b/ci/kolla_patches/0000-kolla-odl-ovsdpdk.patch
@@ -0,0 +1,88 @@
+diff --git a/contrib/template-override/ovs-dpdk.j2 b/contrib/template-override/ovs-dpdk.j2
+index 7dea1b7..2bc6c5e 100644
+--- a/contrib/template-override/ovs-dpdk.j2
++++ b/contrib/template-override/ovs-dpdk.j2
+@@ -46,6 +46,9 @@
+
+ {{ macros.install_packages(ovs_dpdk_packages | customizable("packages")) }}
+
++RUN mkdir -p /lib/modules/$(uname -r)
++RUN ln -s /usr/src/kernels/$(uname -r) /lib/modules/$(uname -r)/build
++
+ ADD plugins-archive /
+ RUN ln -s /plugins/ovsdpdk-plugin-ovs-archive-*/ /ovs \
+ && ln -s /plugins/ovsdpdk-plugin-dpdk-archive-*/ /dpdk
+@@ -64,7 +67,7 @@ WORKDIR "/dpdk/build"
+ "s/CONFIG_RTE_BUILD_SHARED_LIB=.*$/CONFIG_RTE_BUILD_SHARED_LIB=n/"])
+ }}
+
+-RUN make -j $(nproc) EXTRA_CFLAGS='-O2 -fPIC' \
++RUN make -j $(nproc) EXTRA_CFLAGS='-O2 -fPIC -Wno-maybe-uninitialized' \
+ && make install
+ WORKDIR /ovs
+ RUN ./boot.sh \
+diff --git a/docker/base/grafana.repo b/docker/base/grafana.repo
+index dc8d30b..58fee69 100644
+--- a/docker/base/grafana.repo
++++ b/docker/base/grafana.repo
+@@ -2,6 +2,6 @@
+ name=grafana
+ baseurl=https://packagecloud.io/grafana/stable/el/7/$basearch
+ repo_gpgcheck=1
+-enabled=1
++enabled=0
+ gpgcheck=1
+ gpgkey=https://packagecloud.io/gpg.key https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana
+diff --git a/docker/base/opendaylight.repo b/docker/base/opendaylight.repo
+index 8c0c299..a78b119 100644
+--- a/docker/base/opendaylight.repo
++++ b/docker/base/opendaylight.repo
+@@ -1,5 +1,5 @@
+ [opendaylight]
+ name=CentOS CBS OpenDaylight Release Repository
+-baseurl=http://cbs.centos.org/repos/nfv7-opendaylight-6-release/x86_64/os/
++baseurl=http://cbs.centos.org/repos/nfv7-opendaylight-6-candidate/x86_64/os/
+ enabled=1
+ gpgcheck=0
+diff --git a/docker/neutron/neutron-bgp-dragent/Dockerfile.j2 b/docker/neutron/neutron-bgp-dragent/Dockerfile.j2
+deleted file mode 100644
+index a43d3d7..0000000
+--- a/docker/neutron/neutron-bgp-dragent/Dockerfile.j2
++++ /dev/null
+@@ -1,36 +0,0 @@
+-FROM {{ namespace }}/{{ image_prefix }}neutron-base:{{ tag }}
+-LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
+-
+-{% block neutron_bgp_dragent_header %}{% endblock %}
+-
+-{% import "macros.j2" as macros with context %}
+-
+-{% if install_type == 'binary' %}
+- {% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
+-RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
+- && /bin/false
+- {% elif base_distro in ['ubuntu', 'debian'] %}
+- {% set neutron_bgp_dragent_packages = [
+- 'neutron-bgp-dragent'
+- ] %}
+- {% endif %}
+-
+-{{ macros.install_packages(neutron_bgp_dragent_packages | customizable("packages")) }}
+-
+-{% elif install_type == 'source' %}
+-
+-ADD neutron-bgp-dragent-archive /neutron-bgp-dragent-source
+-
+- {% set neutron_bgp_dragent_pip_packages = [
+- '/neutron_dynamic_routing'
+- ] %}
+-
+-RUN ln -s neutron-bgp-dragent-source/* neutron_dynamic_routing \
+- && {{ macros.install_pip(neutron_bgp_dragent_pip_packages | customizable("pip_packages")) }}
+-
+-{% endif %}
+-
+-{% block neutron_bgp_dragent_footer %}{% endblock %}
+-{% block footer %}{% endblock %}
+-
+-USER neutron