Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
143 lines (123 sloc) 4.86 KB
name: sonic-lool
version: 2017-01+git
summary: Software for Open Networking in the Cloud (SONiC)
description: |
SONiC is an open source project for network routers and switches.
grade: devel
confinement: devmode
apps:
id-switch:
command: id-switch
redis-server:
command: redis-launcher
daemon: simple
redis-cli:
command: redis-cli-launcher
swss:
command: swss-launcher
daemon: forking
swssconfig:
command: swssconfig-launcher
p4-switch:
command: p4-switch-launcher
hooks:
configure:
# doesn't actually need network, but the store rejects plugs: [] and
# snapcraft wont take anything else
plugs: [network]
parts:
common-debs:
plugin: nil
# deps of get-debs helper
build-packages: [httpie, jq, wget]
# dep of redis
stage-packages: [libjemalloc1]
install: |
# TODO this should be a plugin; currently doesn't fail on missing debs
# and doesn't resolve dependencies
# download debs from SONiC's jenkins
wget `./get-debs "common/job/hiredis-build" "libhiredis0\\.13"`
wget `./get-debs "common/job/sonic-swss-common-build" "libswsscommon"`
wget `./get-debs \
"common/job/libnl3" "libnl(|-genl|-cli|-route|-nf)-3-200"`
wget `./get-debs "common/job/redis-build" "(redis-server|redis-tools)"`
# unpack all debs
for d in *.deb; do dpkg -x $d $SNAPCRAFT_PART_INSTALL; done
# comment out redis config entries we want to override
sed -ri -e '/^(daemonize|dir|logfile|port|unixsocket) /s/^/#/' \
$SNAPCRAFT_PART_INSTALL/etc/redis/redis.conf
stage:
- etc/redis/redis.conf
- lib/*/*.so.*
- usr/bin/*
- usr/bin/redis-*
- usr/lib/*.so.*
- usr/lib/*/*.so.*
# common code, wrappers, configure hook etc.
common:
plugin: dump
source: common
broadcom-backend:
plugin: nil
# deps of get-debs helper
build-packages: [httpie, jq, wget]
install: |
# TODO this should be a plugin; currently doesn't fail on missing debs
# and doesn't resolve dependencies
job="broadcom/job/buildimage-brcm-all"
debs_re="(swss|syncd|libsaibcm|libsaimetadata|libsairedis|libteam5|libopennsl|python-sonic-config-engine)"
wget `./get-debs "$job" "$debs_re"`
for d in *.deb; do dpkg -x $d $SNAPCRAFT_PART_INSTALL/broadcom; done
# see https://github.com/Azure/SONiC/issues/52
ln -s libsai.so.1.0 $SNAPCRAFT_PART_INSTALL/broadcom/usr/lib/libsai.so.1
# see https://github.com/Azure/SONiC/issues/51
sed -i 's#/var/run/redis/redis\.sock#link-to-redis-socket.sock#g' \
$SNAPCRAFT_PART_INSTALL/broadcom/usr/bin/* \
$SNAPCRAFT_PART_INSTALL/broadcom/usr/lib/*/*.so.*
# replace absolute /etc/bcm/foo pathnames with relative ones e.g.
# bcm-configs/foo
sed -i '/^SAI_INIT_CONFIG_FILE=/s#=/etc/bcm/#=bcm-configs/#' \
$SNAPCRAFT_PART_INSTALL/broadcom/etc/syncd.d/*
stage:
- broadcom/etc/bcm/*
- broadcom/etc/syncd.d/*
- broadcom/etc/swss/*
- broadcom/lib/*/*.so.*
- broadcom/usr/lib/*.so.*
- broadcom/usr/lib/*/*.so.*
- broadcom/usr/bin/*
- broadcom/usr/share/sonic
p4-backend:
plugin: nil
# deps of get-debs helper
build-packages: [httpie, jq, wget]
# deps of syncd
stage-packages: [libjudydebian1, libnanomsg0]
install: |
# TODO this should be a plugin; currently doesn't fail on missing debs
# and doesn't resolve dependencies
wget `./get-debs "p4/job/p4c-bm" "python-p4c-bm"`
wget `./get-debs "p4/job/p4-bmv2" "p4-bmv2"`
wget `./get-debs "p4/job/p4-hlir" "python-p4-hlir"`
wget `./get-debs "p4/job/tenjin" "python-tenjin"`
wget `./get-debs "p4/job/sonic-sairedis-build" "(libsaimetadata|libsairedis|libsaivs|syncd)"`
wget `./get-debs "p4/job/p4-switch" "p4-switch"`
wget `./get-debs "p4/job/sonic-swss-build" "swss"`
# this comes from a common job, so might have to go into common-debs
wget `./get-debs "common/job/thrift-build" "libthrift-0.9.3"`
# Ubuntu doesn't have the same SONAMEs for libboost
for deb in main/b/boost1.55/libboost-program-options1.55.0_1.55.0+dfsg-3_amd64.deb main/b/boost1.55/libboost-thread1.55.0_1.55.0+dfsg-3_amd64.deb main/b/boost1.55/libboost-system1.55.0_1.55.0+dfsg-3_amd64.deb; do
wget "http://ftp.debian.org/debian/pool/$deb"
done
for d in *.deb; do dpkg -x $d $SNAPCRAFT_PART_INSTALL/p4; done
# see https://github.com/Azure/SONiC/issues/51
sed -i 's#/var/run/redis/redis\.sock#link-to-redis-socket.sock#g' \
$SNAPCRAFT_PART_INSTALL/p4/usr/bin/* \
$SNAPCRAFT_PART_INSTALL/p4/usr/lib/*/*.so.*
organize:
p4/usr/lib/*/bmpd/switch/*.so.*: p4/usr/lib
# TODO stage a subset of all files; drop headers, *.a etc.
# this is needed by the P4 backend
python2:
plugin: python
python-version: python2