From 2efea1a12076d2ca11dedfd932fdfc0893e1d288 Mon Sep 17 00:00:00 2001 From: Kuralamudhan Ramakrishnan Date: Wed, 16 Sep 2020 15:14:13 -0700 Subject: adding centos 8 dockerfile for ovn & ovn4k8s-nfv images Signed-off-by: Kuralamudhan Ramakrishnan Change-Id: Ib161ea39fc6da9a7649142271a781b3140068d15 --- utilities/docker/centos/Dockerfile | 29 ++++++ utilities/docker/debian/ovn4nfv-k8s.sh | 158 ------------------------------- utilities/docker/ovn4nfv-k8s.sh | 167 +++++++++++++++++++++++++++++++++ 3 files changed, 196 insertions(+), 158 deletions(-) create mode 100644 utilities/docker/centos/Dockerfile delete mode 100755 utilities/docker/debian/ovn4nfv-k8s.sh create mode 100755 utilities/docker/ovn4nfv-k8s.sh (limited to 'utilities') 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/debian/ovn4nfv-k8s.sh deleted file mode 100755 index ee60e2b..0000000 --- a/utilities/docker/debian/ovn4nfv-k8s.sh +++ /dev/null @@ -1,158 +0,0 @@ -#!/usr/bin/env bash -OVS_RUNDIR=/var/run/openvswitch -OVS_LOGDIR=/var/log/openvswitch - -DB_NB_ADDR=${DB_NB_ADDR:-::} -DB_NB_PORT=${DB_NB_PORT:-6641} -DB_SB_ADDR=${DB_SB_ADDR:-::} -DB_SB_PORT=${DB_SB_PORT:-6642} -cmd=${1:-""} - -if [[ -f /usr/bin/ovn-appctl ]] ; then - # ovn-appctl is present. Use new ovn run dir path. - OVN_RUNDIR=/var/run/ovn - OVNCTL_PATH=/usr/share/ovn/scripts/ovn-ctl - OVN_LOGDIR=/var/log/ovn - OVN_ETCDIR=/etc/ovn -else - # ovn-appctl is not present. Use openvswitch run dir path. - OVN_RUNDIR=/var/run/openvswitch - OVNCTL_PATH=/usr/share/openvswitch/scripts/ovn-ctl - OVN_LOGDIR=/var/log/openvswitch - OVN_ETCDIR=/etc/openvswitch -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 -} - -check_ovn_controller() { - /usr/share/ovn/scripts/ovn-ctl status_controller -} - -# wait for ovn-sb ready -wait_ovn_sb() { - if [[ -z "${OVN_SB_TCP_SERVICE_HOST}" ]]; then - echo "env OVN_SB_SERVICE_HOST not exists" - exit 1 - fi - if [[ -z "${OVN_SB_TCP_SERVICE_PORT}" ]]; then - echo "env OVN_SB_SERVICE_PORT not exists" - exit 1 - fi - while ! nc -z "${OVN_SB_TCP_SERVICE_HOST}" "${OVN_SB_TCP_SERVICE_PORT}"