Commit 06a2c5e7 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

component/re6stnet: add pim-dm multicast routing daemon

pim-dm is a python3 only egg and re6st is a python2 only egg.

Deploy pim-dm egg inside a totally separated buildout in python3. 

See merge request nexedi/slapos!1161
parents e9540d8c 3010d872
[buildout]
extends =
../bison/buildout.cfg
../flex/buildout.cfg
[libpcap]
recipe = slapos.recipe.cmmi
shared = true
url = https://www.tcpdump.org/release/libpcap-1.10.1.tar.gz
md5sum = 28e17495004036567c2cc884b51eba45
environment =
PATH=${bison:location}/bin:${flex:location}/bin:%(PATH)s
[buildout]
extends =
../libpcap/buildout.cfg
../python-PyYAML/buildout.cfg
parts =
eggs
[python-pim-dm]
recipe = zc.recipe.egg:custom
egg = pim-dm
include-dirs =
${libpcap:location}/include
library-dirs =
${libpcap:location}/lib
rpath =
${libpcap:location}/lib/
[eggs]
recipe = zc.recipe.egg
eggs =
igmp
ipaddress
netifaces
${python-pim-dm:egg}
prettytable
py-mld
pyroute2
${python-PyYAML:egg}
......@@ -5,6 +5,8 @@ extends =
../geoip2/buildout.cfg
../openvpn/buildout.cfg
../python-cryptography/buildout.cfg
../python-PyYAML/buildout.cfg
../python-pim-dm/buildout.cfg
parts =
re6stnet
......@@ -18,6 +20,7 @@ eggs =
${maxminddb-python:egg}
${python-cffi:egg}
${python-cryptography:egg}
${python-PyYAML:egg}
pyOpenSSL
re6stnet[geoip]
......@@ -26,4 +29,54 @@ eggs =
initialization =
import os
os.environ['GEOIP2_MMDB'] = "${geolite2-country:location}/GeoLite2-Country.mmdb"
os.environ['PATH'] = "${openvpn:location}/sbin:${babeld:location}/bin:${openssl:location}/bin:${python:location}/bin:" + os.environ.get('PATH', '/usr/sbin:/usr/bin:/sbin:/bin')
os.environ['PATH'] = "${openvpn:location}/sbin:${babeld:location}/bin:${openssl:location}/bin:${python:location}/bin:${pim-dm-buildout:location}/bin:" + os.environ.get('PATH', '/usr/sbin:/usr/bin:/sbin:/bin')
[pim-dm-buildout]
recipe = slapos.recipe.build
base = ${:_profile_base_location_}
python = ${python3:executable}
install =
import os
from zc.buildout.buildout import _isurl, urljoin
from slapos.rebootstrap.bootstrap import setup_script
base = options['base']
if _isurl(base):
extends = lambda path: urljoin(base + '/', path)
else:
extends = lambda path: os.path.realpath(os.path.join(base, path))
buildout_extra = []
buildout_section = self.buildout['buildout']
for option_name in ('download-cache', 'newest', 'shared-part-list'):
option_value = buildout_section.get(option_name)
if option_value:
buildout_extra.append('%s = %s' % (option_name, option_value))
os.mkdir(location)
with open(os.path.join(location, 'buildout.cfg'), 'w') as buildout_conf:
buildout_conf.write(
options['template'] % {
'extends': '\n '.join(map(extends, (
'../../stack/slapos.cfg',
'../python-pim-dm/buildout.cfg',
))),
'buildout': '\n'.join(buildout_extra),
}
)
buildout = os.path.join(location, 'bin', 'buildout')
os.mkdir(os.path.dirname(buildout))
setup_script(buildout, options['python'])
call((buildout, '-U'), cwd=location)
template =
[buildout]
extends = %(extends)s
extends-cache = ${buildout:extends-cache}
extensions -= slapos.rebootstrap
%(buildout)s
[libpcap]
recipe =
location = ${libpcap:location}
environment =
[libyaml]
recipe =
location = ${libyaml:location}
pre-configure =
......@@ -163,6 +163,7 @@ gevent = 20.9.0
geventmp = 0.0.1
greenlet = 0.4.17
idna = 2.9
igmp = 1.0.4
importlib-metadata = 1.7.0:whl
inotify-simple = 1.1.1
itsdangerous = 0.24
......@@ -174,6 +175,7 @@ more-itertools = 5.0.0
netaddr = 0.7.19
pathlib2 = 2.3.5
pbr = 2.0.0
pim-dm = 1.4.0nxd001
plone.recipe.command = 1.1
prettytable = 0.7.2
psutil = 5.8.0
......@@ -181,6 +183,8 @@ pluggy = 0.13.1:whl
py = 1.9.0:whl
pyOpenSSL = 19.1.0
pyparsing = 2.2.0
py-mld = 1.0.3
pyroute2 = 0.6.9
pytz = 2016.10
regex = 2020.9.27
requests = 2.27.1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment