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.
 
 
 
 

1614 lines
47 KiB

  1. name: microstack
  2. version: ussuri
  3. base: core20
  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:$SNAP/usr/local/bin:$SNAP/usr/local/sbin:$PATH
  13. # OS_PLACEMENT_CONFIG_DIR: $SNAP/etc/nova/
  14. # Standard library components must have priority in module name resolution: https://storyboard.openstack.org/#!/story/2007806
  15. PYTHONPATH: $PYTHONPATH:/usr/lib/python3.8:/usr/lib/python3/dist-packages:$SNAP/usr/lib/python3.8:$SNAP/lib/python3.8/site-packages:$SNAP/usr/lib/python3/dist-packages
  16. PYTHONWARNINGS: ignore
  17. # Needed by a targetcli dependency.
  18. GI_TYPELIB_PATH: $SNAP/usr/lib/x86_64-linux-gnu/girepository-1.0
  19. system-usernames:
  20. snap_daemon: shared
  21. layout:
  22. /usr/local/bin:
  23. bind: $SNAP/usr/local/bin
  24. /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/ceph:
  25. bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/ceph
  26. /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qemu:
  27. bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qemu
  28. /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio:
  29. bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio
  30. /usr/lib/libvirt:
  31. bind: $SNAP/usr/lib/libvirt
  32. /usr/share/libvirt:
  33. bind: $SNAP/usr/share/libvirt
  34. /usr/share/qemu:
  35. bind: $SNAP/usr/share/qemu
  36. # Keystone really wants to look here for its fernet keys for some reason
  37. /etc/keystone/fernet-keys:
  38. bind: $SNAP_COMMON/fernet-keys
  39. # Libvirt has a hard-coded path for the apparmor directory.
  40. /etc/apparmor.d:
  41. bind: $SNAP_COMMON/etc/apparmor.d
  42. # os-brick has a hard-coded location for the iscsi initiator name file.
  43. /etc/iscsi:
  44. bind: $SNAP_COMMON/etc/iscsi
  45. # NOTE: /var/target is there since vhost-scsi module is a holder of target-core-mod (see
  46. # the content of /sys/module/target_core_mod/holders). This prevents rtslib from being
  47. # able to change the value of /sys/kernel/config/target/dbroot to /etc/target. At the same time,
  48. # rtslib saves configuration to /etc/target/saveconfig.json by default. Hence both bind mounts
  49. # point to the same target directory.
  50. # LIO: the preferred db_root directory documented both in the kernel target code and rtslib.
  51. /etc/target:
  52. bind: $SNAP_COMMON/etc/target
  53. # LIO: the default db_root directory documented both in the kernel target code and rtslib.
  54. /var/target:
  55. bind: $SNAP_COMMON/etc/target
  56. # LIO: Debian targetcli and rtslib carry a patch that changes the preferred dbroot from /etc/target
  57. # to /etc/rtslib-fb-target.
  58. /etc/rtslib-fb-target:
  59. bind: $SNAP_COMMON/etc/target
  60. apps:
  61. # Openstack
  62. openstack:
  63. command: bin/openstack-wrapper openstack
  64. plugs:
  65. - network
  66. # TODO: - microstack-support
  67. # A proxy command to avoid calling <namespace>.<command>.
  68. # TODO: potentially remove the individual commands completely in favor of this.
  69. microstack:
  70. command: bin/microstack
  71. plugs:
  72. - network
  73. - mount-observe
  74. - network-bind
  75. - firewall-control
  76. - network-control
  77. - ssh-keys
  78. - system-observe
  79. - hardware-observe
  80. # TODO: - microstack-support
  81. # OpenStack Service Configuration
  82. init:
  83. command: bin/microstack_init
  84. plugs:
  85. - network
  86. - mount-observe # rabbitmq-ctl
  87. - network-bind # rabbitmq-ctl?
  88. - firewall-control # iptables
  89. - network-control # iptables
  90. - ssh-keys # write ssh key
  91. - system-observe # rabbitmq ?
  92. - hardware-observe # rabbitmq ?
  93. # TODO: - microstack-support
  94. add-compute:
  95. command: bin/microstack_add_compute
  96. plugs:
  97. - network
  98. # Keystone
  99. keystone-uwsgi:
  100. command: bin/snap-openstack launch keystone-uwsgi
  101. daemon: simple
  102. plugs:
  103. - network-bind
  104. - network
  105. - network-control
  106. # TODO: - microstack-support
  107. keystone-manage:
  108. command: bin/snap-openstack launch keystone-manage
  109. plugs:
  110. - network
  111. # TODO: - microstack-support
  112. nova-api:
  113. command: bin/snap-openstack launch nova-api-os-compute
  114. daemon: simple
  115. plugs:
  116. - network
  117. - network-bind
  118. - network-control
  119. # TODO: - microstack-support
  120. nova-conductor:
  121. command: bin/snap-openstack launch nova-conductor
  122. daemon: simple
  123. plugs:
  124. - network
  125. - network-control
  126. # TODO: - microstack-support
  127. nova-scheduler:
  128. command: bin/snap-openstack launch nova-scheduler
  129. daemon: simple
  130. plugs:
  131. - network
  132. - network-bind
  133. - network-control
  134. # TODO: - microstack-support
  135. nova-compute:
  136. command: bin/snap-openstack launch nova-compute
  137. after: [libvirtd]
  138. daemon: simple
  139. plugs:
  140. - network
  141. - network-bind
  142. - network-control
  143. - firewall-control
  144. - hardware-observe
  145. # TODO: - microstack-support
  146. # Needs access to block devices so that blockdev --flushbufs works.
  147. - block-devices
  148. nova-api-metadata:
  149. command: bin/snap-openstack launch nova-api-metadata
  150. daemon: simple
  151. plugs:
  152. - network
  153. - network-bind
  154. - firewall-control
  155. # TODO: - microstack-support
  156. nova-manage:
  157. command: bin/snap-openstack launch nova-manage
  158. plugs:
  159. - network
  160. # TODO: - microstack-support
  161. nova-spicehtml5proxy:
  162. command: bin/snap-openstack launch nova-spicehtml5proxy
  163. daemon: simple
  164. plugs:
  165. - network
  166. - network-bind
  167. - network-control
  168. # TODO: - microstack-support
  169. # Neutron
  170. neutron-api:
  171. command: bin/snap-openstack launch neutron-server
  172. daemon: simple
  173. plugs:
  174. - network
  175. - network-bind
  176. - network-control
  177. # TODO: - microstack-support
  178. neutron-ovn-metadata-agent:
  179. command: bin/snap-openstack launch neutron-ovn-metadata-agent
  180. daemon: simple
  181. plugs:
  182. - network
  183. - network-bind
  184. - network-control
  185. - network-observe
  186. # TODO: - microstack-support
  187. neutron-ovs-cleanup:
  188. command: bin/snap-openstack launch neutron-ovs-cleanup
  189. plugs:
  190. - network
  191. - network-control
  192. # TODO: - microstack-support
  193. # NOTE(dmitriis): Upstream Neutron does not support cleaning up ovnmeta-<uuid> namespaces
  194. # as of Ussuri which is a bug.
  195. neutron-netns-cleanup:
  196. command: bin/snap-openstack launch neutron-netns-cleanup
  197. plugs:
  198. - network
  199. - network-control
  200. # TODO: - microstack-support
  201. neutron-db-manage:
  202. command: bin/snap-openstack launch neutron-db-manage
  203. plugs:
  204. - network
  205. # TODO: - microstack-support
  206. # Glance
  207. glance-api:
  208. command: bin/snap-openstack launch glance-api
  209. daemon: simple
  210. plugs:
  211. - network
  212. - network-bind
  213. - mount-observe
  214. - network-control
  215. # TODO: - microstack-support
  216. registry:
  217. command: bin/snap-openstack launch glance-registry
  218. daemon: simple
  219. plugs:
  220. - network
  221. - network-bind
  222. - network-control
  223. # TODO: - microstack-support
  224. glance-manage:
  225. command: bin/snap-openstack launch glance-manage
  226. plugs:
  227. - network
  228. # TODO: - microstack-support
  229. # Placement
  230. placement-uwsgi:
  231. command: bin/snap-openstack launch placement-uwsgi
  232. daemon: simple
  233. plugs:
  234. - network
  235. - network-bind
  236. - mount-observe
  237. - network-control
  238. # TODO: - microstack-support
  239. placement-manage:
  240. command: bin/snap-openstack launch placement-manage
  241. plugs:
  242. - network
  243. # TODO: - microstack-support
  244. # Openstack Shared Services
  245. nginx:
  246. command: bin/snap-openstack launch nginx
  247. daemon: forking
  248. plugs:
  249. - network
  250. - network-bind
  251. # TODO: - microstack-support
  252. # Openvswitch
  253. ovs-vswitchd:
  254. command: bin/ovs-wrapper $SNAP/usr/local/share/openvswitch/scripts/ovs-ctl --no-ovsdb-server --no-monitor start
  255. stop-command: bin/ovs-wrapper $SNAP/usr/local/share/openvswitch/scripts/ovs-ctl --no-ovsdb-server stop
  256. after: [ovsdb-server]
  257. daemon: forking
  258. plugs:
  259. - network
  260. - network-bind
  261. - network-control
  262. # NETLINK_NETFILTER SOCK_RAW sockets
  263. - firewall-control
  264. - openvswitch-support
  265. - process-control
  266. - system-trace
  267. - hardware-observe
  268. - hugepages-control
  269. # TODO: - microstack-support
  270. ovsdb-server:
  271. command: bin/ovs-wrapper $SNAP/usr/local/share/openvswitch/scripts/ovs-ctl --no-ovs-vswitchd --no-monitor start
  272. stop-command: bin/ovs-wrapper $SNAP/usr/local/share/openvswitch/scripts/ovs-ctl --no-ovs-vswitchd stop
  273. daemon: forking
  274. plugs:
  275. - network
  276. - network-bind
  277. - network-control
  278. - openvswitch-support
  279. - process-control
  280. - system-trace
  281. # TODO: - microstack-support
  282. ovn-ovsdb-server-nb:
  283. command: bin/ovn-wrapper $SNAP/usr/local/share/ovn/scripts/ovn-ctl start_nb_ovsdb
  284. stop-command: bin/ovn-wrapper $SNAP/usr/local/share/ovn/scripts/ovn-ctl stop_nb_ovsdb
  285. daemon: forking
  286. plugs:
  287. - network
  288. - network-bind
  289. - network-control
  290. - openvswitch-support
  291. - process-control
  292. - system-trace
  293. # TODO: - microstack-support
  294. ovn-ovsdb-server-sb:
  295. command: bin/ovn-wrapper $SNAP/usr/local/share/ovn/scripts/ovn-ctl start_sb_ovsdb
  296. stop-command: bin/ovn-wrapper $SNAP/usr/local/share/ovn/scripts/ovn-ctl stop_sb_ovsdb
  297. daemon: forking
  298. plugs:
  299. - network
  300. - network-bind
  301. - network-control
  302. - openvswitch-support
  303. - process-control
  304. - system-trace
  305. # TODO: - microstack-support
  306. ovn-northd:
  307. command: bin/ovn-wrapper $SNAP/usr/local/share/ovn/scripts/ovn-ctl start_northd
  308. stop-command: bin/ovn-wrapper $SNAP/usr/local/share/ovn/scripts/ovn-ctl stop_northd
  309. daemon: forking
  310. plugs:
  311. - network
  312. - network-bind
  313. - network-control
  314. - openvswitch-support
  315. - process-control
  316. - system-trace
  317. # TODO: - microstack-support
  318. after:
  319. - ovn-ovsdb-server-nb
  320. - ovn-ovsdb-server-sb
  321. ovn-controller:
  322. command: bin/ovn-wrapper $SNAP/usr/local/share/ovn/scripts/ovn-ctl start_controller
  323. stop-command: bin/ovn-wrapper $SNAP/usr/local/share/ovn/scripts/ovn-ctl stop_controller
  324. daemon: forking
  325. plugs:
  326. - network
  327. - network-bind
  328. - network-control
  329. - openvswitch-support
  330. - process-control
  331. - system-trace
  332. # TODO: - microstack-support
  333. after:
  334. - ovsdb-server
  335. - ovs-vswitchd
  336. ovn-appctl:
  337. command: bin/ovn-wrapper $SNAP/usr/local/bin/ovn-appctl
  338. plugs:
  339. - network
  340. - network-bind
  341. # TODO: - microstack-support
  342. ovn-trace:
  343. command: bin/ovn-wrapper $SNAP/usr/local/bin/ovn-trace
  344. plugs:
  345. - network
  346. - network-bind
  347. # TODO: - microstack-support
  348. ovn-detrace:
  349. command: bin/ovn-wrapper $SNAP/usr/local/bin/ovn-detrace
  350. plugs:
  351. - network
  352. - network-bind
  353. # TODO: - microstack-support
  354. ovn-nbctl:
  355. command: bin/ovn-wrapper $SNAP/usr/local/bin/ovn-nbctl
  356. plugs:
  357. - network
  358. - network-bind
  359. # TODO: - microstack-support
  360. ovn-sbctl:
  361. command: bin/ovn-wrapper $SNAP/usr/local/bin/ovn-sbctl
  362. plugs:
  363. - network
  364. - network-bind
  365. - process-control
  366. # TODO: - microstack-support
  367. ovs-vsctl:
  368. command: bin/ovs-wrapper $SNAP/usr/local/bin/ovs-vsctl
  369. plugs:
  370. - network
  371. - process-control
  372. # TODO: - microstack-support
  373. ovs-appctl:
  374. command: bin/ovs-wrapper $SNAP/usr/local/bin/ovs-appctl
  375. plugs:
  376. - network
  377. - process-control
  378. # TODO: - microstack-support
  379. ovs-ofctl:
  380. command: bin/ovs-wrapper $SNAP/usr/local/bin/ovs-ofctl
  381. plugs:
  382. - network
  383. - process-control
  384. # TODO: - microstack-support
  385. ovs-dpctl:
  386. command: bin/ovs-wrapper $SNAP/usr/local/bin/ovs-dpctl
  387. plugs:
  388. - network
  389. - process-control
  390. # TODO: - microstack-support
  391. external-bridge:
  392. command: bin/wait-on-init setup-br-ex
  393. daemon: oneshot
  394. after: [ovs-vswitchd]
  395. plugs:
  396. - network
  397. - network-control
  398. - process-control
  399. # TODO: - microstack-support
  400. # Libvirt/Qemu
  401. libvirtd:
  402. command: usr/sbin/libvirtd --pid $SNAP_DATA/libvirt.pid
  403. daemon: simple
  404. plugs:
  405. - network
  406. - network-bind
  407. - network-control
  408. - netlink-connector
  409. - netlink-audit
  410. - libvirt
  411. - opengl
  412. - raw-usb
  413. - hardware-observe
  414. - hugepages-control
  415. - kvm
  416. - kernel-module-observe
  417. - process-control
  418. - mount-observe
  419. - block-devices
  420. # TODO: - microstack-support
  421. # Make sure KillMode=process is set in the resulting systemd unit instead of
  422. # the default KillMode=control-group to avoid the situation where stopping
  423. # libvirtd causes the forced power off scenario for all VMs; it also affects
  424. # snap refreshes as libvirtd is restarted in this case.
  425. # Removing the snap will still result in VMs being forcefully powered off which
  426. # is intended.
  427. stop-mode: sigterm
  428. virtlogd:
  429. command: usr/sbin/virtlogd --pid $SNAP_DATA/virtlogd.pid
  430. daemon: simple
  431. plugs:
  432. - network
  433. - network-bind
  434. - network-control
  435. # TODO: - microstack-support
  436. virsh:
  437. command: usr/bin/virsh
  438. plugs:
  439. - network
  440. # TODO: - microstack-support
  441. # MySQL
  442. mysqld:
  443. command: bin/mysql-start-server
  444. daemon: simple
  445. plugs:
  446. - process-control
  447. - network
  448. - network-bind
  449. # TODO: - microstack-support
  450. mysql:
  451. command: bin/mysql-start-client
  452. plugs:
  453. - process-control
  454. - network
  455. # TODO: - microstack-support
  456. # RabbitMQ
  457. rabbitmq-server:
  458. command: usr/sbin/rabbitmq-server
  459. daemon: simple
  460. plugs:
  461. - network-bind
  462. - network
  463. - mount-observe
  464. - log-observe
  465. # TODO: - microstack-support
  466. environment:
  467. HOME: $SNAP_COMMON/lib/rabbitmq
  468. rabbitmqctl:
  469. command: usr/sbin/rabbitmqctl
  470. plugs:
  471. - network
  472. - mount-observe
  473. # TODO: - microstack-support
  474. environment:
  475. HOME: $SNAP_COMMON/lib/rabbitmq
  476. rabbitmq-plugins:
  477. command: usr/sbin/rabbitmq-plugins
  478. environment:
  479. HOME: $SNAP_COMMON/lib/rabbitmq
  480. # TODO: - microstack-support
  481. # Memcached
  482. memcached:
  483. command: usr/bin/memcached -u root -v
  484. daemon: simple
  485. plugs:
  486. - network
  487. - network-bind
  488. # TODO: - microstack-support
  489. # Cinder
  490. cinder-uwsgi:
  491. command: bin/snap-openstack launch cinder-uwsgi
  492. daemon: simple
  493. plugs:
  494. - network
  495. - network-bind
  496. # TODO: - microstack-support
  497. cinder-backup:
  498. command: bin/snap-openstack launch cinder-backup
  499. daemon: simple
  500. plugs:
  501. - network
  502. - mount-observe
  503. # TODO: - microstack-support
  504. cinder-manage:
  505. command: bin/snap-openstack launch cinder-manage
  506. plugs:
  507. - network
  508. - mount-observe
  509. # TODO: - microstack-support
  510. cinder-scheduler:
  511. command: bin/snap-openstack launch cinder-scheduler
  512. daemon: simple
  513. plugs:
  514. - network
  515. - mount-observe
  516. # TODO: - microstack-support
  517. cinder-volume:
  518. command: bin/snap-openstack launch cinder-volume
  519. daemon: simple
  520. plugs:
  521. - network
  522. - network-bind
  523. - mount-observe
  524. - block-devices
  525. # setpriority by LVM tools.
  526. - process-control
  527. # TODO: - microstack-support
  528. after:
  529. - setup-lvm-loopdev
  530. # Restores LIO kernel target configuration.
  531. target:
  532. command: bin/target-start
  533. stop-command: bin/target-stop
  534. daemon: oneshot
  535. plugs:
  536. - network
  537. - network-bind
  538. - mount-observe
  539. - block-devices
  540. # TODO: - microstack-support
  541. after:
  542. - setup-lvm-loopdev
  543. environment:
  544. TARGETCLI_HOME: $SNAP_USER_COMMON/.targetcli
  545. iscsid:
  546. command: bin/iscsid-start
  547. daemon: forking
  548. plugs:
  549. - network
  550. - network-bind
  551. # NETLINK_ISCSI protocol sockets
  552. - network-control
  553. # TODO: - microstack-support
  554. - block-devices
  555. - process-control
  556. after:
  557. # Make sure iscsid is stopped before target configuration is cleaned up.
  558. - target
  559. # TODO: this is a --devmode workaround since the microstack-support interface is not merged yet.
  560. load-modules:
  561. command: bin/load-modules
  562. daemon: oneshot
  563. plugs:
  564. - kernel-module-control
  565. setup-lvm-loopdev:
  566. command: bin/setup-lvm-loopdev
  567. daemon: oneshot
  568. plugs:
  569. - network
  570. - block-devices
  571. - mount-observe
  572. # loop device control etc.
  573. # LVM tools use setpriority to set it to -18 which is prohibited in the default snapd templates.
  574. - process-control
  575. # TODO: - microstack-support
  576. after:
  577. - load-modules
  578. # Horizon
  579. horizon-uwsgi:
  580. command: bin/snap-openstack launch horizon-uwsgi
  581. daemon: simple
  582. plugs:
  583. - network
  584. - network-bind
  585. # TODO: - microstack-support
  586. # Utility to launch a vm. Creates security groups, floating ips,
  587. # and other necessities as well.
  588. launch:
  589. command: bin/microstack_launch
  590. plugs:
  591. - network
  592. - network-control # could also be mount-observe
  593. # TODO: - microstack-support
  594. # Cluster
  595. cluster-uwsgi:
  596. command: bin/snap-openstack launch cluster-uwsgi
  597. daemon: simple
  598. plugs:
  599. - network
  600. - network-bind
  601. # TODO: - microstack-support
  602. telegraf:
  603. command: bin/telegraf
  604. daemon: simple
  605. filebeat:
  606. # this is to avoid conflict with filebeat package
  607. command: bin/filebeat
  608. daemon: simple
  609. nrpe:
  610. command: bin/nrpe
  611. daemon: simple
  612. parts:
  613. # Add Ubuntu Cloud Archive sources.
  614. # Allows us to fetch things such as updated libvirt.
  615. uca-sources:
  616. plugin: nil
  617. build-packages:
  618. - ubuntu-cloud-keyring
  619. - software-properties-common
  620. - dpkg-dev # We'll need to manipulate sources later.
  621. #stage-packages:
  622. # The two dependencies below are added to avoid errors during
  623. # the build step of the openstack-projects part (see LP: #1864589).
  624. - python3-dev
  625. - python3-distutils
  626. override-build: |
  627. # add-apt-repository -s cloud-archive:ussuri
  628. # apt-key update
  629. # apt update
  630. snapcraftctl build
  631. # OpenStack Python Projects, keyed off Keystone
  632. openstack-projects:
  633. plugin: python
  634. # python-version: python3
  635. after:
  636. - uca-sources
  637. - libvirt
  638. - patches
  639. constraints:
  640. - ${SNAPCRAFT_STAGE}/patches/upper-constraints.txt
  641. source: http://tarballs.openstack.org/keystone/keystone-stable-ussuri.tar.gz
  642. build-packages:
  643. - gcc
  644. - git
  645. - libffi-dev
  646. - libssl-dev
  647. - libxml2-dev
  648. - libxslt1-dev
  649. - python3-dev
  650. - libsystemd-dev
  651. stage-packages:
  652. - procps # sysctl utility is used by Neutron agents.
  653. - conntrack
  654. - coreutils
  655. - haproxy
  656. - libmagic1
  657. - petname
  658. - libsystemd0
  659. - libpython3.8
  660. - spice-html5
  661. - sg3-utils
  662. # LIO userspace dependencies
  663. # Will also pull rtslib-fb to work with ConfigFS.
  664. - targetcli-fb
  665. python-packages:
  666. - wheel
  667. - libvirt-python
  668. - oslo.cache[dogpile]
  669. - pymysql
  670. - uwsgi
  671. - git+https://opendev.org/x/snap.openstack#egg=snap.openstack
  672. - http://tarballs.openstack.org/nova/nova-stable-ussuri.tar.gz
  673. - https://tarballs.opendev.org/openstack/neutron/neutron-stable-ussuri.tar.gz
  674. - https://tarballs.opendev.org/openstack/glance/glance-stable-ussuri.tar.gz
  675. - https://tarballs.opendev.org/openstack/cinder/cinder-stable-ussuri.tar.gz
  676. - https://tarballs.opendev.org/openstack/placement/placement-stable-ussuri.tar.gz
  677. - https://tarballs.opendev.org/openstack/horizon/horizon-stable-ussuri.tar.gz
  678. - python-cinderclient
  679. - python-openstackclient
  680. - python-swiftclient
  681. # Workaround for https://bugs.launchpad.net/snapcraft/+bug/1860768
  682. # This is a package required for the launch script, per the bug
  683. # above. We include it here so that we don't try to rebuild dist
  684. # stuff:
  685. - petname
  686. - systemd-python
  687. # Used by spice-html5 proxy.
  688. - websockify
  689. # For debugging purposes.
  690. - rpdb
  691. build-environment: &python-build-environment
  692. - PIP_COMPILE: 'false' # disable .pyc generation in pip
  693. - PYTHONDONTWRITEBYTECODE: 'false' # disable .pyc generation by setup.py
  694. - SOURCE_DATE_EPOCH: '1591640328'
  695. override-prime: |
  696. snapcraftctl prime
  697. # Patch Openstack Dashboard (horizon) settings files.
  698. for patch in ${SNAPCRAFT_STAGE}/patches/horizon/*.patch; do
  699. echo "Applying $(basename "$patch") ..."
  700. patch \
  701. --batch \
  702. --forward \
  703. --strip 1 \
  704. --input "$patch"
  705. echo
  706. done
  707. # Now that everything is built, let's disable user site-packages
  708. # as stated in PEP-0370
  709. # sed -i usr/lib/python3.8/site.py -e 's/^ENABLE_USER_SITE = None$/ENABLE_USER_SITE = False/'
  710. # Uncomment the below line for better python-libvirt debugging output.
  711. # patch --batch --forward --strip 1 --input ../project/patches/nova/nova_log_error.patch
  712. organize:
  713. lib/python3.8/site-packages/openstack_dashboard/local/local_settings.py.example: lib/python3.8/site-packages/openstack_dashboard/local/local_settings.py
  714. override-build: |
  715. snapcraftctl build
  716. rm $SNAPCRAFT_PART_INSTALL/pyvenv.cfg
  717. --strip 1 \
  718. --input "$patch"
  719. echo
  720. done
  721. # Now that everything is built, let's disable user site-packages
  722. # as stated in PEP-0370
  723. # sed -i usr/lib/python3.8/site.py -e 's/^ENABLE_USER_SITE = None$/ENABLE_USER_SITE = False/'
  724. # Uncomment the below line for better python-libvirt debugging output.
  725. # patch --batch --forward --strip 1 --input ../project/patches/nova/nova_log_error.patch
  726. organize:
  727. lib/python3.8/site-packages/openstack_dashboard/local/local_settings.py.example: lib/python3.8/site-packages/openstack_dashboard/local/local_settings.py
  728. override-build: |
  729. snapcraftctl build
  730. rm $SNAPCRAFT_PART_INSTALL/pyvenv.cfg
  731. rm $SNAPCRAFT_PART_INSTALL/bin/activate
  732. rm $SNAPCRAFT_PART_INSTALL/bin/activate.csh
  733. rm $SNAPCRAFT_PART_INSTALL/bin/activate.fish
  734. # see LP: #1882994
  735. rm $SNAPCRAFT_PART_INSTALL/bin/python3
  736. rm $SNAPCRAFT_PART_INSTALL/bin/python
  737. keystone-config:
  738. after: [openstack-projects]
  739. plugin: dump
  740. source: http://tarballs.openstack.org/keystone/keystone-stable-ussuri.tar.gz
  741. organize:
  742. etc/*.conf: etc/keystone/
  743. etc/*.ini: etc/keystone/
  744. etc/*.json: etc/keystone/
  745. etc/*.templates: etc/keystone/
  746. filesets:
  747. etc:
  748. - etc/keystone/*
  749. stage: [$etc]
  750. prime: [$etc]
  751. openstack-wrapper:
  752. source: ./snap-wrappers/openstack
  753. plugin: dump
  754. after:
  755. - openstack-projects
  756. organize:
  757. openstack-wrapper: bin/openstack-wrapper
  758. init-wrapper:
  759. source: ./snap-wrappers/init
  760. plugin: dump
  761. organize:
  762. wait-on-init: bin/wait-on-init
  763. nova-config:
  764. after: [openstack-projects]
  765. plugin: dump
  766. source: http://tarballs.openstack.org/nova/nova-stable-ussuri.tar.gz
  767. filesets:
  768. etc:
  769. - etc/nova/*
  770. stage: [$etc]
  771. prime: [$etc]
  772. glance-config:
  773. after: [openstack-projects]
  774. plugin: dump
  775. source: http://tarballs.openstack.org/glance/glance-stable-ussuri.tar.gz
  776. organize:
  777. etc/*.conf: etc/glance/
  778. etc/*.ini: etc/glance/
  779. etc/*.json: etc/glance/
  780. filesets:
  781. etc:
  782. - etc/glance/*
  783. stage: [$etc]
  784. prime: [$etc]
  785. placement-config:
  786. after: [openstack-projects]
  787. plugin: dump
  788. source: http://tarballs.openstack.org/placement/placement-stable-ussuri.tar.gz
  789. organize:
  790. etc/*.conf: etc/placement/
  791. etc/*.ini: etc/placement/
  792. etc/*.json: etc/placement/
  793. filesets:
  794. etc:
  795. - etc/placement/*
  796. stage: [$etc]
  797. prime: [$etc]
  798. cinder-config:
  799. after: [openstack-projects]
  800. plugin: dump
  801. source: http://tarballs.openstack.org/cinder/cinder-stable-ussuri.tar.gz
  802. organize:
  803. etc/*.conf: etc/cinder/
  804. etc/*.ini: etc/cinder/
  805. etc/*.json: etc/cinder/
  806. etc/*.templates: etc/cinder/
  807. filesets:
  808. etc:
  809. - etc/cinder/*
  810. stage: [$etc]
  811. prime: [$etc]
  812. horizon-config:
  813. after: [openstack-projects]
  814. plugin: dump
  815. source: http://tarballs.openstack.org/horizon/horizon-stable-ussuri.tar.gz
  816. organize:
  817. etc/*.conf: etc/horizon/
  818. filesets:
  819. etc:
  820. - etc/horizon/*
  821. stage: [$etc]
  822. prime: [$etc]
  823. # Snap patches
  824. patches:
  825. after:
  826. - uca-sources
  827. source: patches/
  828. plugin: dump
  829. build-packages:
  830. - curl
  831. override-build: |
  832. # Create ${SNAPCRAFT_STAGE}/patches/upper-constraints
  833. # Fetch upstream file
  834. curl https://raw.githubusercontent.com/openstack/requirements/stable/ussuri/upper-constraints.txt --output ./upper-constraints.txt
  835. snapcraftctl build
  836. organize:
  837. '*' : patches/
  838. prime:
  839. - -*
  840. openvswitch:
  841. source: https://github.com/openvswitch/ovs/archive/v2.13.0.tar.gz
  842. plugin: autotools
  843. build-packages:
  844. - autoconf
  845. - binutils
  846. - bsdmainutils
  847. - build-essential
  848. - gettext
  849. - git
  850. - libarchive-zip-perl
  851. - libcap-ng-dev
  852. - libpcap-dev
  853. - on arm64:
  854. - libnuma-dev
  855. - on ppc64el:
  856. - libnuma-dev
  857. - on amd64:
  858. - libnuma-dev
  859. - libssl-dev
  860. - libtimedate-perl
  861. - libtool
  862. - libunbound-dev
  863. - pkg-config
  864. - python-all-dev
  865. - python-setuptools
  866. - python3-all-dev
  867. - python3-setuptools
  868. - python3-sphinx
  869. - sphinx-common
  870. - zlib1g-dev
  871. stage-packages:
  872. - libevent-2.1-7
  873. - kmod
  874. - libcap-ng0
  875. - libssl1.1
  876. - libunbound8
  877. - netbase
  878. - ethtool
  879. - procps
  880. - uuid-runtime
  881. autotools-configure-parameters:
  882. - "--localstatedir=/var/snap/$SNAPCRAFT_PROJECT_NAME/common"
  883. - "--sysconfdir=/var/snap/$SNAPCRAFT_PROJECT_NAME/etc"
  884. after:
  885. - patches
  886. override-build: |
  887. snapcraftctl build
  888. tar -cvzf $SNAPCRAFT_STAGE/openvswitch.tar.gz .
  889. ovs-wrapper:
  890. source: ./snap-wrappers/ovs
  891. plugin: dump
  892. after:
  893. - openvswitch
  894. organize:
  895. ovs-wrapper: bin/ovs-wrapper
  896. # Nova os-vif code makes libvirt plug a VM interface into an integration bridge
  897. # which relies on ovs-vsctl execution. Since we use modified paths, some environment
  898. # variables need to be set.
  899. ovs-vsctl: bin/ovs-vsctl
  900. ovn:
  901. after: [openvswitch, patches]
  902. source: https://github.com/ovn-org/ovn/archive/v20.03.0.tar.gz
  903. plugin: autotools
  904. autotools-configure-parameters:
  905. - --sysconfdir=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/etc
  906. - --localstatedir=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/var
  907. - --with-ovs-source=$SNAPCRAFT_PART_BUILD/openvswitch
  908. override-pull: |
  909. snapcraftctl pull
  910. rm -rf openvswitch
  911. mkdir openvswitch
  912. tar -C openvswitch -xvzf $SNAPCRAFT_STAGE/openvswitch.tar.gz
  913. rm -f $SNAPCRAFT_STAGE/openvswitch.tar.gz
  914. override-build: |
  915. snapcraftctl build
  916. build-packages:
  917. - autoconf
  918. - binutils
  919. - build-essential
  920. - git
  921. - libssl-dev
  922. - libtool
  923. - python3-all-dev
  924. - sphinx-common
  925. stage-packages:
  926. - libevent-2.1-7
  927. - libunbound8
  928. organize:
  929. snap/$SNAPCRAFT_PROJECT_NAME/current/share: /share
  930. filesets:
  931. exclude-duplicate-manpages:
  932. - -share/man/man*/ovsdb*
  933. - -usr/local/share/man/man*/ovsdb*
  934. stage:
  935. - $exclude-duplicate-manpages
  936. prime:
  937. - $exclude-duplicate-manpages
  938. ovn-wrapper:
  939. source: ./snap-wrappers/ovn
  940. plugin: dump
  941. after:
  942. - ovn
  943. organize:
  944. ovn-wrapper: bin/ovn-wrapper
  945. nginx:
  946. source: http://www.nginx.org/download/nginx-1.19.0.tar.gz
  947. plugin: autotools
  948. autotools-configure-parameters:
  949. - --prefix=/usr
  950. - "--http-log-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/log/nginx-access.log"
  951. - "--error-log-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/log/nginx-error.log"
  952. - "--lock-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/lock/nginx.lock"
  953. - "--pid-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/run/nginx.pid"
  954. - "--http-client-body-temp-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/lib/nginx_client_body"
  955. - "--http-proxy-temp-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/lib/nginx_proxy"
  956. - "--http-fastcgi-temp-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/lib/nginx_fastcgi"
  957. - "--http-uwsgi-temp-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/lib/nginx_uwsgi"
  958. - "--http-scgi-temp-path=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/lib/nginx_scgi"
  959. - --with-http_ssl_module
  960. build-packages:
  961. - libpcre3-dev
  962. - libssl-dev
  963. - python-six
  964. override-build: |
  965. # Apply patches
  966. for patch in ${SNAPCRAFT_STAGE}/patches/nginx/*.patch; do
  967. echo "Applying $(basename "$patch") ..."
  968. patch \
  969. --batch \
  970. --forward \
  971. --strip 1 \
  972. --input "$patch"
  973. echo
  974. done
  975. snapcraftctl build
  976. # libvirt/qemu
  977. qemu:
  978. source: https://git.launchpad.net/ubuntu/+source/qemu
  979. source-type: git
  980. source-branch: ubuntu/focal-updates
  981. plugin: autotools
  982. after:
  983. - uca-sources
  984. build-environment:
  985. # Workaround for https://bugs.launchpad.net/snapcraft/+bug/1860766
  986. - LD_LIBRARY_PATH: $SNAPCRAFT_PART_INSTALL/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/ceph:$SNAPCRAFT_PART_INSTALL/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio:$LD_LIBRARY_PATH
  987. stage-packages:
  988. - seabios
  989. - ipxe-qemu
  990. - freeglut3 # provides libglut.so.3
  991. - libnuma1
  992. - libspice-server1
  993. - libasound2
  994. - libasyncns0
  995. - libbluetooth3
  996. - libboost-iostreams1.67.0
  997. - libboost-random1.67.0
  998. - libboost-system1.67.0
  999. - libboost-thread1.67.0
  1000. - libcaca0
  1001. - libfdt1
  1002. - libflac8
  1003. - libglu1-mesa
  1004. - libiscsi7
  1005. - libjpeg-turbo8
  1006. - libnspr4
  1007. - libnss3
  1008. - libogg0
  1009. - libopus0
  1010. - libpixman-1-0
  1011. - libpulse0
  1012. - librados2
  1013. - librbd1
  1014. - libsdl1.2debian
  1015. - libslang2
  1016. - libsndfile1
  1017. - libusb-1.0-0
  1018. - libusbredirparser1
  1019. - libvorbis0a
  1020. - libvorbisenc2
  1021. - libx11-6
  1022. - libxi6
  1023. - libxau6
  1024. - libxcb1
  1025. - libxdmcp6
  1026. - libxext6
  1027. - libpng16-16
  1028. - libaio1
  1029. - libasn1-8-heimdal
  1030. - libbrotli1
  1031. - libcurl3-gnutls
  1032. - libgssapi3-heimdal
  1033. - libhcrypto4-heimdal
  1034. - libheimbase1-heimdal
  1035. - libheimntlm0-heimdal
  1036. - libhx509-5-heimdal
  1037. - libkrb5-26-heimdal
  1038. - libldap-2.4-2
  1039. - libnghttp2-14
  1040. - libpsl5
  1041. - libroken18-heimdal
  1042. - librtmp1
  1043. - libssh-4
  1044. - libwind0-heimdal
  1045. build-packages:
  1046. - acpica-tools
  1047. - libaio-dev
  1048. - libasound2-dev
  1049. - libattr1-dev
  1050. - libbluetooth-dev
  1051. - libcap-dev
  1052. - libcap-ng-dev
  1053. - libcurl4-gnutls-dev
  1054. - libfdt-dev
  1055. - gnutls-dev
  1056. - libiscsi-dev
  1057. - libncurses5-dev
  1058. - try: [libnuma-dev]
  1059. - libpixman-1-dev
  1060. - libpulse-dev
  1061. - librados-dev
  1062. - librbd-dev
  1063. - libsasl2-dev
  1064. - libsdl1.2-dev
  1065. - try: [libspice-server-dev, libspice-protocol-dev]
  1066. - libusb-1.0-0-dev
  1067. - libusbredirparser-dev
  1068. - linux-libc-dev
  1069. - uuid-dev
  1070. - xfslibs-dev
  1071. - libjpeg-dev
  1072. - zlib1g-dev
  1073. - libpng-dev
  1074. - wget
  1075. - dpkg-dev
  1076. - gcc
  1077. autotools-configure-parameters:
  1078. - --disable-blobs
  1079. - --prefix=/usr
  1080. - --localstatedir=/var/snap/$SNAPCRAFT_PROJECT_NAME/common
  1081. - --sysconfdir=/var/snap/$SNAPCRAFT_PROJECT_NAME/common
  1082. - --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
  1083. - --disable-user
  1084. - --disable-linux-user
  1085. - --disable-bsd-user
  1086. - --disable-vhost-user
  1087. - --enable-system
  1088. - --target-list=x86_64-softmmu
  1089. - --disable-xen
  1090. override-build: |
  1091. dpkg-source --before-build .
  1092. snapcraftctl build
  1093. kvm-support:
  1094. plugin: nil
  1095. stage-packages:
  1096. - try: [msr-tools]
  1097. libvirt:
  1098. source: https://git.launchpad.net/ubuntu/+source/libvirt
  1099. source-type: git
  1100. source-branch: ubuntu/focal-updates
  1101. source-subdir: build-subdir
  1102. after:
  1103. - qemu
  1104. - uca-sources
  1105. plugin: autotools
  1106. build-packages:
  1107. - libxml2-dev
  1108. - libxml-libxml-perl
  1109. - libcurl4-gnutls-dev
  1110. - libncurses5-dev
  1111. - libreadline-dev
  1112. - zlib1g-dev
  1113. - libgcrypt20-dev
  1114. - libgnutls28-dev
  1115. - libyajl-dev
  1116. - libpcap0.8-dev
  1117. - libaudit-dev
  1118. - libdevmapper-dev
  1119. - libpciaccess-dev
  1120. - libnl-3-dev
  1121. - libnl-route-3-dev
  1122. - libxml2-utils
  1123. - uuid-dev
  1124. - try: [libnuma-dev]
  1125. - python-all
  1126. - python-six
  1127. - wget
  1128. - dpkg-dev
  1129. - xsltproc
  1130. - libapparmor-dev
  1131. - rsync
  1132. - open-iscsi
  1133. stage-packages:
  1134. - dmidecode
  1135. - dnsmasq
  1136. - iptables
  1137. - genisoimage
  1138. - libxml2
  1139. - libyajl2
  1140. - try: [libnuma1]
  1141. - libcurl3-gnutls
  1142. - libpcap0.8
  1143. - libpciaccess0
  1144. # libvirt uses the pm-is-supported tool.
  1145. - pm-utils
  1146. - ebtables
  1147. - apparmor
  1148. - libapparmor1
  1149. autotools-configure-parameters:
  1150. - --with-qemu
  1151. - --without-bhyve
  1152. - --without-xen
  1153. - --without-openvz
  1154. - --without-vmware
  1155. - --without-xenapi
  1156. - --without-esx
  1157. - --without-hyperv
  1158. - --without-lxc
  1159. - --without-vz
  1160. - --without-vbox
  1161. - --without-uml
  1162. - --without-sasl
  1163. - --without-storage-iscsi
  1164. - --without-storage-sheepdog
  1165. - --without-storage-rbd
  1166. - --without-storage-lvm
  1167. - --without-selinux
  1168. - --with-chrdev-lock-files=/run/lock
  1169. - --with-storage-iscsi
  1170. # TODO(dmitriis): re-enable once a workaround is found for subprocess' RPATH handling.
  1171. # - --with-apparmor
  1172. - --without-apparmor
  1173. # NOTE: the install prefix will be different from the actual location on snap installation.
  1174. - --prefix=/usr
  1175. - --bindir=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/bin
  1176. - --sbindir=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/sbin
  1177. - --libexecdir=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/libexec
  1178. - --libdir=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/lib
  1179. - --includedir=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/include
  1180. - --oldincludedir=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/include
  1181. - --localstatedir=/var/snap/$SNAPCRAFT_PROJECT_NAME/common
  1182. - --sysconfdir=/var/snap/$SNAPCRAFT_PROJECT_NAME/common
  1183. - DNSMASQ=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/sbin/dnsmasq
  1184. - DMIDECODE=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/sbin/dmidecode
  1185. - OVSVSCTL=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/local/bin/ovs-vsctl
  1186. - IPTABLES_PATH=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/sbin/iptables-legacy
  1187. - IP6TABLES_PATH=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/sbin/ip6tables-legacy
  1188. - EBTABLES_PATH=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/sbin/ebtables-legacy
  1189. build-environment:
  1190. # Libraries under /snap/$SNAPCRAFT_PROJECT_NAME/current/usr/lib/x86_64-linux-gnu are not added to the
  1191. # runpath by default. This is OK for parent processes which get LD_LIBRARY_PATH set properly but not
  1192. # for the child processes they spawn since the environment variables are not passed down to children by default after execve(2).
  1193. # `readelf -d /snap/microstack/current/usr/libexec/virt-aa-helper` should return something like:
  1194. # (RUNPATH) Library runpath: [/snap/microstack/current/usr/lib:/snap/microstack/current/usr/lib/x86_64-linux-gnu:...]
  1195. - LDFLAGS: '$LDFLAGS -Wl,-rpath=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/lib -Wl,-rpath=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/lib/x86_64-linux-gnu -Wl,-rpath=/snap/$SNAPCRAFT_PROJECT_NAME/current/lib -Wl,-rpath=/lib/x86_64-linux-gnu -Wl,-rpath=/lib/'
  1196. override-build: |
  1197. dpkg-source --before-build .
  1198. logger `echo -n $PWD`
  1199. # Prevent libvirt from attempting to run setgroups
  1200. echo "
  1201. #undef HAVE_SETGROUPS
  1202. #undef HAVE_SETEUID
  1203. " >> config-post.h
  1204. # See https://bugs.launchpad.net/snapcraft/+bug/1882255
  1205. mkdir build-subdir
  1206. cd build-subdir
  1207. ../autogen.sh
  1208. echo "#!/bin/sh
  1209. exit 0
  1210. " >> autogen.sh
  1211. chmod +x autogen.sh
  1212. ln -s ../configure configure
  1213. cd ..
  1214. # end of a workaround for LP: #1882255
  1215. # Build
  1216. snapcraftctl build
  1217. rsync --remove-source-files -arhvP $SNAPCRAFT_PART_INSTALL/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/* $SNAPCRAFT_PART_INSTALL/usr/
  1218. rm -rf $SNAPCRAFT_PART_INSTALL/snap/$SNAPCRAFT_PROJECT_NAME/current/usr
  1219. # Copy the generated apparmor template into the install dir
  1220. # it will be used by libvirt at runtime.
  1221. mkdir -p $SNAPCRAFT_PART_INSTALL/etc/apparmor.d/libvirt/
  1222. mkdir -p $SNAPCRAFT_PART_INSTALL/etc/apparmor.d/abstractions
  1223. cp $SNAPCRAFT_PART_BUILD/src/security/apparmor/TEMPLATE.qemu $SNAPCRAFT_PART_INSTALL/etc/apparmor.d/libvirt/TEMPLATE.qemu
  1224. cp $SNAPCRAFT_PART_BUILD/src/security/apparmor/libvirt-qemu $SNAPCRAFT_PART_INSTALL/etc/apparmor.d/abstractions/libvirt-qemu
  1225. # While LXC is not used, the AppArmor code errors out if the template for LXC is not there.
  1226. cp $SNAPCRAFT_PART_BUILD/src/security/apparmor/TEMPLATE.lxc $SNAPCRAFT_PART_INSTALL/etc/apparmor.d/libvirt/TEMPLATE.lxc
  1227. cp $SNAPCRAFT_PART_BUILD/src/security/apparmor/libvirt-lxc $SNAPCRAFT_PART_INSTALL/etc/apparmor.d/abstractions/libvirt-lxc
  1228. # MySQL
  1229. mysql-server:
  1230. plugin: dump
  1231. source: ./snap-wrappers/mysql
  1232. stage-packages:
  1233. - mysql-server
  1234. - mysql-client
  1235. organize:
  1236. mysql-start-server: bin/mysql-start-server
  1237. mysql-start-client: bin/mysql-start-client
  1238. # RabbitMQ
  1239. rabbitmq-server:
  1240. source: ./snap-wrappers/rabbitmq
  1241. plugin: dump
  1242. stage-packages:
  1243. - rabbitmq-server
  1244. override-build: |
  1245. rm -f $SNAPCRAFT_PART_INSTALL/usr/bin/erl
  1246. rm -f $SNAPCRAFT_PART_INSTALL/usr/lib/rabbitmq/bin/rabbitmq-script-wrapper
  1247. # NOTE(jamespage): The versioned path below is brittle.
  1248. rm -f $SNAPCRAFT_PART_INSTALL/usr/lib/rabbitmq/lib/rabbitmq_server-3.8.2/sbin/rabbitmq-defaults
  1249. snapcraftctl build
  1250. organize:
  1251. rabbitmq-script-wrapper: usr/lib/rabbitmq/bin/rabbitmq-script-wrapper
  1252. rabbitmq-defaults: usr/lib/rabbitmq/lib/rabbitmq_server-3.8.2/sbin/rabbitmq-defaults
  1253. erl: usr/bin/erl
  1254. # Memcached Token Caching
  1255. memcached:
  1256. plugin: nil
  1257. stage-packages:
  1258. - memcached
  1259. # Cinder LVM backend
  1260. lvm2:
  1261. after:
  1262. - libvirt
  1263. source: https://git.launchpad.net/ubuntu/+source/lvm2
  1264. source-type: git
  1265. source-branch: ubuntu/focal
  1266. build-packages:
  1267. - python3-pyudev
  1268. stage-packages:
  1269. - thin-provisioning-tools
  1270. plugin: autotools
  1271. autotools-configure-parameters:
  1272. - --with-confdir=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/etc/
  1273. - --with-default-system-dir=/var/snap/$SNAPCRAFT_PROJECT_NAME/common/etc/
  1274. - --with-cache=internal
  1275. - --with-device-uid=0
  1276. # Assumes that the "disk" group is present on the host and has 6 for its gid.
  1277. # This is common but not fully reliable not knowing the target distribution.
  1278. - --with-device-gid=6
  1279. - --with-device-mode=0660
  1280. - --with-default-pid-dir=/run
  1281. - --with-default-run-dir=/run/lvm
  1282. - --with-default-locking-dir=/run/lock/lvm
  1283. - --with-thin=internal
  1284. - --with-thin-check=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/sbin/thin_check
  1285. - --with-thin-dump=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/sbin/thin_dump
  1286. - --with-thin-repair=/snap/$SNAPCRAFT_PROJECT_NAME/current/usr/sbin/thin_repair
  1287. - --enable-applib
  1288. - --enable-blkid_wiping
  1289. - --enable-cmdlib
  1290. - --enable-dmeventd
  1291. - --enable-dbus-service
  1292. # - --enable-lvmlockd-dlm
  1293. # - --enable-lvmlockd-sanlock
  1294. # - --enable-lvmpolld
  1295. # - --enable-notify-dbus
  1296. - --enable-pkgconfig
  1297. - --enable-readline
  1298. # The two below are especially important to make sure lvm tools do not try to use
  1299. # mknod themselves to create block special files for device mapper devices and
  1300. # so that cookies are used to synchronize udev and LVM tools operations.
  1301. - --enable-udev_rules
  1302. - --enable-udev_sync
  1303. open-iscsi:
  1304. after:
  1305. - patches
  1306. source: https://git.launchpad.net/ubuntu/+source/open-iscsi
  1307. source-type: git
  1308. source-branch: ubuntu/focal
  1309. build-packages:
  1310. - autotools-dev
  1311. - bison
  1312. - bzip2
  1313. - debhelper
  1314. - dh-autoreconf
  1315. - dh-exec
  1316. - dh-systemd
  1317. - dpkg-dev
  1318. - flex
  1319. - libisns-dev
  1320. - libmount-dev
  1321. - po-debconf
  1322. stage-packages:
  1323. - libisns0
  1324. plugin: dump
  1325. organize:
  1326. usr/iscsid: sbin/iscsid
  1327. usr/iscsiadm: sbin/iscsiadm
  1328. usr/iscsistart: sbin/iscsistart
  1329. utils/iscsi_discovery: sbin/iscsi_discovery
  1330. utils/iscsi-iname: sbin/iscsi-iname
  1331. filesets:
  1332. iscsi-binaries:
  1333. - sbin/*
  1334. iscsi-deps:
  1335. - lib/*
  1336. - usr/lib/*
  1337. stage: [$iscsi-binaries, $iscsi-deps]
  1338. prime: [$iscsi-binaries, $iscsi-deps]
  1339. override-build: |
  1340. # Distro patches.
  1341. dpkg-source --before-build .
  1342. # snap-specific patches.
  1343. for patch in ${SNAPCRAFT_STAGE}/patches/open-iscsi/*.patch; do
  1344. echo "Applying $(basename "$patch") ..."
  1345. patch \
  1346. --batch \
  1347. --forward \
  1348. --strip 1 \
  1349. --input "$patch"
  1350. echo
  1351. done
  1352. dh build-arch --with autotools_dev,autoreconf,systemd
  1353. snapcraftctl build
  1354. # Templates and other files to be overlaid over the snap.
  1355. overlay:
  1356. plugin: dump
  1357. source: snap-overlay
  1358. # Optionally interactive init script
  1359. init:
  1360. plugin: python
  1361. # python-version: python3
  1362. requirements:
  1363. - requirements.txt # Relative to source path, so tools/init/req...txt
  1364. source: tools/init
  1365. stage-packages:
  1366. # note(dmitriis) in order to avoid conflicts about lib64/ld-linux-x86-64.so.2
  1367. # with other parts.
  1368. - libc6
  1369. - rsync
  1370. build-environment: *python-build-environment
  1371. after: [openstack-projects]
  1372. override-build: |
  1373. snapcraftctl build
  1374. `find $SNAPCRAFT_PART_INSTALL -name '__pycache__' | xargs rm -r`
  1375. `find $SNAPCRAFT_PART_INSTALL -name 'RECORD' | xargs rm`
  1376. rm $SNAPCRAFT_PART_INSTALL/pyvenv.cfg
  1377. rm $SNAPCRAFT_PART_INSTALL/bin/activate
  1378. rm $SNAPCRAFT_PART_INSTALL/bin/activate.csh
  1379. rm $SNAPCRAFT_PART_INSTALL/bin/activate.fish
  1380. # see LP: #1882994
  1381. rm $SNAPCRAFT_PART_INSTALL/bin/python3
  1382. rm $SNAPCRAFT_PART_INSTALL/bin/python
  1383. rm $SNAPCRAFT_PART_INSTALL/lib/python3.8/site-packages/netifaces.cpython-38-x86_64-linux-gnu.so
  1384. # Launch script
  1385. launch:
  1386. plugin: python
  1387. # python-version: python3
  1388. requirements:
  1389. - requirements.txt
  1390. source: tools/launch
  1391. stage-packages:
  1392. # note(dmitriis) in order to avoid conflicts about lib64/ld-linux-x86-64.so.2
  1393. # with other parts.
  1394. - libc6
  1395. build-environment: *python-build-environment
  1396. after: [init]
  1397. override-build: |
  1398. snapcraftctl build
  1399. `find $SNAPCRAFT_PART_INSTALL -name '__pycache__' | xargs rm -r`
  1400. `find $SNAPCRAFT_PART_INSTALL -name 'RECORD' | xargs rm`
  1401. rm $SNAPCRAFT_PART_INSTALL/pyvenv.cfg
  1402. rm $SNAPCRAFT_PART_INSTALL/bin/activate
  1403. rm $SNAPCRAFT_PART_INSTALL/bin/activate.csh
  1404. rm $SNAPCRAFT_PART_INSTALL/bin/activate.fish
  1405. rm $SNAPCRAFT_PART_INSTALL/bin/python3
  1406. rm $SNAPCRAFT_PART_INSTALL/bin/python
  1407. microstack:
  1408. plugin: python
  1409. source: tools/microstack
  1410. stage-packages:
  1411. # note(dmitriis) in order to avoid conflicts about lib64/ld-linux-x86-64.so.2
  1412. # with other parts.
  1413. - libc6
  1414. build-environment: *python-build-environment
  1415. override-build: |
  1416. snapcraftctl build
  1417. `find $SNAPCRAFT_PART_INSTALL -name '__pycache__' | xargs rm -r`
  1418. `find $SNAPCRAFT_PART_INSTALL -name 'RECORD' | xargs rm`
  1419. rm $SNAPCRAFT_PART_INSTALL/pyvenv.cfg
  1420. rm $SNAPCRAFT_PART_INSTALL/bin/activate
  1421. rm $SNAPCRAFT_PART_INSTALL/bin/activate.csh
  1422. rm $SNAPCRAFT_PART_INSTALL/bin/activate.fish
  1423. rm $SNAPCRAFT_PART_INSTALL/bin/python3
  1424. rm $SNAPCRAFT_PART_INSTALL/bin/python
  1425. # Clustering client and server
  1426. cluster:
  1427. plugin: python
  1428. # python-version: python3
  1429. requirements:
  1430. - requirements.txt
  1431. constraints:
  1432. - ${SNAPCRAFT_STAGE}/patches/upper-constraints.txt
  1433. source: tools/cluster
  1434. # note(dmitriis) in order to avoid conflicts about lib64/ld-linux-x86-64.so.2
  1435. # with other parts.
  1436. stage-packages:
  1437. - libc6
  1438. build-packages:
  1439. - python3-dev
  1440. build-environment: *python-build-environment
  1441. after: [launch]
  1442. override-build: |
  1443. snapcraftctl build
  1444. `find $SNAPCRAFT_PART_INSTALL -name '__pycache__' | xargs rm -r`
  1445. `find $SNAPCRAFT_PART_INSTALL -name 'RECORD' | xargs rm`
  1446. rm $SNAPCRAFT_PART_INSTALL/pyvenv.cfg
  1447. rm $SNAPCRAFT_PART_INSTALL/bin/activate
  1448. rm $SNAPCRAFT_PART_INSTALL/bin/activate.csh
  1449. rm $SNAPCRAFT_PART_INSTALL/bin/activate.fish
  1450. rm $SNAPCRAFT_PART_INSTALL/bin/python
  1451. rm $SNAPCRAFT_PART_INSTALL/bin/python3
  1452. setup-lvm-loopdev:
  1453. source-type: local
  1454. source: ./tools/setup-lvm-loopdev
  1455. plugin: dump
  1456. organize:
  1457. setup-lvm-loopdev: bin/setup-lvm-loopdev
  1458. stage-packages:
  1459. # note(dmitriis) in order to avoid conflicts about lib64/ld-linux-x86-64.so.2
  1460. # with other parts.
  1461. - libc6
  1462. # fallocate
  1463. - util-linux
  1464. # losetup
  1465. - mount
  1466. ### LMA stack ###
  1467. filebeat:
  1468. plugin: dump
  1469. source: ./snap-wrappers/filebeat
  1470. after: [ lma-build-prep, qemu, libvirt ]
  1471. stage-packages: [ filebeat ]
  1472. organize:
  1473. filebeat: bin/filebeat
  1474. nrpe:
  1475. plugin: dump
  1476. source: ./snap-wrappers/nrpe
  1477. organize:
  1478. nrpe: bin/nrpe
  1479. after: [ lma-build-prep ]
  1480. stage-packages: [ nagios-nrpe-server, nagios-nrpe-plugin, monitoring-plugins, monitoring-plugins-basic, monitoring-plugins-common ]
  1481. telegraf:
  1482. plugin: dump
  1483. source: ./snap-wrappers/telegraf
  1484. organize:
  1485. telegraf: bin/telegraf
  1486. # we use autotools plugin here because it brings git, make
  1487. # otherwise we'd have to add respective packages
  1488. after: [ lma-build-prep, qemu, libvirt ]
  1489. # See https://forum.snapcraft.io/t/patchelf-broke-my-binary/4928
  1490. # and https://bugs.launchpad.net/snapcraft/+bug/1753995
  1491. build-attributes: [no-patchelf]
  1492. stage-packages: [ telegraf, iproute2, bridge-utils, ethtool, fancontrol, libatm1, ipmitool, freeipmi-tools ]
  1493. lma-build-prep:
  1494. plugin: nil
  1495. source: ""
  1496. build-packages:
  1497. - dirmngr
  1498. override-build: |
  1499. cat $SNAPCRAFT_PROJECT_DIR/filebeat.pgp.key | apt-key add -
  1500. cat $SNAPCRAFT_PROJECT_DIR/telegraf.pgp.key | apt-key add -
  1501. apt-get install apt-transport-https
  1502. echo 'deb https://artifacts.elastic.co/packages/5.x/apt stable main' > /etc/apt/sources.list.d/elastic-5.x.list
  1503. echo 'deb http://ppa.launchpad.net/telegraf-devs/ppa/ubuntu bionic main' > /etc/apt/sources.list.d/telegraf.x.list
  1504. # this needs to be re-worked in order to be built in-place
  1505. echo 'deb http://ppa.launchpad.net/nikolay.vinogradov/nrpe-root/ubuntu bionic main' > /etc/apt/sources.list.d/nrpe-root.list
  1506. sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F767C80E0FC5C835
  1507. apt-get update --allow-unauthenticated
  1508. #lma-configs:
  1509. # plugin: dump
  1510. # source: ./lma
  1511. # after: [ lma-build-prep ]
  1512. # organize:
  1513. # 'config/nrpe': etc/nrpe
  1514. # 'config/telegraf': etc/telegraf
  1515. checks:
  1516. plugin: dump
  1517. source: ./checks
  1518. organize:
  1519. check_systemd.py: usr/lib/nagios/plugins/check_systemd.py
  1520. hooks:
  1521. install:
  1522. plugs: [ network ] # TODO: , microstack-support]
  1523. configure:
  1524. plugs: [ network ] # TODO:, microstack-support]
  1525. post-refresh:
  1526. plugs: [ network ] #, microstack-support]
  1527. remove:
  1528. # NOTE: network-bind is here due to LP: #1644573.
  1529. plugs:
  1530. - network
  1531. - network-bind
  1532. - network-control
  1533. - firewall-control
  1534. - hardware-observe
  1535. # TODO: - microstack-support
  1536. - block-devices