diff options
Diffstat (limited to 'utilities/docker')
-rw-r--r-- | utilities/docker/centos/Dockerfile | 29 | ||||
-rwxr-xr-x | utilities/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() { |