Skip to content

Commit

Permalink
Add service framework around Calico DHCP agent
Browse files Browse the repository at this point in the history
Change-Id: I094d4dcc17cce23fda34912d410335a6e2821be2
  • Loading branch information
Neil Jerram authored and Neil Jerram committed Feb 9, 2016
1 parent b085fb0 commit 27ea7ca
Show file tree
Hide file tree
Showing 7 changed files with 105 additions and 7 deletions.
1 change: 0 additions & 1 deletion debian/calico-compute.install
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
usr/bin/calico-dhcp-agent usr/bin
1 change: 1 addition & 0 deletions debian/calico-dhcp-agent.install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
usr/bin/calico-dhcp-agent usr/bin
13 changes: 13 additions & 0 deletions debian/calico-dhcp-agent.upstart
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# vim:set ft=upstart ts=2 et:
description "Calico DHCP agent"
author "Neil Jerram <neil@projectcalico.org>"

start on stopped rc RUNLEVEL=[2345]
stop on runlevel [!2345]

limit nofile 32000 32000

respawn
respawn limit 5 10

exec /usr/bin/calico-dhcp-agent --config-file /etc/neutron/neutron.conf
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
networking-calico (1:1.0.1~pre7) trusty; urgency=low

* Add service framework around Calico DHCP agent

-- Neil Jerram <Neil.Jerram@metaswitch.com> Tue, 02 Feb 2016 11:36:24 +0000

networking-calico (1:1.0.1~pre1-6) trusty; urgency=low

* devstack/bootstrap.sh: Don't set SERVICE_HOST
Expand Down
19 changes: 18 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Source: networking-calico
Section: net
Priority: optional
Maintainer: Project Calico Maintainers <maintainers@projectcalico.org>
Maintainer: Neil Jerram <neil@projectcalico.org>
Build-Depends: debhelper (>= 8.0.0), python-all (>= 2.6), python-setuptools, python-pbr
XS-Python-Version: >= 2.6
Standards-Version: 3.9.4
Expand All @@ -10,6 +10,7 @@ Package: calico-compute
Architecture: all
Depends:
bird,
calico-dhcp-agent,
calico-felix,
networking-calico,
neutron-dhcp-agent,
Expand All @@ -27,6 +28,22 @@ Description: Project Calico networking for OpenStack/Neutron.
.
This package provides the pieces needed on a compute node.

Package: calico-dhcp-agent
Architecture: all
Depends:
networking-calico,
${misc:Depends},
${python:Depends}
Description: Project Calico networking for OpenStack/Neutron.
Project Calico is an open source solution for virtual networking in
cloud data centers. It uses IP routing to provide connectivity
between the workloads in a data center that provide or use IP-based
services - whether VMs, containers or bare metal appliances; and
iptables, to impose any desired fine-grained security policy between
those workloads.
.
This package provides the Calico DHCP agent.

Package: calico-control
Architecture: all
Depends:
Expand Down
13 changes: 13 additions & 0 deletions rpm/calico-dhcp-agent.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=Calico DHCP agent
After=syslog.target network.target

[Service]
User=root
ExecStart=/usr/bin/calico-dhcp-agent --config-file /etc/neutron/neutron.conf
KillMode=process
Restart=on-failure
LimitNOFILE=32000

[Install]
WantedBy=multi-user.target
59 changes: 54 additions & 5 deletions rpm/networking-calico.spec
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ Name: networking-calico
Summary: Project Calico networking for OpenStack/Neutron
Epoch: 1
Version: 1.0.1
Release: 0.6.pre1%{?dist}
Release: 0.7.pre7%{?dist}
License: Apache-2
URL: http://docs.openstack.org/developer/networking-calico/
Source0: networking-calico-%{version}.tar.gz
Source45: calico-dhcp-agent.service
BuildArch: noarch


Expand All @@ -24,18 +25,16 @@ those workloads.
Group: Applications/Engineering
Summary: Project Calico networking for OpenStack/Neutron
%if 0%{?el6}
Requires: calico-common, calico-felix, networking-calico, openstack-neutron, iptables, python-argparse
Requires: calico-common, calico-dhcp-agent, calico-felix, networking-calico, openstack-neutron, iptables, python-argparse
%else
Requires: calico-common, calico-felix, networking-calico, openstack-neutron, iptables
Requires: calico-common, calico-dhcp-agent, calico-felix, networking-calico, openstack-neutron, iptables
%endif


%description -n calico-compute
This package provides the pieces needed on a compute node.

%files -n calico-compute
%defattr(-,root,root,-)
/usr/bin/calico-dhcp-agent

%post -n calico-compute
if [ $1 -eq 1 ] ; then
Expand Down Expand Up @@ -74,6 +73,47 @@ if [ $1 -ge 1 ] ; then
fi


%package -n calico-dhcp-agent
Group: Applications/Engineering
Summary: Project Calico networking for OpenStack/Neutron
Requires: calico-common, networking-calico

%description -n calico-dhcp-agent
This package provides the Calico DHCP agent.

%files -n calico-dhcp-agent
%defattr(-,root,root,-)
/usr/bin/calico-dhcp-agent
%{_unitdir}/calico-dhcp-agent.service

%post -n calico-dhcp-agent
%if 0%{?el7}
if [ $1 -eq 1 ] ; then
# Initial installation
/usr/bin/systemctl daemon-reload
/usr/bin/systemctl enable calico-dhcp-agent
/usr/bin/systemctl start calico-dhcp-agent
fi
%endif

%preun -n calico-dhcp-agent
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
%if 0%{?el7}
/usr/bin/systemctl disable calico-dhcp-agent
/usr/bin/systemctl stop calico-dhcp-agent
%endif
fi

%postun -n calico-dhcp-agent
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
%if 0%{?el7}
/usr/bin/systemctl condrestart calico-dhcp-agent >/dev/null 2>&1 || :
%endif
fi


%package -n calico-control
Group: Applications/Engineering
Summary: Project Calico networking for OpenStack/Neutron
Expand Down Expand Up @@ -107,12 +147,21 @@ integration code.
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT

# For EL7, install systemd service files
%if 0%{?el7}
install -d -m 755 %{buildroot}%{_unitdir}
install -p -D -m 755 %{SOURCE45} %{buildroot}%{_unitdir}/calico-dhcp-agent.service
%endif


%clean
rm -rf $RPM_BUILD_ROOT


%changelog
* Tue Feb 02 2016 Neil Jerram <Neil.Jerram@metaswitch.com> 1:1.0.1-0.7.pre7
- Add service framework around Calico DHCP agent

* Thu Jan 21 2016 Neil Jerram <Neil.Jerram@metaswitch.com> 1:1.0.1-0.6.pre1
- devstack/bootstrap.sh: Don't set SERVICE_HOST
- Various leader election improvements
Expand Down

0 comments on commit 27ea7ca

Please sign in to comment.