Update sfc103 to docker based version 01/43301/10
authorGuo Ruijing <ruijing.guo@intel.com>
Mon, 8 Aug 2016 00:45:53 +0000 (20:45 -0400)
committerRicardo Diaz Campos <ricardo.diaz.campos@ericsson.com>
Wed, 7 Sep 2016 08:52:55 +0000 (10:52 +0200)
- Additionally the demo can be executed several times without vagrant vm destruction
- Compliant with OVS 2.5.90 NSH patches written by Yi Yang

Change-Id: I13b5561c263b5fc76511adff42010bf51696f572
Signed-off-by: Guo Ruijing <ruijing.guo@intel.com>
Signed-off-by: Ricardo Diaz Campos <ricardo.diaz.campos@ericsson.com>
15 files changed:
sfc-demo/sfc103/Dockerfile [new file with mode: 0644]
sfc-demo/sfc103/Vagrantfile
sfc-demo/sfc103/demo.sh
sfc-demo/sfc103/docker-compose.yml [moved from sfc-demo/sfc103/sfc103-docker/docker-compose.yml with 94% similarity]
sfc-demo/sfc103/run_demo.sh [new file with mode: 0755]
sfc-demo/sfc103/setup_classifier.sh [deleted file]
sfc-demo/sfc103/setup_odl.sh
sfc-demo/sfc103/setup_sf.sh [deleted file]
sfc-demo/sfc103/setup_sff.sh [deleted file]
sfc-demo/sfc103/sfc103-docker/Dockerfile [deleted file]
sfc-demo/sfc103/sfc103-docker/README.md [deleted file]
sfc-demo/sfc103/sfc103-docker/Vagrantfile [deleted file]
sfc-demo/sfc103/sfc103-docker/demo.sh [deleted file]
sfc-demo/sfc103/sfc_ready.sh [deleted file]
sfc-demo/sfc103/start.sh [moved from sfc-demo/sfc103/sfc103-docker/start.sh with 77% similarity]

diff --git a/sfc-demo/sfc103/Dockerfile b/sfc-demo/sfc103/Dockerfile
new file mode 100644 (file)
index 0000000..fd03e8f
--- /dev/null
@@ -0,0 +1,16 @@
+FROM ubuntu:15.10
+
+MAINTAINER ericdia
+
+ENV CONTROLLER=192.168.1.5
+ENV BRIDGE=br-sfc
+
+RUN apt-get update && apt-get install -y git libtool m4 autoconf automake make \
+    libssl-dev libcap-ng-dev python3 python3-pip python-six vlan iptables wget \
+    net-tools init-system-helpers kmod uuid-runtime
+ADD ovs-debs /tmp
+RUN dpkg -i /tmp/openvswitch-common* /tmp/openvswitch-switch*
+ADD ./start.sh /app/
+WORKDIR /
+
+ENTRYPOINT [ "/app/start.sh" ]
index 79ef1723c26f97caaf4866804efb3d7a44f6d469..cfd924f8d75f902bcf9d59eddb89fb6ebc0705a9 100644 (file)
@@ -6,58 +6,18 @@ VAGRANTFILE_API_VERSION = "2"
 
 Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
 
-  config.vm.box = "trusty-server-cloudimg-amd64"
-  config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
-  config.vm.provider :virtualbox do |v|
-    v.customize ["modifyvm", :id, "--memory", 1024]
-    v.customize ["modifyvm", :id, "--cpus", 4]
-  end
+  config.vm.box = "wily-server-cloudimg-amd64"
+  config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/wily/current/wily-server-cloudimg-amd64-vagrant-disk1.box"
+  config.vm.provision "docker"
 
   config.vm.synced_folder "../..", "/sfc"
 
   config.vm.define "odl" do | h |
     h.vm.host_name = "odl"
-    h.vm.network :private_network, ip: "192.168.1.5"
     h.vm.provider :virtualbox do |v|
       v.customize ["modifyvm", :id, "--memory", 4096]
-      v.customize ["modifyvm", :id, "--cpus", 4]
+      v.customize ["modifyvm", :id, "--cpus", 2]
     end
-    h.vm.provision :shell, :inline => "nohup /vagrant/setup_odl.sh > setup_odl.log 2>&1 &", privileged: false
-  end
-
-  config.vm.define "classifier1" do | h |
-    h.vm.host_name = "classifier1"
-    h.vm.network :private_network, ip: "192.168.1.10"
-    h.vm.provision :shell, :inline => "/vagrant/setup_classifier.sh"
-  end
-
-  config.vm.define "classifier2" do | h |
-    h.vm.host_name = "classifier2"
-    h.vm.network :private_network, ip: "192.168.1.60"
-    h.vm.provision :shell, :inline => "/vagrant/setup_classifier.sh"
-  end
-
-  config.vm.define "sff1" do | h |
-    h.vm.host_name = "sff1"
-    h.vm.network :private_network, ip: "192.168.1.20"
-    h.vm.provision :shell, :inline => "/vagrant/setup_sff.sh"
-  end
-
-  config.vm.define "sff2" do | h |
-    h.vm.host_name = "sff2"
-    h.vm.network :private_network, ip: "192.168.1.50"
-    h.vm.provision :shell, :inline => "/vagrant/setup_sff.sh"
-  end
-
-  config.vm.define "sf1" do | h |
-    h.vm.host_name = "sf1"
-    h.vm.network :private_network, ip: "192.168.1.30"
-    h.vm.provision :shell, :inline => "/vagrant/setup_sf.sh"
-  end
-
-  config.vm.define "sf2" do | h |
-    h.vm.host_name = "sf2"
-    h.vm.network :private_network, ip: "192.168.1.40"
-    h.vm.provision :shell, :inline => "/vagrant/setup_sf.sh"
+    h.vm.provision :shell, :inline => "/vagrant/setup_odl.sh", privileged: false
   end
 end
index bb5b16b636a030818d3abbbc7ad0225266b57c89..c974fa22e5c742cb550cc55725b3ac7748917194 100755 (executable)
@@ -1,30 +1,5 @@
 #!/bin/bash
 
-vagrant destroy -f
 vagrant up
-
-inprog=1
-
-while [ $inprog -ne 0 ]
-do
-    true &> /dev/null | vagrant ssh odl -c "cat sfc.prog"
-    inprog=`true &> /dev/null | vagrant ssh odl -c "/vagrant/sfc_ready.sh"`
-    sleep 60
-done
-
-true &> /dev/null | vagrant ssh odl -c "/vagrant/setup_sfc.py"
-
-#wait for openflow effective
-sleep 60
-
-true &> /dev/null | vagrant ssh classifier1  -c "sudo ovs-ofctl dump-flows -OOpenflow13 br-sfc"
-true &> /dev/null | vagrant ssh classifier2  -c "sudo ovs-ofctl dump-flows -OOpenflow13 br-sfc"
-true &> /dev/null | vagrant ssh sff1 -c "sudo ovs-ofctl dump-flows -OOpenflow13 br-sfc"
-true &> /dev/null | vagrant ssh sff2 -c "sudo ovs-ofctl dump-flows -OOpenflow13 br-sfc"
-true &> /dev/null | vagrant ssh classifier1  -c "sudo ip netns exec app wget http://192.168.2.2"
-
-#wait for openflow effective
-sleep 60
-
-true &> /dev/null | vagrant ssh odl -c "/vagrant/update_sfc.py"
-true &> /dev/null | vagrant ssh classifier1  -c "sudo ip netns exec app wget http://192.168.2.2"
+vagrant ssh -c /vagrant/run_demo.sh
+rm -fr ovs-debs
similarity index 94%
rename from sfc-demo/sfc103/sfc103-docker/docker-compose.yml
rename to sfc-demo/sfc103/docker-compose.yml
index eed92a8a3834ae02d08780756d2a2d8848c7f2e6..43f810241efebea2135a20eacd94b2d0d57fdfd4 100644 (file)
@@ -55,8 +55,6 @@ services:
     networks:
       sfc103_mgmt:
         ipv4_address: 192.168.1.20
-    cap_add:
-      - NET_ADMIN
 
   sff2:
     image: sfc-service-node
@@ -70,8 +68,6 @@ services:
     networks:
       sfc103_mgmt:
         ipv4_address: 192.168.1.50
-    cap_add:
-      - NET_ADMIN
 
   sf1:
     image: sfc-service-node
@@ -87,8 +83,6 @@ services:
         ipv4_address: 192.168.1.30
     volumes:
       - "/sfc:/sfc"
-    cap_add:
-      - NET_ADMIN
 
   sf2:
     image: sfc-service-node
@@ -104,8 +98,6 @@ services:
         ipv4_address: 192.168.1.40
     volumes:
       - "/sfc:/sfc"
-    cap_add:
-      - NET_ADMIN
 
 networks:
   sfc103_mgmt:
diff --git a/sfc-demo/sfc103/run_demo.sh b/sfc-demo/sfc103/run_demo.sh
new file mode 100755 (executable)
index 0000000..ba8abd6
--- /dev/null
@@ -0,0 +1,86 @@
+#!/bin/bash
+
+function clean {
+    cd /vagrant; docker-compose down
+    printf "Stopping karaf ...  "
+    spin=('/' '-' '\' '|' '-')
+    i=0
+    while $HOME/sfc/sfc-karaf/target/assembly/bin/client -u karaf 'system:shutdown -f' &> /dev/null
+    do
+        printf "\b${spin[$i]}"
+        i=$(( (( $i + 1 )) % 5 ))
+        # karaf is still running, wait for effective shutdown
+        sleep 5
+    done
+    printf "\bdone\n"
+}
+
+function start_sfc {
+    cd $HOME/sfc/sfc-karaf/target/assembly/
+    sed -i "/^featuresBoot[ ]*=/ s/$/,odl-sfc-provider,odl-sfc-core,odl-sfc-ui,odl-sfc-openflow-renderer,odl-sfc-scf-openflow,odl-sfc-sb-rest,odl-sfc-ovs,odl-sfc-netconf/" etc/org.apache.karaf.features.cfg;
+    echo "log4j.logger.org.opendaylight.sfc = DEBUG,stdout" >> etc/org.ops4j.pax.logging.cfg;
+    rm -rf journal snapshots; bin/start
+    #wait for sfc ready
+    retries=3
+    while [ $retries -gt 0 ]
+    do
+        sleep 60
+        sfcfeatures=$($HOME/sfc/sfc-karaf/target/assembly/bin/client -u karaf 'feature:list -i' 2>&1 | grep odl-sfc | wc -l)
+        if [ $sfcfeatures -eq 9 ]; then
+            break
+        fi
+        $retries = $(( $retries - 1 ))
+    done
+    if [ $retries -eq 0 ]; then
+        echo "Karaf not started. Exit immediately"
+        exit 1
+    fi
+}
+
+function build_docker {
+    cd /vagrant; docker-compose up -d
+}
+
+function start_demo {
+
+    /sfc/sfc-demo/sfc103/setup_sfc.py
+    #wait for openflow effective
+    sleep 60
+
+    docker exec -it classifier1 ovs-ofctl dump-flows -OOpenflow13 br-sfc
+    docker exec -it classifier2 ovs-ofctl dump-flows -OOpenflow13 br-sfc
+    docker exec -it sff1 ovs-ofctl dump-flows -OOpenflow13 br-sfc
+    docker exec -it sff2 ovs-ofctl dump-flows -OOpenflow13 br-sfc
+
+    docker exec -it classifier1 ip netns exec app wget http://192.168.2.2
+
+
+    #dynamic insert & remove sf
+    /sfc/sfc-demo/sfc103/update_sfc.py
+
+    #wait for openflow effective
+    sleep 60
+
+    docker exec -it classifier1 ovs-ofctl dump-flows -OOpenflow13 br-sfc
+    docker exec -it classifier2 ovs-ofctl dump-flows -OOpenflow13 br-sfc
+    docker exec -it sff1 ovs-ofctl dump-flows -OOpenflow13 br-sfc
+    docker exec -it sff2 ovs-ofctl dump-flows -OOpenflow13 br-sfc
+
+    docker exec -it classifier1 ip netns exec app wget http://192.168.2.2
+}
+
+
+echo "SFC DEMO: Clean"
+clean
+
+echo "SFC DEMO: Start SFC"
+start_sfc
+
+echo "SFC DEMO: Build Docker"
+build_docker
+
+echo "SFC DEMO: Give some time to have all things ready"
+sleep 60
+
+echo "SFC DEMO: Start Demo"
+start_demo
diff --git a/sfc-demo/sfc103/setup_classifier.sh b/sfc-demo/sfc103/setup_classifier.sh
deleted file mode 100755 (executable)
index 020b71f..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/bash
-
-set -eux
-
-apt-get update -y
-apt-get install git -y
-curl https://raw.githubusercontent.com/yyang13/ovs_nsh_patches/master/start-ovs-deb.sh | bash
-
-ovs-vsctl set-manager tcp:192.168.1.5:6640
-
-ovs-vsctl add-br br-sfc
-ip netns add app
-ip link add veth-app type veth peer name veth-br
-ovs-vsctl add-port br-sfc veth-br
-ip link set dev veth-br up
-ip link set veth-app netns app
-host=`hostname`
-if [ $host  == 'classifier1'  ] ; then
-    ip netns exec app ifconfig veth-app 192.168.2.1/24 up
-    ip netns exec app ip link set dev veth-app  addr 00:00:11:11:11:11
-    ip netns exec app arp -s 192.168.2.2 00:00:22:22:22:22 -i veth-app
-    ip netns exec app ip link set dev veth-app up
-    ip netns exec app ip link set dev lo up
-    ip netns exec app ifconfig veth-app mtu 1400
-else
-    ip netns exec app ifconfig veth-app 192.168.2.2/24 up
-    ip netns exec app ip link set dev veth-app  addr 00:00:22:22:22:22
-    ip netns exec app arp -s 192.168.2.1 00:00:11:11:11:11 -i veth-app
-    ip netns exec app ip link set dev veth-app up
-    ip netns exec app ip link set dev lo up
-    ip netns exec app ifconfig veth-app mtu 1400
-    nohup ip netns exec app python -m SimpleHTTPServer 80 > /home/vagrant/http_server.log 2>&1  &
-fi
-ovs-vsctl show
index 8689871cddaf29c5c6cb2d302c8ec99d5622e476..a962687a76a304d55872d65cc0597283e4517860 100755 (executable)
@@ -3,8 +3,9 @@
 # setup sfc from pre-build. If DIST_URL is null, build sfc from scratch
 DIST_URL=https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/org/opendaylight/integration/distribution-karaf/0.5.0-SNAPSHOT/
 
-
 function install_packages {
+    sudo apt-get install npm vim git git-review diffstat bridge-utils -y
+
     #install java8
     echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections
     sudo add-apt-repository ppa:webupd8team/java -y
@@ -24,7 +25,29 @@ export M2_HOME=/usr/local/apache-maven/apache-maven-3.3.9
 export MAVEN_OPTS="-Xms256m -Xmx512m" # Very important to put the "m" on the end
 export JAVA_HOME=/usr/lib/jvm/java-8-oracle # This matches sudo update-alternatives --config java
 EOF
-    sudo apt-get install npm vim git git-review diffstat -y
+
+    # install docker compose
+    sudo apt-get install -y python-pip
+    sudo pip install docker-compose
+}
+
+function install_ovs {
+    # Open vSwitch with VxLAN-GPE and NSH support
+    cd $HOME
+    sudo apt-get install -y git libtool m4 autoconf automake make libssl-dev libcap-ng-dev python3 python-six vlan iptables \
+         graphviz debhelper dh-autoreconf python-all python-qt4 python-twisted-conch
+    git clone https://github.com/openvswitch/ovs.git
+    git clone https://github.com/yyang13/ovs_nsh_patches.git
+    cd ovs
+    git reset --hard 7d433ae57ebb90cd68e8fa948a096f619ac4e2d8
+    cp ../ovs_nsh_patches/*.patch ./
+    git config user.email odl@opendaylight.org
+    git config user.name odl
+    git am *.patch
+    sudo DEB_BUILD_OPTIONS='parallel=8 nocheck' fakeroot debian/rules binary
+    sudo dpkg -i $HOME/openvswitch-datapath-dkms* $HOME/openvswitch-common* $HOME/openvswitch-switch* ../python-openvswitch*
+    mkdir -p /vagrant/ovs-debs
+    cp $HOME/openvswitch-common*.deb $HOME/openvswitch-switch*.deb /vagrant/ovs-debs/
 }
 
 function install_sfc {
@@ -46,18 +69,12 @@ function install_sfc {
     fi
 }
 
-function start_sfc {
-    cd $HOME/sfc/sfc-karaf/target/assembly/
-    sed -i "/^featuresBoot[ ]*=/ s/$/,odl-sfc-provider,odl-sfc-core,odl-sfc-ui,odl-sfc-openflow-renderer,odl-sfc-scf-openflow,odl-sfc-sb-rest,odl-sfc-ovs,odl-sfc-netconf/" etc/org.apache.karaf.features.cfg;
-    echo "log4j.logger.org.opendaylight.sfc = DEBUG,stdout" >> etc/org.ops4j.pax.logging.cfg;
-    rm -rf journal snapshots; bin/karaf clean
-}
 
-echo "SFC DEMO: Packages installation" > $HOME/sfc.prog
+echo "SFC DEMO: Packages installation"
 install_packages
 
-echo "SFC DEMO: SFC installation" > $HOME/sfc.prog
-install_sfc
+echo "SFC DEMO: Open vSwitch installation"
+install_ovs
 
-echo "SFC DEMO: Launch SFC" > $HOME/sfc.prog
-start_sfc
+echo "SFC DEMO: SFC installation"
+install_sfc
diff --git a/sfc-demo/sfc103/setup_sf.sh b/sfc-demo/sfc103/setup_sf.sh
deleted file mode 100755 (executable)
index 1c9bdce..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/bash
-set -eux
-
-apt-get update
-apt-get install -y python3-pip
-rm -rf /home/vagrant/sfc; cp -r /sfc /home/vagrant
-cd /home/vagrant/sfc/sfc-py;
-pip3 install -r requirements.txt
-nohup python3.4 sfc/sfc_agent.py --rest --odl-ip-port 192.168.1.5:8181 &
diff --git a/sfc-demo/sfc103/setup_sff.sh b/sfc-demo/sfc103/setup_sff.sh
deleted file mode 100755 (executable)
index 29ac7aa..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/bash
-set -eux
-
-apt-get update
-apt-get install git -y
-curl https://raw.githubusercontent.com/yyang13/ovs_nsh_patches/master/start-ovs-deb.sh | bash
-ovs-vsctl set-manager tcp:192.168.1.5:6640
-ovs-vsctl add-br br-sfc
-ovs-vsctl show
diff --git a/sfc-demo/sfc103/sfc103-docker/Dockerfile b/sfc-demo/sfc103/sfc103-docker/Dockerfile
deleted file mode 100644 (file)
index 3bd1476..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-FROM ubuntu:14.04
-
-MAINTAINER ericdia
-
-ENV CONTROLLER=192.168.1.5
-ENV BRIDGE=br-sfc
-
-RUN apt-get update && apt-get install -y git libtool m4 autoconf automake make \
-    libssl-dev libcap-ng-dev python3 python3-pip python-six vlan iptables wget
-RUN git clone https://github.com/pritesh/ovs.git -b nsh-v8
-WORKDIR ovs
-RUN ./boot.sh && ./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc
-RUN make && make install
-RUN mkdir -p /etc/openvswitch && \
-    ovsdb-tool create /etc/openvswitch/conf.db vswitchd/vswitch.ovsschema
-RUN cd ..; rm -rf ovs*
-ADD ./start.sh /app/
-WORKDIR /
-
-ENTRYPOINT [ "/app/start.sh" ]
diff --git a/sfc-demo/sfc103/sfc103-docker/README.md b/sfc-demo/sfc103/sfc103-docker/README.md
deleted file mode 100644 (file)
index 2154c74..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-SFC103 Demo with Vagrant + Docker
-=================================
-
-Overview
---------
-
-SFC103 demo performed using just one Vagrant machine with six Docker containers
-inside.
-
-Note
-----
-
-This demo has been tested with Vagrant 1.8.4. It is recommended to use that
-Vagrant version or a newer one.
-
-Setup Demo
-----------
-
-1. vagrant up
-2. vagrant ssh -c /vagrant/demo.sh | tee demo.log
diff --git a/sfc-demo/sfc103/sfc103-docker/Vagrantfile b/sfc-demo/sfc103/sfc103-docker/Vagrantfile
deleted file mode 100644 (file)
index 2e2b1d3..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-# -*- mode: ruby -*-
-# vi: set ft=ruby :
-
-# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
-VAGRANTFILE_API_VERSION = "2"
-
-$bootstrap_ubuntu = <<SCRIPT
-sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
-sudo bash -c 'echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" > /etc/apt/sources.list.d/docker.list'
-sudo apt-get update
-sudo apt-get install linux-image-extra-$(uname -r)
-sudo apt-get install -y docker-engine python-pip
-sudo usermod -aG docker vagrant
-sudo pip install docker-compose
-SCRIPT
-
-$install_ovs = <<SCRIPT
-# From https://raw.githubusercontent.com/priteshk/ovs/nsh-v8/third-party/start-ovs-deb.sh
-sudo apt-get install -y git
-git clone https://github.com/pritesh/ovs.git
-cd ovs
-git checkout nsh-v8
-sudo apt-get install -y build-essential fakeroot debhelper autoconf automake libssl-dev bzip2 openssl graphviz python-all procps python-qt4 python-zopeinterface python-twisted-conch libtool
-DEB_BUILD_OPTIONS='parallel=8 nocheck' fakeroot debian/rules binary
-sudo dpkg --install ../openvswitch-datapath-dkms*
-sudo dpkg --install ../openvswitch-common*
-sudo dpkg --install ../openvswitch-switch*
-SCRIPT
-
-Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
-
-  config.vm.box = "trusty-server-cloudimg-amd64"
-  config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
-
-  config.vm.synced_folder "../../..", "/sfc"
-
-  config.vm.define "odl" do | h |
-    h.vm.host_name = "odl"
-    h.vm.network :private_network, ip: "192.168.99.5"
-    h.vm.provider :virtualbox do |v|
-      v.customize ["modifyvm", :id, "--memory", 8192]
-      v.customize ["modifyvm", :id, "--cpus", 2]
-    end
-    h.vm.provision "bootstrap", type: "shell", inline: $bootstrap_ubuntu
-    h.vm.provision "install_ovs", type: "shell", inline: $install_ovs
-    h.vm.provision :shell, :inline => "nohup /sfc/sfc-demo/sfc103/setup_odl.sh > setup_odl.log 2>&1 &", privileged: false
-  end
-
-end
diff --git a/sfc-demo/sfc103/sfc103-docker/demo.sh b/sfc-demo/sfc103/sfc103-docker/demo.sh
deleted file mode 100755 (executable)
index 833f266..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/bin/bash
-
-cd ${HOME}
-printf "WAITING FOR SFC READY ... "
-inprog=1
-while [ $inprog -ne 0 ]
-do
-    inprog=`true &> /dev/null | /sfc/sfc-demo/sfc103/sfc_ready.sh`
-    sleep 60
-done
-printf "OK\n\n"
-
-cd /vagrant
-printf "START CONTAINTERS DEPLOYMENT\n\n"
-docker-compose up -d
-# wait for docker deployment just in case
-sleep 60
-printf "\nCONTAINTERS DEPLOYMENT DONE\n\n"
-
-cd ${HOME}
-printf "START SETUP SFC\n\n"
-true &> /dev/null | /sfc/sfc-demo/sfc103/setup_sfc.py
-
-#wait for openflow effective
-sleep 60
-printf "\nSETUP SFC DONE\n"
-
-printf "\n\nFLOWS AFTER SFC SETUP AND BEFORE WGET\n"
-printf "\nCLASSIFIER1 FLOWS:\n"
-docker exec -it classifier1 ovs-ofctl dump-flows -OOpenflow13 br-sfc
-printf "\nCLASSIFIER2 FLOWS:\n"
-docker exec -it classifier2 ovs-ofctl dump-flows -OOpenflow13 br-sfc
-printf "\nSFF1 FLOWS:\n"
-docker exec -it sff1 ovs-ofctl dump-flows -OOpenflow13 br-sfc
-printf "\nSFF2 FLOWS:\n"
-docker exec -it sff2 ovs-ofctl dump-flows -OOpenflow13 br-sfc
-
-printf "\n\nWGET AFTER SFC SETUP\n"
-docker exec -it classifier1 ip netns exec app wget http://192.168.2.2
-
-printf "\n\nFLOWS AFTER SFC SETUP AND WGET\n"
-printf "\nCLASSIFIER1 FLOWS:\n"
-docker exec -it classifier1 ovs-ofctl dump-flows -OOpenflow13 br-sfc
-printf "\nCLASSIFIER2 FLOWS:\n"
-docker exec -it classifier2 ovs-ofctl dump-flows -OOpenflow13 br-sfc
-printf "\nSFF1 FLOWS:\n"
-docker exec -it sff1 ovs-ofctl dump-flows -OOpenflow13 br-sfc
-printf "\nSFF2 FLOWS:\n"
-docker exec -it sff2 ovs-ofctl dump-flows -OOpenflow13 br-sfc
-
-printf "\n\nUPDATE SFC\n\n"
-true &> /dev/null | /sfc/sfc-demo/sfc103/update_sfc.py
-
-#wait for openflow effective
-sleep 60
-printf "\nUPDATE SFC DONE\n"
-
-printf "\n\nWGET AFTER SFC UPDATE\n\n"
-docker exec -it classifier1 ip netns exec app wget http://192.168.2.2
-
-printf "\n\nFLOWS AFTER SFC UPDATE AND WGET\n"
-printf "\nCLASSIFIER1 FLOWS:\n"
-docker exec -it classifier1 ovs-ofctl dump-flows -OOpenflow13 br-sfc
-printf "\nCLASSIFIER2 FLOWS:\n"
-docker exec -it classifier2 ovs-ofctl dump-flows -OOpenflow13 br-sfc
-printf "\nSFF1 FLOWS:\n"
-docker exec -it sff1 ovs-ofctl dump-flows -OOpenflow13 br-sfc
-printf "\nSFF2 FLOWS:\n"
-docker exec -it sff2 ovs-ofctl dump-flows -OOpenflow13 br-sfc
diff --git a/sfc-demo/sfc103/sfc_ready.sh b/sfc-demo/sfc103/sfc_ready.sh
deleted file mode 100755 (executable)
index 82cf4c4..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/bash
-
-if [ -f sfc/sfc-karaf/target/assembly/bin/client ]
-then
-    sfc/sfc-karaf/target/assembly/bin/client -u karaf 'feature:list -i' 2>&1 | grep odl-sfc > /dev/null
-    echo $?
-else
-    echo 1
-fi
similarity index 77%
rename from sfc-demo/sfc103/sfc103-docker/start.sh
rename to sfc-demo/sfc103/start.sh
index f7808d5fffa8df8efe0bb19502b48331736e2295..9a3f3e987865a9dceca78bd91071bb9828daf609 100755 (executable)
@@ -3,13 +3,7 @@
 set -eux
 
 function ovs_start {
-    ovsdb-server --remote=punix:/var/run/openvswitch/db.sock \
-                 --remote=db:Open_vSwitch,Open_vSwitch,manager_options \
-                 --private-key=db:Open_vSwitch,SSL,private_key \
-                 --certificate=db:Open_vSwitch,SSL,certificate \
-                 --bootstrap-ca-cert=db:Open_vSwitch,SSL,ca_cert \
-                 --pidfile --detach
-    ovs-vswitchd --pidfile --detach --log-file=/var/log/openvswitch/ovs-vswitchd.log
+    service openvswitch-switch start
     ovs-vsctl set-manager tcp:192.168.1.5:6640
     ovs-vsctl add-br br-sfc
 }