OpenStack in a snap!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1045 lines
27 KiB

  1. name: microstack
  2. version: stein
  3. base: core18
  4. summary: OpenStack on your laptop.
  5. description: |
  6. Microstack gives you an easy way to develop and test OpenStack
  7. workloads on your laptop.
  8. grade: devel
  9. confinement: strict
  10. environment:
  11. LC_ALL: C
  12. PATH: $SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH
  13. OS_PLACEMENT_CONFIG_DIR: $SNAP/etc/nova/
  14. system-usernames:
  15. snap_daemon: shared
  16. layout:
  17. # Libvirt/Qemu libs
  18. /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/ceph:
  19. bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/ceph
  20. /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qemu:
  21. bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qemu
  22. /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio:
  23. bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio
  24. /usr/lib/libvirt:
  25. bind: $SNAP/usr/lib/libvirt
  26. /usr/share/libvirt:
  27. bind: $SNAP/usr/share/libvirt
  28. /usr/share/qemu:
  29. bind: $SNAP/usr/share/qemu
  30. # Keystone really wants to look here for its fernet keys for some reason
  31. /etc/keystone/fernet-keys:
  32. bind: $SNAP_COMMON/fernet-keys
  33. apps:
  34. # Openstack
  35. openstack:
  36. command: openstack-wrapper openstack
  37. plugs:
  38. - network
  39. # OpenStack Service Configuration
  40. init:
  41. command: microstack_init
  42. plugs:
  43. - network
  44. - mount-observe # rabbitmq-ctl
  45. - network-bind # rabbitmq-ctl?
  46. - firewall-control # iptables
  47. - network-control # iptables
  48. - ssh-keys # write ssh key
  49. - system-observe # rabbitmq ?
  50. - hardware-observe # rabbitmq ?
  51. remove:
  52. command: microstack_remove
  53. # Keystone
  54. keystone-uwsgi:
  55. command: snap-openstack launch keystone-uwsgi
  56. daemon: simple
  57. plugs:
  58. - network-bind
  59. - network
  60. - network-control
  61. keystone-manage:
  62. command: snap-openstack launch keystone-manage
  63. plugs:
  64. - network
  65. # Nova
  66. nova-uwsgi:
  67. command: snap-openstack launch nova-uwsgi
  68. daemon: simple
  69. plugs:
  70. - network
  71. - network-bind
  72. - network-control
  73. nova-api:
  74. command: snap-openstack launch nova-api-os-compute
  75. daemon: simple
  76. plugs:
  77. - network
  78. - network-bind
  79. - network-control
  80. nova-conductor:
  81. command: snap-openstack launch nova-conductor
  82. daemon: simple
  83. plugs:
  84. - network
  85. - network-control
  86. nova-scheduler:
  87. command: snap-openstack launch nova-scheduler
  88. daemon: simple
  89. plugs:
  90. - network
  91. - network-bind
  92. - network-control
  93. nova-compute:
  94. command: snap-openstack launch nova-compute
  95. daemon: simple
  96. plugs:
  97. - network
  98. - network-bind
  99. - network-control
  100. - firewall-control
  101. - hardware-observe
  102. nova-api-metadata:
  103. command: snap-openstack launch nova-api-metadata
  104. daemon: simple
  105. plugs:
  106. - network
  107. - network-bind
  108. - firewall-control
  109. nova-manage:
  110. command: snap-openstack launch nova-manage
  111. plugs:
  112. - network
  113. # Neutron
  114. neutron-api:
  115. command: snap-openstack launch neutron-server
  116. daemon: simple
  117. plugs:
  118. - network
  119. - network-bind
  120. - network-control
  121. neutron-openvswitch-agent:
  122. command: snap-openstack launch neutron-openvswitch-agent
  123. daemon: simple
  124. plugs:
  125. - network
  126. - network-bind
  127. - network-control
  128. - network-observe
  129. - firewall-control
  130. - process-control
  131. - system-observe
  132. neutron-l3-agent:
  133. command: snap-openstack launch neutron-l3-agent
  134. daemon: simple
  135. plugs:
  136. - network
  137. - network-bind
  138. - network-control
  139. - network-observe
  140. - firewall-control
  141. - process-control
  142. - system-observe
  143. neutron-dhcp-agent:
  144. command: snap-openstack launch neutron-dhcp-agent
  145. daemon: simple
  146. plugs:
  147. - network
  148. - network-bind
  149. - network-control
  150. - network-observe
  151. - process-control
  152. - system-observe
  153. neutron-metadata-agent:
  154. command: snap-openstack launch neutron-metadata-agent
  155. daemon: simple
  156. plugs:
  157. - network
  158. - network-bind
  159. - network-control
  160. neutron-ovs-cleanup:
  161. command: snap-openstack launch neutron-ovs-cleanup
  162. plugs:
  163. - network
  164. - network-control
  165. neutron-netns-cleanup:
  166. command: snap-openstack launch neutron-netns-cleanup
  167. plugs:
  168. - network
  169. - network-control
  170. neutron-db-manage:
  171. command: snap-openstack launch neutron-db-manage
  172. plugs:
  173. - network
  174. # Glance
  175. glance-api:
  176. command: snap-openstack launch glance-api
  177. daemon: simple
  178. plugs:
  179. - network
  180. - network-bind
  181. - mount-observe
  182. - network-control
  183. registry:
  184. command: snap-openstack launch glance-registry
  185. daemon: simple
  186. plugs:
  187. - network
  188. - network-bind
  189. - network-control
  190. glance-manage:
  191. command: snap-openstack launch glance-manage
  192. plugs:
  193. - network
  194. # Openstack Shared Services
  195. nginx:
  196. command: snap-openstack launch nginx
  197. daemon: forking
  198. plugs:
  199. - network
  200. - network-bind
  201. # Openvswitch
  202. ovs-vswitchd:
  203. command: ovs-wrapper $SNAP/share/openvswitch/scripts/ovs-ctl --no-ovsdb-server --no-monitor --system-id=random start
  204. stop-command: ovs-wrapper $SNAP/share/openvswitch/scripts/ovs-ctl --no-ovsdb-server stop
  205. after: [ovsdb-server]
  206. daemon: forking
  207. plugs:
  208. - network
  209. - network-bind
  210. - network-control
  211. - openvswitch-support
  212. - process-control
  213. - system-trace
  214. ovsdb-server:
  215. command: ovs-wrapper $SNAP/share/openvswitch/scripts/ovs-ctl --no-ovs-vswitchd --no-monitor --system-id=random start
  216. stop-command: ovs-wrapper $SNAP/share/openvswitch/scripts/ovs-ctl --no-ovs-vswitchd stop
  217. daemon: forking
  218. plugs:
  219. - network
  220. - network-bind
  221. - network-control
  222. - openvswitch-support
  223. - process-control
  224. - system-trace
  225. ovs-vsctl:
  226. command: ovs-wrapper bin/ovs-vsctl
  227. plugs:
  228. - network
  229. ovs-appctl:
  230. command: ovs-wrapper bin/ovs-appctl
  231. plugs:
  232. - network
  233. ovs-ofctl:
  234. command: ovs-wrapper bin/ovs-ofctl
  235. plugs:
  236. - network
  237. ovs-dpctl:
  238. command: ovs-wrapper bin/ovs-dpctl
  239. plugs:
  240. - network
  241. external-bridge:
  242. command: wait-on-init setup-br-ex
  243. daemon: oneshot
  244. after: [ovs-vswitchd]
  245. plugs:
  246. - network
  247. - network-control
  248. # Libvirt/Qemu
  249. libvirtd:
  250. command: usr/sbin/libvirtd --pid $SNAP_DATA/libvirt.pid
  251. daemon: simple
  252. plugs:
  253. - network
  254. - network-bind
  255. - network-control
  256. - netlink-connector
  257. - netlink-audit
  258. - libvirt
  259. - opengl
  260. - raw-usb
  261. - hardware-observe
  262. - kvm
  263. - kernel-module-observe
  264. virtlogd:
  265. command: virtlogd --pid $SNAP_DATA/virtlogd.pid
  266. daemon: simple
  267. plugs:
  268. - network
  269. - network-bind
  270. - network-control
  271. virsh:
  272. command: virsh
  273. # MySQL
  274. mysqld:
  275. command: mysql-start-server
  276. daemon: simple
  277. plugs:
  278. - process-control
  279. - network
  280. - network-bind
  281. mysql:
  282. command: mysql-start-client
  283. plugs:
  284. - process-control
  285. - network
  286. # RabbitMQ
  287. rabbitmq-server:
  288. command: rabbitmq-server
  289. daemon: simple
  290. plugs:
  291. - network-bind
  292. - network
  293. - mount-observe
  294. - log-observe
  295. environment:
  296. HOME: $SNAP_COMMON/lib/rabbitmq
  297. rabbitmqctl:
  298. command: rabbitmqctl
  299. plugs:
  300. - network
  301. - mount-observe
  302. environment:
  303. HOME: $SNAP_COMMON/lib/rabbitmq
  304. rabbitmq-plugins:
  305. command: rabbitmq-plugins
  306. environment:
  307. HOME: $SNAP_COMMON/lib/rabbitmq
  308. # Memcached
  309. memcached:
  310. command: memcached -u root -v
  311. daemon: simple
  312. plugs:
  313. - network
  314. - network-bind
  315. # Cinder
  316. cinder-uwsgi:
  317. command: snap-openstack launch cinder-uwsgi
  318. daemon: simple
  319. plugs:
  320. - network
  321. - network-bind
  322. cinder-backup:
  323. command: snap-openstack launch cinder-backup
  324. daemon: simple
  325. plugs:
  326. - network
  327. - mount-observe
  328. cinder-manage:
  329. command: snap-openstack launch cinder-manage
  330. plugs:
  331. - network
  332. - mount-observe
  333. cinder-scheduler:
  334. command: snap-openstack launch cinder-scheduler
  335. daemon: simple
  336. plugs:
  337. - network
  338. - mount-observe
  339. cinder-volume:
  340. command: snap-openstack launch cinder-volume
  341. daemon: simple
  342. plugs:
  343. - network
  344. - mount-observe
  345. # Horizon
  346. horizon-uwsgi:
  347. command: snap-openstack launch horizon-uwsgi
  348. daemon: simple
  349. plugs:
  350. - network
  351. - network-bind
  352. # Utility to launch a vm. Creates security groups, floating ips,
  353. # and other necessities as well.
  354. launch:
  355. command: microstack_launch
  356. plugs:
  357. - network
  358. - network-control # could also be mount-observe
  359. # Cluster
  360. cluster-server:
  361. command: flask run -p 10002 --host 0.0.0.0 # TODO: run as a uwsgi app
  362. daemon: simple
  363. environment:
  364. LC_ALL: C.UTF-8 # Makes flask happy
  365. LANG: C.UTF-8 # Makes flask happy
  366. FLASK_APP: $SNAP/lib/python3.6/site-packages/cluster/daemon.py
  367. plugs:
  368. - network
  369. - network-bind
  370. join:
  371. command: python3 $SNAP/lib/python3.6/site-packages/cluster/client.py
  372. filebeat:
  373. # this is to avoid conflict with filebeat package
  374. command: bin/filebeat
  375. daemon: simple
  376. nrpe:
  377. command: bin/nrpe
  378. daemon: simple
  379. telegraf:
  380. command: bin/telegraf
  381. daemon: simple
  382. parts:
  383. # Add Ubuntu Cloud Archive sources.
  384. # Allows us to fetch things such as updated libvirt.
  385. uca-sources:
  386. plugin: nil
  387. build-packages:
  388. - ubuntu-cloud-keyring
  389. - software-properties-common
  390. - dpkg-dev # We'll need to manipulate sources later.
  391. override-build: |
  392. add-apt-repository -s cloud-archive:stein
  393. apt-key update
  394. apt update
  395. snapcraftctl build
  396. # OpenStack Python Projects, keyed off Keystone
  397. openstack-projects:
  398. plugin: python
  399. python-version: python3
  400. after:
  401. - uca-sources
  402. - libvirt
  403. - patches
  404. constraints:
  405. - ${SNAPCRAFT_STAGE}/patches/upper-constraints.txt
  406. source: http://tarballs.openstack.org/keystone/keystone-stable-stein.tar.gz
  407. python-packages:
  408. - libvirt-python
  409. - oslo.cache[dogpile]
  410. - pymysql
  411. - uwsgi
  412. - git+https://opendev.org/x/snap.openstack#egg=snap.openstack
  413. - http://tarballs.openstack.org/nova/nova-stable-stein.tar.gz
  414. - neutron
  415. - http://tarballs.openstack.org/glance/glance-stable-stein.tar.gz
  416. - http://tarballs.openstack.org/cinder/cinder-stable-stein.tar.gz
  417. - horizon
  418. - python-cinderclient
  419. - python-openstackclient
  420. - python-swiftclient
  421. # Workaround for https://bugs.launchpad.net/snapcraft/+bug/1860768
  422. # This is a package required for the launch script, per the bug
  423. # above. We include it here so that we don't try to rebuild dist
  424. # stuff:
  425. - petname
  426. build-packages:
  427. - gcc
  428. - git
  429. - libffi-dev
  430. - libssl-dev
  431. - libxml2-dev
  432. - libxslt1-dev
  433. stage-packages:
  434. - conntrack
  435. - coreutils
  436. - haproxy
  437. - libmagic1
  438. - python3-dev
  439. - python3-systemd
  440. override-prime: |
  441. snapcraftctl prime
  442. # Patch Openstack Dashboard (horizon) settings files.
  443. for patch in ${SNAPCRAFT_STAGE}/patches/horizon/*.patch; do
  444. echo "Applying $(basename "$patch") ..."
  445. patch \
  446. --batch \
  447. --forward \
  448. --strip 1 \
  449. --input "$patch"
  450. echo
  451. done
  452. # Now that everything is built, let's disable user site-packages
  453. # as stated in PEP-0370
  454. sed -i usr/lib/python3.6/site.py -e 's/^ENABLE_USER_SITE = None$/ENABLE_USER_SITE = False/'
  455. # Uncomment the below line for better python-libvirt debugging output.
  456. # patch --batch --forward --strip 1 --input ../project/patches/nova/nova_log_error.patch
  457. organize:
  458. lib/python3.6/site-packages/openstack_dashboard/local/local_settings.py.example: lib/python3.6/site-packages/openstack_dashboard/local/local_settings.py
  459. keystone-config:
  460. after: [openstack-projects]
  461. plugin: dump
  462. source: http://tarballs.openstack.org/keystone/keystone-stable-stein.tar.gz
  463. organize:
  464. etc/*.conf: etc/keystone/
  465. etc/*.ini: etc/keystone/
  466. etc/*.json: etc/keystone/
  467. etc/*.templates: etc/keystone/
  468. filesets:
  469. etc:
  470. - etc/keystone/*
  471. stage: [$etc]
  472. prime: [$etc]
  473. openstack-wrapper:
  474. source: ./snap-wrappers/openstack
  475. plugin: dump
  476. after:
  477. - openstack-projects
  478. organize:
  479. openstack-wrapper: bin/openstack-wrapper
  480. init-wrapper:
  481. source: ./snap-wrappers/init
  482. plugin: dump
  483. organize:
  484. wait-on-init: bin/wait-on-init
  485. nova-config:
  486. after: [openstack-projects]
  487. plugin: dump
  488. source: http://tarballs.openstack.org/nova/nova-stable-stein.tar.gz
  489. filesets:
  490. etc:
  491. - etc/nova/*
  492. stage: [$etc]
  493. prime: [$etc]
  494. glance-config:
  495. after: [openstack-projects]
  496. plugin: dump
  497. source: http://tarballs.openstack.org/glance/glance-stable-stein.tar.gz
  498. organize:
  499. etc/*.conf: etc/glance/
  500. etc/*.ini: etc/glance/
  501. etc/*.json: etc/glance/
  502. filesets:
  503. etc:
  504. - etc/glance/*
  505. stage: [$etc]
  506. prime: [$etc]
  507. cinder-config:
  508. after: [openstack-projects]
  509. plugin: dump
  510. source: http://tarballs.openstack.org/cinder/cinder-stable-stein.tar.gz
  511. organize:
  512. etc/*.conf: etc/cinder/
  513. etc/*.ini: etc/cinder/
  514. etc/*.json: etc/cinder/
  515. etc/*.templates: etc/cinder/
  516. filesets:
  517. etc:
  518. - etc/cinder/*
  519. stage: [$etc]
  520. prime: [$etc]
  521. horizon-config:
  522. after: [openstack-projects]
  523. plugin: dump
  524. source: http://tarballs.openstack.org/horizon/horizon-stable-stein.tar.gz
  525. organize:
  526. etc/*.conf: etc/horizon/
  527. filesets:
  528. etc:
  529. - etc/horizon/*
  530. stage: [$etc]
  531. prime: [$etc]
  532. # Snap patches
  533. patches:
  534. after:
  535. - uca-sources
  536. source: patches/
  537. plugin: dump
  538. build-packages:
  539. - curl
  540. override-build: |
  541. # Create ${SNAPCRAFT_STAGE}/patches/upper-constraints
  542. # Fetch upstream file
  543. curl https://raw.githubusercontent.com/openstack/requirements/stable/stein/upper-constraints.txt --output ./upper-constraints.txt
  544. # Fix https://bugs.launchpad.net/microstack/+bug/1867360
  545. sed -e 's/pyScss===1.3.4/git+https:\/\/github.com\/petevg\/pyScss.git#egg=pyScss/' -i ./upper-constraints.txt
  546. snapcraftctl build
  547. organize:
  548. '*' : patches/
  549. 'usr/sbin/dnsmasq': patches/neutron/dnsmasq
  550. prime:
  551. - -*
  552. openvswitch:
  553. source: http://openvswitch.org/releases/openvswitch-2.11.1.tar.gz
  554. plugin: autotools
  555. build-packages:
  556. - libssl-dev
  557. - try: [libnuma-dev]
  558. - libcap-ng-dev
  559. - libpcap-dev
  560. - libunbound-dev
  561. - python-all
  562. - python-six
  563. - python-setuptools
  564. stage-packages:
  565. - uuid-runtime
  566. - libunbound2
  567. configflags:
  568. - "--localstatedir=/var/snap/$SNAPCRAFT_PROJECT_NAME/common"
  569. - "--sysconfdir=/var/snap/$SNAPCRAFT_PROJECT_NAME/etc"
  570. after:
  571. - patches
  572. ovs-wrapper:
  573. source: ./snap-wrappers/ovs
  574. plugin: dump
  575. after:
  576. - openvswitch
  577. organize:
  578. ovs-wrapper: bin/ovs-wrapper
  579. nginx:
  580. source: http://www.nginx.org/download/nginx-1.13.0.tar.gz
  581. plugin: autotools
  582. after:
  583. - patches
  584. configflags:
  585. - --prefix=/usr
  586. - "--http-log-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/log/nginx-access.log"
  587. - "--error-log-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/log/nginx-error.log"
  588. - "--lock-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/lock/nginx.lock"
  589. - "--pid-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/run/nginx.pid"
  590. - "--http-client-body-temp-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/lib/nginx_client_body"
  591. - "--http-proxy-temp-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/lib/nginx_proxy"
  592. - "--http-fastcgi-temp-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/lib/nginx_fastcgi"
  593. - "--http-uwsgi-temp-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/lib/nginx_uwsgi"
  594. - "--http-scgi-temp-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/lib/nginx_scgi"
  595. - --with-http_ssl_module
  596. build-packages:
  597. - libpcre3-dev
  598. - libssl-dev
  599. - python-six
  600. override-build: |
  601. # Apply patches
  602. for patch in ${SNAPCRAFT_STAGE}/patches/nginx/*.patch; do
  603. echo "Applying $(basename "$patch") ..."
  604. patch \
  605. --batch \
  606. --forward \
  607. --strip 1 \
  608. --input "$patch"
  609. echo
  610. done
  611. snapcraftctl build
  612. nginx:
  613. source: http://www.nginx.org/download/nginx-1.13.0.tar.gz
  614. plugin: autotools
  615. after:
  616. - patches
  617. configflags:
  618. - --prefix=/usr
  619. - "--http-log-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/log/nginx-access.log"
  620. - "--error-log-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/log/nginx-error.log"
  621. - "--lock-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/lock/nginx.lock"
  622. - "--pid-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/run/nginx.pid"
  623. - "--http-client-body-temp-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/lib/nginx_client_body"
  624. - "--http-proxy-temp-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/lib/nginx_proxy"
  625. - "--http-fastcgi-temp-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/lib/nginx_fastcgi"
  626. - "--http-uwsgi-temp-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/lib/nginx_uwsgi"
  627. - "--http-scgi-temp-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/lib/nginx_scgi"
  628. - --with-http_ssl_module
  629. build-packages:
  630. - libpcre3-dev
  631. - libssl-dev
  632. - python-six
  633. override-build: |
  634. # Apply patches
  635. for patch in ${SNAPCRAFT_STAGE}/patches/nginx/*.patch; do
  636. echo "Applying $(basename "$patch") ..."
  637. patch \
  638. --batch \
  639. --forward \
  640. --strip 1 \
  641. --input "$patch"
  642. echo
  643. done
  644. snapcraftctl build
  645. # libvirt/qemu
  646. qemu:
  647. source: .
  648. source-subdir: qemu-3.1+dfsg
  649. plugin: autotools
  650. after:
  651. - uca-sources
  652. build-environment:
  653. # Workaround for https://bugs.launchpad.net/snapcraft/+bug/1860766
  654. - LD_LIBRARY_PATH: $SNAPCRAFT_PART_INSTALL/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/ceph:$SNAPCRAFT_PART_INSTALL/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio:$LD_LIBRARY_PATH
  655. stage-packages:
  656. - seabios
  657. - ipxe-qemu
  658. - freeglut3 # provides libglut.so.3
  659. - try:
  660. - libnuma1
  661. - libspice-server1
  662. - libasound2
  663. - libasyncns0
  664. - libbluetooth3
  665. - libboost-iostreams1.62.0
  666. - libboost-random1.62.0
  667. - libboost-system1.62.0
  668. - libboost-thread1.62.0
  669. - libcaca0
  670. - libfdt1
  671. - libflac8
  672. - libglu1-mesa
  673. - libiscsi7
  674. - libjpeg-turbo8
  675. - libnspr4
  676. - libnss3
  677. - libogg0
  678. - libopus0
  679. - libpixman-1-0
  680. - libpulse0
  681. - librados2
  682. - librbd1
  683. - libsdl1.2debian
  684. - libslang2
  685. - libsndfile1
  686. - libusb-1.0-0
  687. - libusbredirparser1
  688. - libvorbis0a
  689. - libvorbisenc2
  690. - libx11-6
  691. - libxi6
  692. - libxau6
  693. - libxcb1
  694. - libxdmcp6
  695. - libxen-dev
  696. - libxext6
  697. - libpng16-16
  698. build-packages:
  699. - acpica-tools
  700. - libaio-dev
  701. - libasound2-dev
  702. - libattr1-dev
  703. - libbluetooth-dev
  704. - libcap-dev
  705. - libcap-ng-dev
  706. - libcurl4-gnutls-dev
  707. - libfdt-dev
  708. - gnutls-dev
  709. - libiscsi-dev
  710. - libncurses5-dev
  711. - try: [libnuma-dev]
  712. - libpixman-1-dev
  713. - libpulse-dev
  714. - librados-dev
  715. - librbd-dev
  716. - libsasl2-dev
  717. - libsdl1.2-dev
  718. - try: [libspice-server-dev, libspice-protocol-dev]
  719. - libusb-1.0-0-dev
  720. - libusbredirparser-dev
  721. - linux-libc-dev
  722. - uuid-dev
  723. - xfslibs-dev
  724. - libjpeg-dev
  725. - zlib1g-dev
  726. - libpng-dev
  727. - wget
  728. - dpkg-dev
  729. - gcc
  730. configflags:
  731. - --disable-blobs
  732. - --prefix=/usr
  733. - --localstatedir=/var/snap/$SNAPCRAFT_PROJECT_NAME/common
  734. - --sysconfdir=/var/snap/$SNAPCRAFT_PROJECT_NAME/common
  735. - --firmwarepath=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/share/seabios:/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/share/qemu:/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/lib/ipxe/qemu
  736. - --disable-user
  737. - --disable-linux-user
  738. - --disable-bsd-user
  739. - --disable-vhost-user
  740. - --enable-system
  741. - --target-list=x86_64-softmmu
  742. override-build: |
  743. # I think that snapcraft is creating this dir, which breaks the below.
  744. rm -Rf qemu-3.1+dfsg
  745. apt source qemu
  746. # Fix issue with running apt source as root
  747. dpkg-source --before-build qemu-3.1+dfsg
  748. snapcraftctl build
  749. kvm-support:
  750. plugin: nil
  751. stage-packages:
  752. - try: [msr-tools]
  753. libvirt:
  754. source: .
  755. source-subdir: libvirt-5.0.0
  756. after:
  757. - qemu
  758. - uca-sources
  759. plugin: autotools
  760. build-packages:
  761. - libxml2-dev
  762. - libxml-libxml-perl
  763. - libcurl4-gnutls-dev
  764. - libncurses5-dev
  765. - libreadline-dev
  766. - zlib1g-dev
  767. - libgcrypt20-dev
  768. - libgnutls28-dev
  769. - libyajl-dev
  770. - libpcap0.8-dev
  771. - libaudit-dev
  772. - libdevmapper-dev
  773. - libpciaccess-dev
  774. - libnl-3-dev
  775. - libnl-route-3-dev
  776. - libxml2-utils
  777. - uuid-dev
  778. - try: [libnuma-dev]
  779. - python-all
  780. - python-six
  781. - wget
  782. - dpkg-dev
  783. - xsltproc
  784. stage-packages:
  785. - dmidecode
  786. - dnsmasq
  787. - iptables
  788. - genisoimage
  789. - libxml2
  790. - libyajl2
  791. - try: [libnuma1]
  792. - libcurl3-gnutls
  793. - libpcap0.8
  794. - libpciaccess0
  795. configflags:
  796. - --with-qemu
  797. - --without-bhyve
  798. - --without-xen
  799. - --without-openvz
  800. - --without-vmware
  801. - --without-xenapi
  802. - --without-esx
  803. - --without-hyperv
  804. - --without-lxc
  805. - --without-vz
  806. - --without-vbox
  807. - --without-uml
  808. - --without-sasl
  809. - --without-storage-iscsi
  810. - --without-storage-sheepdog
  811. - --without-storage-rbd
  812. - --without-storage-lvm
  813. - --without-selinux
  814. - --prefix=/usr
  815. - --localstatedir=/var/snap/$SNAPCRAFT_PROJECT_NAME/common
  816. - --sysconfdir=/var/snap/$SNAPCRAFT_PROJECT_NAME/common
  817. - DNSMASQ=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/sbin/dnsmasq
  818. - DMIDECODE=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/sbin/dmidecode
  819. - OVSVSCTL=/snap/$SNAPCRAFT_PROJECT_NAME/current/bin/ovs-vsctl
  820. - IPTABLES_PATH=/snap/$SNAPCRAFT_PROJECT_NAME/current/sbin/iptables
  821. - IP6TABLES_PATH=/snap/$SNAPCRAFT_PROJECT_NAME/current/sbin/ip6tables
  822. override-build: |
  823. # I think that snapcraft is creating this dir, which breaks the below.
  824. rm -Rf libvirt-5.0.0
  825. apt source libvirt
  826. # Fix issue with running apt source as root
  827. dpkg-source --before-build libvirt-5.0.0
  828. # Prevent libvirt from attempting to run setgroups
  829. echo "
  830. #undef HAVE_SETGROUPS
  831. #undef HAVE_SETEUID
  832. " >> libvirt-5.0.0/config-post.h
  833. # Build
  834. snapcraftctl build
  835. organize:
  836. 'usr/sbin/dnsmasq-orig': usr/sbin/dnsmasq
  837. # MySQL
  838. mysql-server:
  839. plugin: dump
  840. source: ./snap-wrappers/mysql
  841. stage-packages:
  842. - mysql-server
  843. - mysql-client
  844. organize:
  845. mysql-start-server: bin/mysql-start-server
  846. mysql-start-client: bin/mysql-start-client
  847. # RabbitMQ
  848. rabbitmq-server:
  849. source: ./snap-wrappers/rabbitmq
  850. plugin: dump
  851. stage-packages:
  852. - rabbitmq-server
  853. override-build: |
  854. rm -f $SNAPCRAFT_PART_INSTALL/usr/bin/erl
  855. rm -f $SNAPCRAFT_PART_INSTALL/usr/lib/rabbitmq/bin/rabbitmq-script-wrapper
  856. # NOTE(jamespage): The versioned path below is brittle.
  857. rm -f $SNAPCRAFT_PART_INSTALL/usr/lib/rabbitmq/lib/rabbitmq_server-3.6.10/sbin/rabbitmq-defaults
  858. snapcraftctl build
  859. organize:
  860. rabbitmq-script-wrapper: usr/lib/rabbitmq/bin/rabbitmq-script-wrapper
  861. rabbitmq-defaults: usr/lib/rabbitmq/lib/rabbitmq_server-3.6.10/sbin/rabbitmq-defaults
  862. erl: usr/bin/erl
  863. # Memcached Token Caching
  864. memcached:
  865. plugin: nil
  866. stage-packages:
  867. - memcached
  868. # Cinder LVM backend
  869. lvm2:
  870. source: http://www.sourceware.org/pub/lvm2/releases/LVM2.2.02.172.tgz
  871. plugin: autotools
  872. configflags:
  873. - --with-confdir=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/etc/
  874. - --with-default-system-dir=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/etc/
  875. build-attributes: [no-patchelf]
  876. # Templates and other files to be overlaid over the snap.
  877. overlay:
  878. plugin: dump
  879. source: snap-overlay
  880. # Optionally interactive init script
  881. init:
  882. plugin: python
  883. python-version: python3
  884. requirements:
  885. - requirements.txt # Relative to source path, so tools/init/req...txt
  886. source: tools/init
  887. override-build: |
  888. # Hack to avoid conflict between openstack-projects'
  889. # site-customize and this one.
  890. snapcraftctl build
  891. rm $SNAPCRAFT_PART_INSTALL/usr/lib/python3.6/sitecustomize.py
  892. # Launch script
  893. launch:
  894. plugin: python
  895. python-version: python3
  896. requirements:
  897. - requirements.txt
  898. source: tools/launch
  899. override-build: |
  900. # Hack to avoid conflict between openstack-projects'
  901. # site-customize and this one.
  902. snapcraftctl build
  903. rm $SNAPCRAFT_PART_INSTALL/usr/lib/python3.6/sitecustomize.py
  904. # Clustering client and server
  905. cluster:
  906. plugin: python
  907. python-version: python3
  908. requirements:
  909. - requirements.txt
  910. constraints:
  911. - ${SNAPCRAFT_STAGE}/patches/upper-constraints.txt
  912. source: tools/cluster
  913. override-build: |
  914. # Hack to avoid conflict between openstack-projects'
  915. # site-customize and this one.
  916. snapcraftctl build
  917. rm $SNAPCRAFT_PART_INSTALL/usr/lib/python3.6/sitecustomize.py
  918. ### LMA stack ###
  919. filebeat:
  920. plugin: dump
  921. source: ./snap-wrappers/filebeat
  922. after: [ lma-build-prep, qemu, libvirt ]
  923. stage-packages: [ filebeat ]
  924. organize:
  925. filebeat: bin/filebeat
  926. nrpe:
  927. plugin: dump
  928. source: ./snap-wrappers/nrpe
  929. organize:
  930. nrpe: bin/nrpe
  931. after: [ lma-build-prep ]
  932. stage-packages: [ nagios-nrpe-server, nagios-nrpe-plugin, monitoring-plugins, monitoring-plugins-basic, monitoring-plugins-common ]
  933. telegraf:
  934. plugin: dump
  935. source: ./snap-wrappers/telegraf
  936. organize:
  937. telegraf: bin/telegraf
  938. # we use autotools plugin here because it brings git, make
  939. # otherwise we'd have to add respective packages
  940. after: [ lma-build-prep, qemu, libvirt ]
  941. # See https://forum.snapcraft.io/t/patchelf-broke-my-binary/4928
  942. # and https://bugs.launchpad.net/snapcraft/+bug/1753995
  943. build-attributes: [no-patchelf]
  944. stage-packages: [ telegraf, iproute2, bridge-utils, ethtool, fancontrol, libatm1, ipmitool, freeipmi-tools ]
  945. lma-build-prep:
  946. plugin: nil
  947. source: ""
  948. build-packages:
  949. - dirmngr
  950. override-build: |
  951. cat $SNAPCRAFT_PROJECT_DIR/filebeat.pgp.key | apt-key add -
  952. cat $SNAPCRAFT_PROJECT_DIR/telegraf.pgp.key | apt-key add -
  953. apt-get install apt-transport-https
  954. echo 'deb https://artifacts.elastic.co/packages/5.x/apt stable main' > /etc/apt/sources.list.d/elastic-5.x.list
  955. echo 'deb http://ppa.launchpad.net/telegraf-devs/ppa/ubuntu bionic main' > /etc/apt/sources.list.d/telegraf.x.list
  956. # this needs to be re-worked in order to be built in-place
  957. echo 'deb http://ppa.launchpad.net/nikolay.vinogradov/nrpe-root/ubuntu bionic main' > /etc/apt/sources.list.d/nrpe-root.list
  958. sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F767C80E0FC5C835
  959. apt-get update --allow-unauthenticated
  960. #lma-configs:
  961. # plugin: dump
  962. # source: ./lma
  963. # after: [ lma-build-prep ]
  964. # organize:
  965. # 'config/nrpe': etc/nrpe
  966. # 'config/telegraf': etc/telegraf
  967. checks:
  968. plugin: dump
  969. source: ./checks
  970. organize:
  971. check_systemd.py: usr/lib/nagios/plugins/check_systemd.py
  972. hooks:
  973. install:
  974. plugs: [network]
  975. configure:
  976. plugs: [network]
  977. post-refresh:
  978. plugs: [network]