Skip to content

Commit 7a8b8eb

Browse files
committed
Merge pull request contiv#192 from shaleman/sdemo
simplify make demo
2 parents 04a2c26 + 2c07cfa commit 7a8b8eb

3 files changed

Lines changed: 16 additions & 21 deletions

File tree

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ host-build:
4141

4242
run-build: deps checks clean
4343
godep go install -v $(TO_BUILD)
44-
cp ./scripts/python/contivctl.py $(GOPATH)/bin/contivctl
4544

4645
build:
4746
make start
@@ -67,7 +66,14 @@ demo-centos:
6766
stop:
6867
CONTIV_NODES=$${CONTIV_NODES:-2} vagrant destroy -f
6968

70-
demo: stop start
69+
demo:
70+
vagrant up
71+
vagrant ssh netplugin-node1 -c 'sudo -i bash -lc "source /etc/profile.d/envvar.sh && cd /opt/gopath/src/github.com/contiv/netplugin && make run-build"'
72+
vagrant ssh netplugin-node1 -c 'nohup bash -lc "sudo /opt/gopath/bin/netplugin -docker-plugin 2>&1> /tmp/netplugin.log &"'
73+
vagrant ssh netplugin-node2 -c 'nohup bash -lc "sudo /opt/gopath/bin/netplugin -docker-plugin 2>&1> /tmp/netplugin.log &"'
74+
sleep 10
75+
vagrant ssh netplugin-node1 -c 'nohup bash -lc "/opt/gopath/bin/netmaster 2>&1> /tmp/netmaster.log &"'
76+
sleep 10
7177

7278
start-dockerdemo:
7379
scripts/dockerhost/start-dockerhosts

README.md

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,21 @@ This will provide you with a minimal experience of uploading the intent and
1919
seeing the netplugin system act on it. It will create a network on your host
2020
that lives behind an OVS bridge and has its own unique interfaces.
2121

22-
#### Step 1: Clone the project:
22+
#### Step 1: Clone the project and bringup the VMs
2323

2424
```
25-
$ export GOPATH=`pwd`
26-
$ mkdir -p src/github.com/contiv
27-
$ cd src/github.com/contiv
2825
$ git clone https://github.com/contiv/netplugin
29-
$ cd netplugin; make build demo ssh
26+
$ cd netplugin; make demo
27+
$ vagrant ssh netplugin-node1
3028
```
3129

32-
#### Step 2: Inside the VM, boot `netmaster` and `netplugin`
30+
#### Step 2: Create a network
3331

3432
```
35-
$ cd /opt/gopath/src/github.com/contiv/netplugin
36-
$ sudo $GOPATH/bin/netmaster &
37-
$ sudo $GOPATH/bin/netplugin -docker-plugin &
33+
$ netctl net create contiv-net --subnet=20.1.1.0/24 --gateway=20.1.1.254 --pkt-tag=200
3834
```
3935

40-
#### Step 3: Create a network
41-
42-
```
43-
$ $GOPATH/bin/netctl net create contiv-net --subnet=20.1.1.0/24 --gateway=20.1.1.254 --pktTag=200
44-
```
45-
46-
#### Step 4: Run your containers and enjoy the networking!
36+
#### Step 3: Run your containers and enjoy the networking!
4737

4838
```
4939
$ docker run -itd --name=web --net=contiv-net ubuntu /bin/bash

Vagrantfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
7575
config.vm.box = "contiv/ubuntu1504-netplugin"
7676
config.vm.box_version = "0.3.1"
7777
end
78-
num_nodes = 1
78+
num_nodes = 2
7979
if ENV['CONTIV_NODES'] && ENV['CONTIV_NODES'] != "" then
8080
num_nodes = ENV['CONTIV_NODES'].to_i
8181
end
@@ -119,10 +119,9 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
119119

120120
# mount the host directories
121121
node.vm.synced_folder "bin", File.join(gopath_folder, "bin")
122-
if ENV["GOPATH"]
122+
if ENV["GOPATH"] && ENV['GOPATH'] != ""
123123
node.vm.synced_folder File.join(ENV["GOPATH"].split(":").first, "src"), File.join(gopath_folder, "src"), rsync: true
124124
else
125-
puts "!!! No GOPATH, mounting netplugin by itself"
126125
node.vm.synced_folder ".", File.join(gopath_folder, "src/github.com/contiv/netplugin"), rsync: true
127126
end
128127

0 commit comments

Comments
 (0)