aboutsummaryrefslogtreecommitdiffstats
path: root/utilities
diff options
context:
space:
mode:
authorKuralamudhan Ramakrishnan <kuralamudhan.ramakrishnan@intel.com>2020-09-16 15:14:13 -0700
committerKuralamudhan Ramakrishnan <kuralamudhan.ramakrishnan@intel.com>2020-09-17 17:10:02 -0700
commit2efea1a12076d2ca11dedfd932fdfc0893e1d288 (patch)
tree104197707223e7b4fa95bb38da5d68c092ff6c8f /utilities
parent69b6bceec76caea07f95ba5cc372205c16e0e11b (diff)
adding centos 8 dockerfile for ovn & ovn4k8s-nfv images
Signed-off-by: Kuralamudhan Ramakrishnan <kuralamudhan.ramakrishnan@intel.com> Change-Id: Ib161ea39fc6da9a7649142271a781b3140068d15
Diffstat (limited to 'utilities')
-rw-r--r--utilities/docker/centos/Dockerfile29
-rwxr-xr-xutilities/docker/ovn4nfv-k8s.sh (renamed from utilities/docker/debian/ovn4nfv-k8s.sh)31
2 files changed, 49 insertions, 11 deletions
diff --git a/utilities/docker/centos/Dockerfile b/utilities/docker/centos/Dockerfile
new file mode 100644
index 0000000..7a8f443
--- /dev/null
+++ b/utilities/docker/centos/Dockerfile
@@ -0,0 +1,29 @@
+FROM centos:8 as base
+
+USER root
+RUN yum update -y && yum install -y iproute curl nc ipset iptables jq wget unbound unbound-devel
+
+RUN mkdir -p /opt/ovn4nfv-k8s-plugin/ovs/rpm/rpmbuild/RPMS/x86_64
+RUN bash -xc "\
+pushd /opt/ovn4nfv-k8s-plugin/ovs/rpm/rpmbuild/RPMS/x86_64; \
+wget -q -nv -O- https://api.github.com/repos/akraino-icn/ovs/releases/tags/v2.14.0 2>/dev/null | jq -r '.assets[] | select(.browser_download_url | contains("\""rpm"\"")) | .browser_download_url' | wget -i -; \
+popd; \
+"
+RUN rpm -ivh --nodeps /opt/ovn4nfv-k8s-plugin/ovs/rpm/rpmbuild/RPMS/x86_64/*.rpm
+
+RUN mkdir -p /opt/ovn4nfv-k8s-plugin/ovn/rpm/rpmbuild/RPMS/x86_64
+RUN bash -xc "\
+pushd /opt/ovn4nfv-k8s-plugin/ovn/rpm/rpmbuild/RPMS/x86_64; \
+wget -q -nv -O- https://api.github.com/repos/akraino-icn/ovn/releases/tags/v20.06.0 2>/dev/null | jq -r '.assets[] | select(.browser_download_url | contains("\""rpm"\"")) | .browser_download_url' | wget -i -; \
+popd; \
+"
+RUN rpm -ivh --nodeps /opt/ovn4nfv-k8s-plugin/ovn/rpm/rpmbuild/RPMS/x86_64/*.rpm
+
+RUN mkdir -p /var/run/openvswitch && \
+ mkdir -p /var/run/ovn
+
+WORKDIR /opt/ovn4nfv-k8s-plugin/utilities/docker/
+COPY ./ ./
+RUN cp /opt/ovn4nfv-k8s-plugin/utilities/docker/ovn4nfv-k8s.sh /usr/local/bin/ovn4nfv-k8s
+RUN echo $PATH
+ENTRYPOINT ["ovn4nfv-k8s"]
diff --git a/utilities/docker/debian/ovn4nfv-k8s.sh b/utilities/docker/ovn4nfv-k8s.sh
index ee60e2b..e0795b0 100755
--- a/utilities/docker/debian/ovn4nfv-k8s.sh
+++ b/utilities/docker/ovn4nfv-k8s.sh
@@ -8,6 +8,15 @@ DB_SB_ADDR=${DB_SB_ADDR:-::}
DB_SB_PORT=${DB_SB_PORT:-6642}
cmd=${1:-""}
+ovn-ctl()
+{
+ if [[ -f /usr/bin/ovn-appctl ]] ; then
+ echo /usr/share/ovn/scripts/ovn-ctl;
+ else
+ echo /usr/share/openvswitch/scripts/ovn-ctl;
+ fi
+}
+
if [[ -f /usr/bin/ovn-appctl ]] ; then
# ovn-appctl is present. Use new ovn run dir path.
OVN_RUNDIR=/var/run/ovn
@@ -23,13 +32,13 @@ else
fi
check_ovn_control_plane() {
- /usr/share/ovn/scripts/ovn-ctl status_northd
- /usr/share/ovn/scripts/ovn-ctl status_ovnnb
- /usr/share/ovn/scripts/ovn-ctl status_ovnsb
+ $(ovn-ctl) status_northd
+ $(ovn-ctl) status_ovnnb
+ $(ovn-ctl) status_ovnsb
}
check_ovn_controller() {
- /usr/share/ovn/scripts/ovn-ctl status_controller
+ $(ovn-ctl) status_controller
}
# wait for ovn-sb ready
@@ -53,7 +62,7 @@ start_ovs_vswitch() {
wait_ovn_sb
function quit {
/usr/share/openvswitch/scripts/ovs-ctl stop
- /usr/share/openvswitch/scripts/ovn-ctl stop_controller
+ $(ovn-ctl) stop_controller
exit 0
}
trap quit EXIT
@@ -88,34 +97,34 @@ function get_default_inteface_ipaddress {
start_ovn_control_plane() {
function quit {
- /usr/share/openvswitch/scripts/ovn-ctl stop_northd
+ $(ovn-ctl) stop_northd
exit 0
}
trap quit EXIT
- /usr/share/openvswitch/scripts/ovn-ctl restart_northd
+ $(ovn-ctl) restart_northd
ovn-nbctl set-connection ptcp:"${DB_NB_PORT}":["${DB_NB_ADDR}"]
ovn-nbctl set Connection . inactivity_probe=0
ovn-sbctl set-connection ptcp:"${DB_SB_PORT}":["${DB_SB_ADDR}"]
ovn-sbctl set Connection . inactivity_probe=0
- tail -f /var/log/openvswitch/ovn-northd.log
+ tail -f ${OVN_LOGDIR}/ovn-northd.log
}
start_ovn_controller() {
function quit {
- /usr/share/openvswitch/scripts/ovn-ctl stop_controller
+ $(ovn-ctl) stop_controller
exit 0
}
trap quit EXIT
wait_ovn_sb
get_default_inteface_ipaddress node_ipv4_address
- /usr/share/openvswitch/scripts/ovn-ctl restart_controller
+ $(ovn-ctl) restart_controller
# Set remote ovn-sb for ovn-controller to connect to
ovs-vsctl set open . external-ids:ovn-remote=tcp:"${OVN_SB_TCP_SERVICE_HOST}":"${OVN_SB_TCP_SERVICE_PORT}"
ovs-vsctl set open . external-ids:ovn-remote-probe-interval=10000
ovs-vsctl set open . external-ids:ovn-openflow-probe-interval=180
ovs-vsctl set open . external-ids:ovn-encap-type=geneve
ovs-vsctl set open . external-ids:ovn-encap-ip=$node_ipv4_address
- tail -f /var/log/openvswitch/ovn-controller.log
+ tail -f ${OVN_LOGDIR}/ovn-controller.log
}
set_nbclt() {