Skip to content

Commit f5ff0b8

Browse files
author
sangyun-han
committed
Add ovs 2.5.2
1 parent fede885 commit f5ff0b8

File tree

3 files changed

+111
-0
lines changed

3 files changed

+111
-0
lines changed

2.5.2/Dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
FROM socketplane/busybox:latest
2+
MAINTAINER The SocketPlane Team <[email protected]>
3+
ENV OVS_VERSION 2.5.2
4+
ENV SUPERVISOR_STDOUT_VERSION 0.1.1
5+
# Configure supervisord
6+
RUN mkdir -p /var/log/supervisor/
7+
ADD supervisord.conf /etc/
8+
# Install supervisor_stdout
9+
WORKDIR /opt
10+
RUN mkdir -p /var/log/supervisor/
11+
RUN mkdir -p /etc/openvswitch
12+
RUN wget https://pypi.python.org/packages/source/s/supervisor-stdout/supervisor-stdout-$SUPERVISOR_STDOUT_VERSION.tar.gz --no-check-certificate && \
13+
tar -xzvf supervisor-stdout-0.1.1.tar.gz && \
14+
mv supervisor-stdout-$SUPERVISOR_STDOUT_VERSION supervisor-stdout && \
15+
rm supervisor-stdout-0.1.1.tar.gz && \
16+
cd supervisor-stdout && \
17+
python setup.py install -q
18+
# Get Open vSwitch
19+
WORKDIR /
20+
RUN wget https://s3-us-west-2.amazonaws.com/docker-ovs/openvswitch-$OVS_VERSION.tar.gz --no-check-certificate && \
21+
tar -xzvf openvswitch-$OVS_VERSION.tar.gz &&\
22+
mv openvswitch-$OVS_VERSION openvswitch &&\
23+
cp -r openvswitch/* / &&\
24+
rm -r openvswitch &&\
25+
rm openvswitch-$OVS_VERSION.tar.gz
26+
ADD configure-ovs.sh /usr/local/share/openvswitch/
27+
# Create the database
28+
RUN ovsdb-tool create /etc/openvswitch/conf.db /usr/local/share/openvswitch/vswitch.ovsschema
29+
# Put the OVS Python modules on the Python Path
30+
RUN cp -r /usr/local/share/openvswitch/python/ovs /usr/lib/python2.7/site-packages/ovs
31+
CMD ["/usr/bin/supervisord"]

2.5.2/configure-ovs.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/sh
2+
ovs_version=$(ovs-vsctl -V | grep ovs-vsctl | awk '{print $4}')
3+
ovs_db_version=$(ovsdb-tool schema-version /usr/local/share/openvswitch/vswitch.ovsschema)
4+
5+
# give ovsdb-server and vswitchd some space...
6+
sleep 3
7+
# begin configuring
8+
ovs-vsctl --no-wait -- init
9+
ovs-vsctl --no-wait -- set Open_vSwitch . db-version="${ovs_db_version}"
10+
ovs-vsctl --no-wait -- set Open_vSwitch . ovs-version="${ovs_version}"
11+
ovs-vsctl --no-wait -- set Open_vSwitch . system-type="docker-ovs"
12+
ovs-vsctl --no-wait -- set Open_vSwitch . system-version="0.1"
13+
ovs-vsctl --no-wait -- set Open_vSwitch . external-ids:system-id=`cat /proc/sys/kernel/random/uuid`
14+
ovs-vsctl --no-wait -- set-manager ptcp:6640
15+
ovs-appctl -t ovsdb-server ovsdb-server/add-remote db:Open_vSwitch,Open_vSwitch,manager_options
16+

2.5.2/supervisord.conf

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
[unix_http_server]
2+
file = /var/run/supervisor.sock
3+
4+
[inet_http_server]
5+
port = 9001
6+
7+
[supervisord]
8+
nodaemon=true
9+
logfile = /var/log/supervisor/supervisord.log
10+
logfile_maxbytes = 200KB
11+
logfile_backups = 1
12+
pidfile = /var/run/supervisord.pid
13+
childlogdir = /var/log/supervisor
14+
15+
[rpcinterface:supervisor]
16+
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
17+
18+
[supervisorctl]
19+
serverurl = unix:///var/run/supervisor.sock
20+
21+
[program:ovsdb-server]
22+
command=/usr/local/sbin/ovsdb-server /etc/openvswitch/conf.db --remote=punix:/usr/local/var/run/openvswitch/db.sock --remote=ptcp:6640 --pidfile=ovsdb-server.pid
23+
priority=10
24+
startsec=10
25+
stderr_events_enabled=true
26+
stdout_events_enabled=true
27+
28+
[program:ovs-vswitchd]
29+
command=/usr/local/sbin/ovs-vswitchd -v --pidfile
30+
priority=20
31+
startsec=10
32+
stderr_events_enabled=true
33+
stdout_events_enabled=true
34+
35+
[program:ovsdb-server-vtep]
36+
command=/usr/local/sbin/ovsdb-server /etc/openvswitch/conf.db /etc/openvswitch/vtep.db --remote=punix:/var/run/openvswitch/db.sock --pidfile=ovsdb-server.pid
37+
autostart=false
38+
priority=10
39+
startsec=10
40+
stderr_events_enabled=true
41+
stdout_events_enabled=true
42+
43+
[program:ovs-vtep]
44+
command=/usr/local/share/openvswitch/scripts/ovs-vtep --pidfile=/var/run/openvswitch/ovs-vtep.pid br-vtep
45+
autostart=false
46+
priority=30
47+
startsec=10
48+
stderr_events_enabled=true
49+
stdout_events_enabled=true
50+
51+
[program:configure-ovs]
52+
command=/usr/local/share/openvswitch/configure-ovs.sh
53+
priority=30
54+
startsecs=0
55+
exitcodes=0
56+
autorestart=false
57+
stderr_events_enabled=true
58+
stdout_events_enabled=true
59+
60+
[eventlistener:stdout]
61+
command = supervisor_stdout
62+
buffer_size = 100
63+
events = PROCESS_LOG
64+
result_handler = supervisor_stdout:event_handler

0 commit comments

Comments
 (0)