Skip to content

Commit 5335180

Browse files
authored
Merge pull request #1 from vthapar/genius
Add support for other projects
2 parents 6e407b6 + 5fc7379 commit 5335180

File tree

7 files changed

+43
-10
lines changed

7 files changed

+43
-10
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
mounts/

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
FROM fedora:latest
22
RUN yum install -y java-1.8.0-openjdk-devel iproute iputils procps-ng tcpdump vim
3-
RUN mkdir -p /netvirt/karaf/target/assembly
3+
RUN mkdir -p /odlha/karaf/target/assembly

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ can easily be inspected. Each container's files are stored `./mounts/[1|2|3]/ass
1212

1313
Three running (and empty) netvirt containers have been observed to occupy about 1.3GB of memory each.
1414

15+
Currently following projects are supported:
16+
1. Netvirt
17+
2. Genius
18+
3. OVSDB Southbound
19+
4. HWVTEP Southbound
20+
5. Neutron
1521

1622
## What scripts are provided
1723

@@ -63,13 +69,14 @@ The containers are networked together like this:
6369

6470
1. You must have docker installed
6571
2. pull the fedora image, `docker pull fedora:latest`
66-
3. You must have netvirt cloned and netvirt/karaf fully built (but not run)
72+
3. You must have your project cloned and project/karaf fully built (but not run)
6773

6874
Note that all scripts must be run from the root directory of this project (where this README file is).
6975

7076
### Creating the containers
7177

72-
1. Build the overlay mounts and docker image: `./build <path to your netvirt clone>`.
78+
1. Build the overlay mounts and docker image: `./build <path to your project clone>`. For OVSDB Southbound or HWVTEP
79+
the path should be '<path to ovsdb clone>/southbound|hwvtepsouthbound'.
7380

7481
N.B. that running this script will remove and erase any mount directories from previous runs. If you want to save logs, copy them aside.
7582

@@ -92,6 +99,8 @@ Then wait for diagstatus to be ACTIVE (this can take a while):
9299

93100
`./diagstatus 2`
94101

102+
N.B. that OVSDB projects currently don't support diagstatus, so you will have to check for OVSDB port [6640].
103+
95104
Only then should you
96105

97106
`./start 3`

build

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,26 @@ then
55
echo Usage: ./build \<path to netvirt\>
66
exit 2
77
fi
8+
targetpath=${path}/karaf/target
9+
feature="odl-netvirt-openstack"
10+
if [[ $1 = *"hwvtepsouthbound"* ]];
11+
then
12+
targetpath="$1/hwvtepsouthbound-karaf/target"
13+
feature="odl-hwvtepsouthbound-rest"
14+
elif [[ $1 = *"southbound"* ]];
15+
then
16+
targetpath="$1/southbound-karaf/target"
17+
feature="odl-southbound-rest"
18+
elif [[ $1 = *"genius"* ]];
19+
then
20+
feature="odl-genius-rest"
21+
elif [[ $1 = *"neutron"* ]];
22+
then
23+
feature="odl-neutron-service"
24+
fi
825

9-
wget -O ${path}/karaf/target/assembly/bin/configure_cluster.sh https://raw.githubusercontent.com/opendaylight/integration-distribution/master/karaf/src/main/assembly/bin/configure_cluster.sh
10-
chmod +x ${path}/karaf/target/assembly/bin/configure_cluster.sh
26+
wget -O ${targetpath}/assembly/bin/configure_cluster.sh https://raw.githubusercontent.com/opendaylight/integration-distribution/master/karaf/src/main/assembly/bin/configure_cluster.sh
27+
chmod +x ${targetpath}/assembly/bin/configure_cluster.sh
1128

1229
for i in 1 2 3
1330
do
@@ -19,9 +36,9 @@ do
1936
mkdir -p ${base}/assembly
2037
mkdir -p ${base}/workdir
2138
mkdir -p ${base}/upper
22-
sudo mount -t overlay overlay -o lowerdir=${path}/karaf/target/assembly,upperdir=${base}/upper,workdir=${base}/workdir ${base}/assembly
39+
sudo mount -t overlay overlay -o lowerdir=${targetpath}/assembly,upperdir=${base}/upper,workdir=${base}/workdir ${base}/assembly
2340

24-
sed -i -e 's/\(featuresBoot =.*\)/\1,odl-netvirt-openstack/' ${base}/assembly/etc/org.apache.karaf.features.cfg
41+
sed -i -e "s/\(featuresBoot =.*\)/\1,${feature}/" ${base}/assembly/etc/org.apache.karaf.features.cfg
2542
done
2643

2744
sudo docker build . -t odl

diagstatus

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1+
set +x
2+
if [ "$1" = "" ];
3+
then
4+
echo "Usage: ./diagstatus 1|2|3"
5+
exit 2
6+
fi
17
curl -u admin:admin http://172.28.5.$1:8181/diagstatus

start

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ set +x
33
for i in ${@:-1 2 3}
44
do
55
echo Starting $i...
6-
sudo docker exec -td odl_172.28.5.$i /netvirt/karaf/target/assembly/bin/karaf
6+
sudo docker exec -td odl_172.28.5.$i /odlha/karaf/target/assembly/bin/karaf
77
sleep 5
88
done

up

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ function launch_container()
77
sudo docker run --name odl_${ip} -d -ti \
88
--cap-add NET_ADMIN \
99
--network=${network} --ip=${ip} \
10-
-v $(pwd)/mounts/${index}/assembly:/netvirt/karaf/target/assembly \
10+
-v $(pwd)/mounts/${index}/assembly:/odlha/karaf/target/assembly \
1111
odl bash
1212
sudo docker exec odl_${ip} \
13-
/netvirt/karaf/target/assembly/bin/configure_cluster.sh $index 172.28.5.1 172.28.5.2 172.28.5.3
13+
/odlha/karaf/target/assembly/bin/configure_cluster.sh $index 172.28.5.1 172.28.5.2 172.28.5.3
1414
}
1515

1616
set -x

0 commit comments

Comments
 (0)