Kolla provides production-ready containers and deployment tools for operating OpenStack clouds
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.

1262 lines
42KB

  1. # Licensed under the Apache License, Version 2.0 (the "License");
  2. # you may not use this file except in compliance with the License.
  3. # You may obtain a copy of the License at
  4. #
  5. # http://www.apache.org/licenses/LICENSE-2.0
  6. #
  7. # Unless required by applicable law or agreed to in writing, software
  8. # distributed under the License is distributed on an "AS IS" BASIS,
  9. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. # See the License for the specific language governing permissions and
  11. # limitations under the License.
  12. import itertools
  13. import os
  14. from oslo_config import cfg
  15. from oslo_config import types
  16. from kolla.version import version_info as version
  17. BASE_OS_DISTRO = ['centos', 'rhel', 'ubuntu', 'oraclelinux', 'debian']
  18. BASE_ARCH = ['x86_64', 'ppc64le', 'aarch64']
  19. DEFAULT_BASE_TAGS = {
  20. 'centos': '7',
  21. 'rhel': '7',
  22. 'oraclelinux': '7-slim',
  23. 'debian': 'buster',
  24. 'ubuntu': '18.04',
  25. }
  26. DISTRO_RELEASE = {
  27. 'centos': '7',
  28. 'rhel': '7',
  29. 'oraclelinux': '7',
  30. 'debian': 'buster',
  31. 'ubuntu': '18.04',
  32. }
  33. # This is noarch repository so we will use it on all architectures
  34. DELOREAN = \
  35. "https://trunk.rdoproject.org/centos7/current-passed-ci/delorean.repo"
  36. DELOREAN_DEPS = "https://trunk.rdoproject.org/centos7/delorean-deps.repo"
  37. INSTALL_TYPE_CHOICES = ['binary', 'source', 'rdo', 'rhos']
  38. # TODO(mandre) check for file integrity instead of downloading from an HTTPS
  39. # source
  40. TARBALLS_BASE = "https://tarballs.openstack.org"
  41. _PROFILE_OPTS = [
  42. cfg.ListOpt('infra',
  43. default=[
  44. 'ceph',
  45. 'certmonger',
  46. 'cron',
  47. 'elasticsearch',
  48. 'etcd',
  49. 'fluentd',
  50. 'haproxy',
  51. 'keepalived',
  52. 'kibana',
  53. 'kolla-toolbox',
  54. 'logstash',
  55. 'mariadb',
  56. 'memcached',
  57. 'mongodb',
  58. 'opendaylight',
  59. 'openvswitch',
  60. 'ptp',
  61. 'qdrouterd',
  62. 'rabbitmq',
  63. 'redis',
  64. 'rsyslog',
  65. 'skydive',
  66. 'storm',
  67. 'tgtd',
  68. ],
  69. help='Infra images'),
  70. cfg.ListOpt('main',
  71. default=[
  72. 'ceilometer',
  73. 'cinder',
  74. 'glance',
  75. 'heat',
  76. 'horizon',
  77. 'iscsi',
  78. 'keystone',
  79. 'neutron',
  80. 'nova-',
  81. 'placement',
  82. 'swift',
  83. ],
  84. help='Main images'),
  85. cfg.ListOpt('aux',
  86. default=[
  87. 'almanach',
  88. 'aodh',
  89. 'blazar',
  90. 'cloudkitty',
  91. 'congress',
  92. 'designate',
  93. 'dragonflow',
  94. 'ec2-api',
  95. 'freezer',
  96. 'gnocchi',
  97. 'influxdb',
  98. 'ironic',
  99. 'kafka',
  100. 'karbor',
  101. 'kuryr',
  102. 'magnum',
  103. 'manila',
  104. 'mistral',
  105. 'monasca',
  106. 'murano',
  107. 'novajoin',
  108. 'octavia',
  109. 'panko',
  110. 'rally',
  111. 'redis',
  112. 'sahara',
  113. 'searchlight',
  114. 'senlin',
  115. 'solum',
  116. 'tacker',
  117. 'telegraf',
  118. 'trove',
  119. 'vitrage',
  120. 'zaqar',
  121. 'zookeeper',
  122. 'zun',
  123. ],
  124. help='Aux Images'),
  125. cfg.ListOpt('default',
  126. default=[
  127. 'chrony',
  128. 'cron',
  129. 'kolla-toolbox',
  130. 'fluentd',
  131. 'glance',
  132. 'haproxy',
  133. 'heat',
  134. 'horizon',
  135. 'keepalived',
  136. 'keystone',
  137. 'mariadb',
  138. 'memcached',
  139. 'neutron',
  140. 'nova-',
  141. 'placement',
  142. 'openvswitch',
  143. 'rabbitmq',
  144. ],
  145. help='Default images'),
  146. cfg.ListOpt('gate',
  147. default=[
  148. 'chrony',
  149. 'cron',
  150. 'fluentd',
  151. 'glance',
  152. 'haproxy',
  153. 'horizon',
  154. 'keepalived',
  155. 'keystone',
  156. 'kolla-toolbox',
  157. 'mariadb',
  158. 'memcached',
  159. 'neutron',
  160. 'nova-',
  161. 'placement',
  162. 'openvswitch',
  163. 'rabbitmq',
  164. ],
  165. help='Gate images')
  166. ]
  167. hostarch = os.uname()[4]
  168. _CLI_OPTS = [
  169. cfg.StrOpt('base', short='b', default='centos',
  170. choices=BASE_OS_DISTRO,
  171. help='The distro type of the base image.'),
  172. cfg.StrOpt('base-tag', default='latest',
  173. help='The base distro image tag'),
  174. cfg.StrOpt('base-image',
  175. help='The base image name. Default is the same with base.'),
  176. cfg.StrOpt('base-arch', default=hostarch,
  177. choices=BASE_ARCH,
  178. help='The base architecture. Default is same as host.'),
  179. cfg.BoolOpt('use-dumb-init', default=True,
  180. help='Use dumb-init as init system in containers'),
  181. cfg.BoolOpt('debug', short='d', default=False,
  182. help='Turn on debugging log level'),
  183. cfg.BoolOpt('skip-parents', default=False,
  184. help='Do not rebuild parents of matched images'),
  185. cfg.BoolOpt('skip-existing', default=False,
  186. help='Do not rebuild images present in the docker cache'),
  187. cfg.DictOpt('build-args',
  188. help='Set docker build time variables'),
  189. cfg.BoolOpt('keep', default=False,
  190. help='Keep failed intermediate containers'),
  191. cfg.BoolOpt('list-dependencies', short='l',
  192. help='Show image dependencies (filtering supported)'),
  193. cfg.BoolOpt('list-images',
  194. help='Show all available images (filtering supported)'),
  195. cfg.StrOpt('namespace', short='n', default='kolla',
  196. help='The Docker namespace name'),
  197. cfg.StrOpt('network_mode', default=None,
  198. help='The network mode for Docker build. Example: host'),
  199. cfg.BoolOpt('cache', default=True,
  200. help='Use the Docker cache when building'),
  201. cfg.MultiOpt('profile', types.String(), short='p',
  202. help=('Build a pre-defined set of images, see [profiles]'
  203. ' section in config. The default profiles are:'
  204. ' {}'.format(', '.join(
  205. [opt.name for opt in _PROFILE_OPTS])
  206. ))),
  207. cfg.BoolOpt('push', default=False,
  208. help='Push images after building'),
  209. cfg.IntOpt('push-threads', default=1, min=1,
  210. help=('The number of threads to user while pushing'
  211. ' Images. Note: Docker can not handle threading'
  212. ' push properly')),
  213. cfg.IntOpt('retries', short='r', default=3, min=0,
  214. help='The number of times to retry while building'),
  215. cfg.MultiOpt('regex', types.String(), positional=True,
  216. help=('Build only images matching regex and its'
  217. ' dependencies')),
  218. cfg.StrOpt('registry',
  219. help=('The docker registry host. The default registry host'
  220. ' is Docker Hub')),
  221. cfg.StrOpt('save-dependency',
  222. help=('Path to the file to store the docker image'
  223. ' dependency in Graphviz dot format')),
  224. cfg.StrOpt('format', short='f', default='json',
  225. choices=['json', 'none'],
  226. help='Format to write the final results in'),
  227. cfg.StrOpt('tarballs-base', default=TARBALLS_BASE,
  228. help='Base url to OpenStack tarballs'),
  229. cfg.StrOpt('type', short='t', default='binary',
  230. choices=INSTALL_TYPE_CHOICES,
  231. dest='install_type',
  232. help=('The method of the OpenStack install.')),
  233. cfg.IntOpt('threads', short='T', default=8, min=1,
  234. help=('The number of threads to use while building.'
  235. ' (Note: setting to one will allow real time'
  236. ' logging)')),
  237. cfg.StrOpt('tag', default=version.cached_version_string(),
  238. help='The Docker tag'),
  239. cfg.BoolOpt('template-only', default=False,
  240. help="Don't build images. Generate Dockerfile only"),
  241. cfg.IntOpt('timeout', default=120,
  242. help='Time in seconds after which any operation times out'),
  243. cfg.MultiOpt('template-override', types.String(),
  244. help='Path to template override file'),
  245. cfg.MultiOpt('docker-dir', types.String(),
  246. help=('Path to additional docker file template directory,'
  247. ' can be specified multiple times'),
  248. short='D', default=[]),
  249. cfg.StrOpt('logs-dir', help='Path to logs directory'),
  250. cfg.BoolOpt('pull', default=True,
  251. help='Attempt to pull a newer version of the base image'),
  252. cfg.StrOpt('work-dir', help=('Path to be used as working directory.'
  253. ' By default, a temporary dir is created')),
  254. cfg.BoolOpt('squash', default=False,
  255. help=('Squash the image layers. WARNING: it will consume lots'
  256. ' of disk IO. "docker-squash" tool is required, install'
  257. ' it by "pip install docker-squash"')),
  258. ]
  259. _BASE_OPTS = [
  260. cfg.StrOpt('maintainer',
  261. default='Kolla Project (https://launchpad.net/kolla)',
  262. help='Content of the maintainer label'),
  263. cfg.StrOpt('distro_package_manager', default=None,
  264. help=('Use this parameter to override the default package '
  265. 'manager used by kolla. For example, if you want to use '
  266. 'yum on a system with dnf, set this to yum which will '
  267. 'use yum command in the build process')),
  268. cfg.StrOpt('base_package_type', default=None,
  269. help=('Set the package type of the distro. If not set then '
  270. 'the packaging type is set to "rpm" if a RHEL based '
  271. 'distro and "deb" if a Debian based distro.')),
  272. cfg.ListOpt('rpm_setup_config', default=[],
  273. help=('Comma separated list of .rpm or .repo file(s) '
  274. 'or URL(s) to install before building containers')),
  275. cfg.StrOpt('apt_sources_list', help=('Path to custom sources.list')),
  276. cfg.StrOpt('apt_preferences', help=('Path to custom apt/preferences')),
  277. cfg.BoolOpt('squash-cleanup', default=True,
  278. help='Remove source image from Docker after squashing'),
  279. cfg.StrOpt('squash-tmp-dir',
  280. help='Temporary directory to be used during squashing'),
  281. cfg.BoolOpt('clean_package_cache', default=True,
  282. help='Clean all package cache.')
  283. ]
  284. SOURCES = {
  285. 'openstack-base': {
  286. 'type': 'url',
  287. 'location': ('$tarballs_base/requirements/'
  288. 'requirements-stable-stein.tar.gz')},
  289. 'almanach-base': {
  290. 'type': 'url',
  291. 'location': ('$tarballs_base/almanach/'
  292. 'almanach-4.1.0.tar.gz')},
  293. 'aodh-base': {
  294. 'type': 'url',
  295. 'location': ('$tarballs_base/aodh/'
  296. 'aodh-8.0.0.tar.gz')},
  297. 'barbican-base': {
  298. 'type': 'url',
  299. 'location': ('$tarballs_base/barbican/'
  300. 'barbican-8.0.0.tar.gz')},
  301. 'bifrost-base': {
  302. 'type': 'url',
  303. 'location': ('$tarballs_base/bifrost/'
  304. 'bifrost-6.0.2.tar.gz')},
  305. 'blazar-base': {
  306. 'type': 'url',
  307. 'location': ('$tarballs_base/blazar/'
  308. 'blazar-3.0.0.tar.gz')},
  309. 'ceilometer-base': {
  310. 'type': 'url',
  311. 'location': ('$tarballs_base/ceilometer/'
  312. 'ceilometer-12.0.0.tar.gz')},
  313. 'ceilometer-base-plugin-panko': {
  314. 'type': 'url',
  315. 'location': ('$tarballs_base/panko/'
  316. 'panko-6.0.0.tar.gz')},
  317. 'cinder-base': {
  318. 'type': 'url',
  319. 'location': ('$tarballs_base/cinder/'
  320. 'cinder-14.0.2.tar.gz')},
  321. 'congress-base': {
  322. 'type': 'url',
  323. 'location': ('$tarballs_base/congress/'
  324. 'openstack-congress-9.0.0.tar.gz')},
  325. 'cloudkitty-base': {
  326. 'type': 'url',
  327. 'location': ('$tarballs_base/cloudkitty/'
  328. 'cloudkitty-9.0.0.tar.gz')},
  329. 'crane': {
  330. 'type': 'url',
  331. 'location': ('https://github.com/pulp/crane/archive/3.3.0.tar.gz')},
  332. 'cyborg-base': {
  333. 'type': 'url',
  334. 'location': ('$tarballs_base/cyborg/'
  335. 'openstack-cyborg-2.0.0.tar.gz')},
  336. 'designate-base': {
  337. 'type': 'url',
  338. 'location': ('$tarballs_base/designate/'
  339. 'designate-8.0.0.tar.gz')},
  340. 'dragonflow-base': {
  341. 'type': 'url',
  342. 'location': ('$tarballs_base/dragonflow/'
  343. 'dragonflow-3.0.0.tar.gz')},
  344. 'ec2-api': {
  345. 'type': 'url',
  346. 'location': ('$tarballs_base/ec2-api/'
  347. 'ec2-api-8.0.0.tar.gz')},
  348. 'freezer-api': {
  349. 'type': 'url',
  350. 'location': ('$tarballs_base/freezer-api/'
  351. 'freezer-api-7.1.0.tar.gz')},
  352. 'freezer-base': {
  353. 'type': 'url',
  354. 'location': ('$tarballs_base/freezer/'
  355. 'freezer-7.1.0.tar.gz')},
  356. 'glance-base': {
  357. 'type': 'url',
  358. 'location': ('$tarballs_base/glance/'
  359. 'glance-18.0.0.tar.gz')},
  360. 'gnocchi-base': {
  361. 'type': 'git',
  362. 'reference': '4.3.2',
  363. 'location': ('https://github.com/gnocchixyz/'
  364. 'gnocchi.git')},
  365. 'heat-base': {
  366. 'type': 'url',
  367. 'location': ('$tarballs_base/heat/'
  368. 'openstack-heat-12.0.0.tar.gz')},
  369. 'horizon': {
  370. 'type': 'url',
  371. 'location': ('$tarballs_base/horizon/'
  372. 'horizon-15.1.1.tar.gz')},
  373. 'horizon-plugin-blazar-dashboard': {
  374. 'type': 'url',
  375. 'location': ('$tarballs_base/blazar-dashboard/'
  376. 'blazar-dashboard-1.3.0.tar.gz')},
  377. 'horizon-plugin-congress-dashboard': {
  378. 'type': 'url',
  379. 'location': ('$tarballs_base/congress-dashboard/'
  380. 'congress-dashboard-4.0.0.tar.gz')},
  381. 'horizon-plugin-cloudkitty-dashboard': {
  382. 'type': 'url',
  383. 'location': ('$tarballs_base/cloudkitty-dashboard/'
  384. 'cloudkitty-dashboard-8.1.0.tar.gz')},
  385. 'horizon-plugin-designate-dashboard': {
  386. 'type': 'url',
  387. 'location': ('$tarballs_base/designate-dashboard/'
  388. 'designate-dashboard-8.0.0.tar.gz')},
  389. 'horizon-plugin-fwaas-dashboard': {
  390. 'type': 'url',
  391. 'location': ('$tarballs_base/neutron-fwaas-dashboard/'
  392. 'neutron-fwaas-dashboard-2.0.1.tar.gz')},
  393. 'horizon-plugin-freezer-web-ui': {
  394. 'type': 'url',
  395. 'location': ('$tarballs_base/freezer-web-ui/'
  396. 'freezer-web-ui-7.1.0.tar.gz')},
  397. 'horizon-plugin-heat-dashboard': {
  398. 'type': 'url',
  399. 'location': ('$tarballs_base/heat-dashboard/'
  400. 'heat-dashboard-1.5.0.tar.gz')},
  401. 'horizon-plugin-ironic-ui': {
  402. 'type': 'url',
  403. 'location': ('$tarballs_base/ironic-ui/'
  404. 'ironic-ui-3.4.0.tar.gz')},
  405. 'horizon-plugin-karbor-dashboard': {
  406. 'type': 'url',
  407. 'location': ('$tarballs_base/karbor-dashboard/'
  408. 'karbor-dashboard-1.2.1.tar.gz')},
  409. 'horizon-plugin-magnum-ui': {
  410. 'type': 'url',
  411. 'location': ('$tarballs_base/magnum-ui/'
  412. 'magnum-ui-5.1.0.tar.gz')},
  413. 'horizon-plugin-manila-ui': {
  414. 'type': 'url',
  415. 'location': ('$tarballs_base/manila-ui/'
  416. 'manila-ui-2.18.1.tar.gz')},
  417. 'horizon-plugin-mistral-dashboard': {
  418. 'type': 'url',
  419. 'location': ('$tarballs_base/mistral-dashboard/'
  420. 'mistral-dashboard-8.1.0.tar.gz')},
  421. 'horizon-plugin-monasca-ui': {
  422. 'type': 'url',
  423. 'location': ('$tarballs_base/monasca-ui/'
  424. 'monasca-ui-1.15.0.tar.gz')},
  425. 'horizon-plugin-murano-dashboard': {
  426. 'type': 'url',
  427. 'location': ('$tarballs_base/murano-dashboard/'
  428. 'murano-dashboard-7.0.0.tar.gz')},
  429. 'horizon-plugin-neutron-lbaas-dashboard': {
  430. 'type': 'url',
  431. 'location': ('$tarballs_base/neutron-lbaas-dashboard/'
  432. 'neutron-lbaas-dashboard-6.0.0.tar.gz')},
  433. 'horizon-plugin-neutron-vpnaas-dashboard': {
  434. 'type': 'url',
  435. 'location': ('$tarballs_base/neutron-vpnaas-dashboard/'
  436. 'neutron-vpnaas-dashboard-1.5.1.tar.gz')},
  437. 'horizon-plugin-octavia-dashboard': {
  438. 'type': 'url',
  439. 'location': ('$tarballs_base/octavia-dashboard/'
  440. 'octavia-dashboard-3.0.1.tar.gz')},
  441. 'horizon-plugin-sahara-dashboard': {
  442. 'type': 'url',
  443. 'location': ('$tarballs_base/sahara-dashboard/'
  444. 'sahara-dashboard-10.0.1.tar.gz')},
  445. 'horizon-plugin-searchlight-ui': {
  446. 'type': 'url',
  447. 'location': ('$tarballs_base/searchlight-ui/'
  448. 'searchlight-ui-6.0.0.tar.gz')},
  449. 'horizon-plugin-senlin-dashboard': {
  450. 'type': 'url',
  451. 'location': ('$tarballs_base/senlin-dashboard/'
  452. 'senlin-dashboard-0.10.1.tar.gz')},
  453. 'horizon-plugin-solum-dashboard': {
  454. 'type': 'url',
  455. 'location': ('$tarballs_base/solum-dashboard/'
  456. 'solum-dashboard-2.6.0.tar.gz')},
  457. 'horizon-plugin-tacker-dashboard': {
  458. 'type': 'url',
  459. 'location': ('$tarballs_base/tacker-horizon/'
  460. 'tacker-horizon-0.14.0.tar.gz')},
  461. 'horizon-plugin-trove-dashboard': {
  462. 'type': 'url',
  463. 'location': ('$tarballs_base/trove-dashboard/'
  464. 'trove-dashboard-12.0.0.tar.gz')},
  465. 'horizon-plugin-vitrage-dashboard': {
  466. 'type': 'url',
  467. 'location': ('$tarballs_base/vitrage-dashboard/'
  468. 'vitrage-dashboard-1.9.1.tar.gz')},
  469. 'horizon-plugin-watcher-dashboard': {
  470. 'type': 'url',
  471. 'location': ('$tarballs_base/watcher-dashboard/'
  472. 'watcher-dashboard-1.12.0.tar.gz')},
  473. 'horizon-plugin-zaqar-ui': {
  474. 'type': 'url',
  475. 'location': ('$tarballs_base/zaqar-ui/'
  476. 'zaqar-ui-6.0.0.tar.gz')},
  477. 'horizon-plugin-zun-ui': {
  478. 'type': 'url',
  479. 'location': ('$tarballs_base/zun-ui/'
  480. 'zun-ui-3.0.1.tar.gz')},
  481. 'ironic-base': {
  482. 'type': 'url',
  483. 'location': ('$tarballs_base/ironic/'
  484. 'ironic-12.1.3.tar.gz')},
  485. 'ironic-inspector': {
  486. 'type': 'url',
  487. 'location': ('$tarballs_base/ironic-inspector/'
  488. 'ironic-inspector-8.2.3.tar.gz')},
  489. 'karbor-base': {
  490. 'type': 'url',
  491. 'location': ('$tarballs_base/karbor/'
  492. 'karbor-1.3.0.tar.gz')},
  493. 'keystone-base': {
  494. 'type': 'url',
  495. 'location': ('$tarballs_base/keystone/'
  496. 'keystone-15.0.0.tar.gz')},
  497. 'kuryr-base': {
  498. 'type': 'url',
  499. 'location': ('$tarballs_base/kuryr/'
  500. 'kuryr-lib-0.9.0.tar.gz')},
  501. 'kuryr-libnetwork': {
  502. 'type': 'url',
  503. 'location': ('$tarballs_base/kuryr-libnetwork/'
  504. 'kuryr-libnetwork-3.0.0.tar.gz')},
  505. 'magnum-base': {
  506. 'type': 'url',
  507. 'location': ('$tarballs_base/magnum/'
  508. 'magnum-8.2.0.tar.gz')},
  509. 'manila-base': {
  510. 'type': 'url',
  511. 'location': ('$tarballs_base/manila/'
  512. 'manila-8.1.0.tar.gz')},
  513. 'mistral-base': {
  514. 'type': 'url',
  515. 'location': ('$tarballs_base/mistral/'
  516. 'mistral-8.1.0.tar.gz')},
  517. 'mistral-base-plugin-tacker': {
  518. 'type': 'url',
  519. 'location': ('$tarballs_base/tacker/'
  520. 'tacker-1.0.0.tar.gz')},
  521. 'monasca-agent': {
  522. 'type': 'url',
  523. 'location': ('$tarballs_base/monasca-agent/'
  524. 'monasca-agent-2.10.0.tar.gz')},
  525. 'monasca-api': {
  526. 'type': 'url',
  527. 'location': ('$tarballs_base/monasca-api/'
  528. 'monasca-api-3.0.0.tar.gz')},
  529. 'monasca-log-api': {
  530. 'type': 'url',
  531. 'location': ('$tarballs_base/monasca-log-api/'
  532. 'monasca-log-api-2.9.0.tar.gz')},
  533. 'monasca-notification': {
  534. 'type': 'url',
  535. 'location': ('$tarballs_base/monasca-notification/'
  536. 'monasca-notification-1.17.0.tar.gz')},
  537. 'monasca-persister': {
  538. 'type': 'url',
  539. 'location': ('$tarballs_base/monasca-persister/'
  540. 'monasca-persister-1.14.0.tar.gz')},
  541. 'monasca-statsd': {
  542. 'type': 'url',
  543. 'location': ('$tarballs_base/monasca-statsd/'
  544. 'monasca-statsd-1.11.0.tar.gz')},
  545. # FIXME(dszumski): Use openstack tar when infra is fixed
  546. 'monasca-thresh': {
  547. 'type': 'url',
  548. 'location': ('https://github.com/openstack/monasca-thresh/archive/'
  549. '2.3.0.tar.gz')},
  550. 'monasca-thresh-additions-monasca-common': {
  551. 'type': 'url',
  552. 'location': ('$tarballs_base/monasca-common/'
  553. 'monasca-common-2.13.0.tar.gz')},
  554. 'murano-base': {
  555. 'type': 'url',
  556. 'location': ('$tarballs_base/murano/'
  557. 'murano-7.0.0.tar.gz')},
  558. 'neutron-base': {
  559. 'type': 'url',
  560. 'location': ('$tarballs_base/neutron/'
  561. 'neutron-14.0.3.tar.gz')},
  562. 'neutron-base-plugin-neutron-fwaas': {
  563. 'type': 'url',
  564. 'location': ('$tarballs_base/neutron-fwaas/'
  565. 'neutron-fwaas-14.0.0.tar.gz')},
  566. 'neutron-base-plugin-networking-ansible': {
  567. 'type': 'url',
  568. 'location': ('$tarballs_base/networking-ansible/'
  569. 'networking-ansible-1.1.0.tar.gz')},
  570. 'neutron-base-plugin-networking-baremetal': {
  571. 'type': 'url',
  572. 'location': ('$tarballs_base/networking-baremetal/'
  573. 'networking-baremetal-1.3.0.tar.gz')},
  574. 'neutron-base-plugin-networking-generic-switch': {
  575. 'type': 'url',
  576. 'location': ('$tarballs_base/networking-generic-switch/'
  577. 'networking-generic-switch-1.3.1.tar.gz')},
  578. 'neutron-base-plugin-networking-sfc': {
  579. 'type': 'url',
  580. 'location': ('$tarballs_base/networking-sfc/'
  581. 'networking-sfc-8.0.0.tar.gz')},
  582. 'neutron-base-plugin-vmware-nsx': {
  583. 'type': 'url',
  584. 'location': ('$tarballs_base/vmware-nsx/'
  585. 'vmware-nsx-master.tar.gz')},
  586. 'neutron-base-plugin-vpnaas-agent': {
  587. 'type': 'url',
  588. 'location': ('$tarballs_base/neutron-vpnaas/'
  589. 'neutron-vpnaas-14.0.0.tar.gz')},
  590. 'neutron-bgp-dragent': {
  591. 'type': 'url',
  592. 'location': ('$tarballs_base/neutron-dynamic-routing/'
  593. 'neutron-dynamic-routing-14.0.0.tar.gz')},
  594. 'neutron-lbaas-agent': {
  595. 'type': 'url',
  596. 'location': ('$tarballs_base/neutron-lbaas/'
  597. 'neutron-lbaas-14.0.1.tar.gz')},
  598. 'neutron-server-opendaylight-plugin-networking-odl': {
  599. 'type': 'url',
  600. 'location': ('$tarballs_base/networking-odl/'
  601. 'networking-odl-14.0.0.tar.gz')},
  602. 'neutron-server-opendaylight-plugin-networking-bgpvpn': {
  603. 'type': 'url',
  604. 'location': ('$tarballs_base/networking-bgpvpn/'
  605. 'networking-bgpvpn-10.0.0.tar.gz')},
  606. 'neutron-server-opendaylight-plugin-networking-l2gw': {
  607. 'type': 'url',
  608. 'location': ('$tarballs_base/networking-l2gw/'
  609. 'networking-l2gw-14.0.0.tar.gz')},
  610. 'neutron-server-opendaylight-plugin-networking-sfc': {
  611. 'type': 'url',
  612. 'location': ('$tarballs_base/networking-sfc/'
  613. 'networking-sfc-8.0.0.tar.gz')},
  614. 'neutron-server-plugin-networking-infoblox': {
  615. 'type': 'url',
  616. 'location': ('$tarballs_base/networking-infoblox/'
  617. 'networking-infoblox-12.0.0.tar.gz')},
  618. 'neutron-server-plugin-neutron-dynamic-routing': {
  619. 'type': 'url',
  620. 'location': ('$tarballs_base/neutron-dynamic-routing/'
  621. 'neutron-dynamic-routing-14.0.0.tar.gz')},
  622. 'neutron-server-plugin-neutron-lbaas': {
  623. 'type': 'url',
  624. 'location': ('$tarballs_base/neutron-lbaas/'
  625. 'neutron-lbaas-14.0.1.tar.gz')},
  626. 'neutron-server-plugin-vmware-nsxlib': {
  627. 'type': 'url',
  628. 'location': ('$tarballs_base/vmware-nsxlib/'
  629. 'vmware-nsxlib-13.1.0.tar.gz')},
  630. 'neutron-vpnaas-agent': {
  631. 'type': 'url',
  632. 'location': ('$tarballs_base/neutron-vpnaas/'
  633. 'neutron-vpnaas-14.0.0.tar.gz')},
  634. 'neutron-server-ovn-plugin-networking-ovn': {
  635. 'type': 'url',
  636. 'location': ('$tarballs_base/networking-ovn/'
  637. 'networking-ovn-6.0.0.tar.gz')},
  638. 'neutron-metadata-agent-ovn-plugin-networking-ovn': {
  639. 'type': 'url',
  640. 'location': ('$tarballs_base/networking-ovn/'
  641. 'networking-ovn-6.0.0.tar.gz')},
  642. 'nova-base': {
  643. 'type': 'url',
  644. 'location': ('$tarballs_base/nova/'
  645. 'nova-19.0.3.tar.gz')},
  646. 'nova-base-plugin-blazar': {
  647. 'type': 'url',
  648. 'location': ('$tarballs_base/blazar-nova/'
  649. 'blazar-nova-1.2.0.tar.gz')},
  650. 'nova-base-plugin-mksproxy': {
  651. 'type': 'url',
  652. 'location': ('$tarballs_base/nova-mksproxy/'
  653. 'nova-mksproxy-master.tar.gz')},
  654. 'novajoin-base': {
  655. 'type': 'url',
  656. 'location': ('$tarballs_base/novajoin/'
  657. 'novajoin-1.1.1.tar.gz')},
  658. 'octavia-base': {
  659. 'type': 'url',
  660. 'location': ('$tarballs_base/octavia/'
  661. 'octavia-4.1.1.tar.gz')},
  662. 'panko-base': {
  663. 'type': 'url',
  664. 'location': ('$tarballs_base/panko/'
  665. 'panko-6.0.0.tar.gz')},
  666. 'placement-base': {
  667. 'type': 'url',
  668. 'location': ('$tarballs_base/placement/'
  669. 'openstack-placement-1.1.0.tar.gz')},
  670. 'tempest-plugin-tempest-conf': {
  671. 'type': 'url',
  672. 'location': ('$tarballs_base/python-tempestconf/'
  673. 'python-tempestconf-2.1.0.tar.gz')},
  674. 'tempest-plugin-barbican': {
  675. 'type': 'url',
  676. 'location': ('$tarballs_base/barbican-tempest-plugin/'
  677. 'barbican_tempest_plugin-0.2.0.tar.gz')},
  678. 'tempest-plugin-blazar': {
  679. 'type': 'url',
  680. 'location': ('$tarballs_base/blazar-tempest-plugin/'
  681. 'blazar_tempest_plugin-0.2.0.tar.gz')},
  682. 'tempest-plugin-cinder': {
  683. 'type': 'url',
  684. 'location': ('$tarballs_base/cinder-tempest-plugin/'
  685. 'cinder_tempest_plugin-0.2.0.tar.gz')},
  686. 'tempest-plugin-congress': {
  687. 'type': 'url',
  688. 'location': ('$tarballs_base/congress-tempest-plugin/'
  689. 'congress-tempest-plugin-0.2.0.tar.gz')},
  690. 'tempest-plugin-ec2api': {
  691. 'type': 'url',
  692. 'location': ('$tarballs_base/ec2api-tempest-plugin/'
  693. 'ec2api-tempest-plugin-0.2.0.tar.gz')},
  694. 'tempest-plugin-heat': {
  695. 'type': 'url',
  696. 'location': ('$tarballs_base/heat-tempest-plugin/'
  697. 'heat-tempest-plugin-0.3.0.tar.gz')},
  698. 'tempest-plugin-ironic': {
  699. 'type': 'url',
  700. 'location': ('$tarballs_base/ironic-tempest-plugin/'
  701. 'ironic-tempest-plugin-1.3.0.tar.gz')},
  702. 'tempest-plugin-keystone': {
  703. 'type': 'url',
  704. 'location': ('$tarballs_base/keystone-tempest-plugin/'
  705. 'keystone_tempest_plugin-0.2.0.tar.gz')},
  706. 'tempest-plugin-magnum': {
  707. 'type': 'url',
  708. 'location': ('$tarballs_base/magnum-tempest-plugin/'
  709. 'magnum_tempest_plugin-0.2.0.tar.gz')},
  710. 'tempest-plugin-manila': {
  711. 'type': 'url',
  712. 'location': ('$tarballs_base/manila-tempest-plugin/'
  713. 'manila-tempest-plugin-0.3.0.tar.gz')},
  714. 'tempest-plugin-mistral': {
  715. 'type': 'url',
  716. 'location': ('$tarballs_base/mistral-tempest-plugin/'
  717. 'mistral_tempest_tests-0.2.0.tar.gz')},
  718. 'tempest-plugin-monasca': {
  719. 'type': 'url',
  720. 'location': ('$tarballs_base/monasca-tempest-plugin/'
  721. 'monasca-tempest-plugin-1.0.0.tar.gz')},
  722. 'tempest-plugin-murano': {
  723. 'type': 'url',
  724. 'location': ('$tarballs_base/murano-tempest-plugin/'
  725. 'murano-tempest-plugin-1.0.0.tar.gz')},
  726. 'tempest-plugin-neutron': {
  727. 'type': 'url',
  728. 'location': ('$tarballs_base/neutron-tempest-plugin/'
  729. 'neutron-tempest-plugin-0.3.0.tar.gz')},
  730. 'tempest-plugin-patrole': {
  731. 'type': 'url',
  732. 'location': ('$tarballs_base/patrole/'
  733. 'patrole-0.5.0.tar.gz')},
  734. 'tempest-plugin-telemetry': {
  735. 'type': 'url',
  736. 'location': ('$tarballs_base/telemetry-tempest-plugin/'
  737. 'telemetry_tempest_plugin-0.3.0.tar.gz')},
  738. 'tempest-plugin-tripleo-common': {
  739. 'type': 'url',
  740. 'location': ('$tarballs_base/tripleo-common-tempest-plugin/'
  741. 'tripleo-common-tempest-plugin-master.tar.gz')},
  742. 'tempest-plugin-trove': {
  743. 'type': 'url',
  744. 'location': ('$tarballs_base/trove-tempest-plugin/'
  745. 'trove_tempest_plugin-0.2.0.tar.gz')},
  746. 'tempest-plugin-vitrage': {
  747. 'type': 'url',
  748. 'location': ('$tarballs_base/vitrage-tempest-plugin/'
  749. 'vitrage-tempest-plugin-2.2.1.tar.gz')},
  750. 'tempest-plugin-watcher': {
  751. 'type': 'url',
  752. 'location': ('$tarballs_base/watcher-tempest-plugin/'
  753. 'watcher-tempest-plugin-1.1.0.tar.gz')},
  754. 'tempest-plugin-zaqar': {
  755. 'type': 'url',
  756. 'location': ('$tarballs_base/zaqar-tempest-plugin/'
  757. 'zaqar_tempest_plugin-0.2.0.tar.gz')},
  758. 'rally': {
  759. 'type': 'url',
  760. 'location': ('$tarballs_base/rally/'
  761. 'rally-1.4.1.tar.gz')},
  762. 'sahara-base': {
  763. 'type': 'url',
  764. 'location': ('$tarballs_base/sahara/'
  765. 'sahara-10.0.1.tar.gz')},
  766. 'sahara-base-plugin-ambari': {
  767. 'type': 'url',
  768. 'location': ('$tarballs_base/sahara-plugin-ambari/'
  769. 'sahara-plugin-ambari-1.0.0.tar.gz')},
  770. 'sahara-base-plugin-cdh': {
  771. 'type': 'url',
  772. 'location': ('$tarballs_base/sahara-plugin-cdh/'
  773. 'sahara-plugin-cdh-1.0.1.tar.gz')},
  774. 'sahara-base-plugin-mapr': {
  775. 'type': 'url',
  776. 'location': ('$tarballs_base/sahara-plugin-mapr/'
  777. 'sahara-plugin-mapr-1.0.1.tar.gz')},
  778. 'sahara-base-plugin-spark': {
  779. 'type': 'url',
  780. 'location': ('$tarballs_base/sahara-plugin-spark/'
  781. 'sahara-plugin-spark-1.0.0.tar.gz')},
  782. 'sahara-base-plugin-storm': {
  783. 'type': 'url',
  784. 'location': ('$tarballs_base/sahara-plugin-storm/'
  785. 'sahara-plugin-storm-1.0.0.tar.gz')},
  786. 'sahara-base-plugin-vanilla': {
  787. 'type': 'url',
  788. 'location': ('$tarballs_base/sahara-plugin-vanilla/'
  789. 'sahara-plugin-vanilla-1.0.0.tar.gz')},
  790. 'searchlight-base': {
  791. 'type': 'url',
  792. 'location': ('$tarballs_base/searchlight/'
  793. 'searchlight-6.0.0.tar.gz')},
  794. 'senlin-base': {
  795. 'type': 'url',
  796. 'location': ('$tarballs_base/senlin/'
  797. 'senlin-7.0.0.tar.gz')},
  798. 'solum-base': {
  799. 'type': 'url',
  800. 'location': ('$tarballs_base/solum/'
  801. 'solum-6.0.0.tar.gz')},
  802. 'swift-base': {
  803. 'type': 'url',
  804. 'location': ('$tarballs_base/swift/'
  805. 'swift-2.21.1.tar.gz')},
  806. 'tacker-base': {
  807. 'type': 'url',
  808. 'location': ('$tarballs_base/tacker/'
  809. 'tacker-1.0.0.tar.gz')},
  810. 'tacker-base-plugin-networking-sfc': {
  811. 'type': 'url',
  812. 'location': ('$tarballs_base/networking-sfc/'
  813. 'networking-sfc-8.0.0.tar.gz')},
  814. 'tempest': {
  815. 'type': 'url',
  816. 'location': ('$tarballs_base/tempest/'
  817. 'tempest-20.0.0.tar.gz')},
  818. 'tripleoclient': {
  819. 'type': 'url',
  820. 'location': ('$tarballs_base/python-tripleoclient/'
  821. 'tripleoclient-11.3.0.tar.gz')},
  822. 'tripleo-ui': {
  823. 'type': 'url',
  824. 'location': ('$tarballs_base/tripleo-ui/'
  825. 'tripleo-ui-10.3.0.tar.gz')},
  826. 'trove-base': {
  827. 'type': 'url',
  828. 'location': ('$tarballs_base/trove/'
  829. 'trove-11.0.0.tar.gz')},
  830. 'vitrage-base': {
  831. 'type': 'url',
  832. 'location': ('$tarballs_base/vitrage/'
  833. 'vitrage-4.3.1.tar.gz')},
  834. 'vmtp': {
  835. 'type': 'url',
  836. 'location': ('$tarballs_base/vmtp/'
  837. 'vmtp-2.5.0.tar.gz')},
  838. 'watcher-base': {
  839. 'type': 'url',
  840. 'location': ('$tarballs_base/watcher/'
  841. 'python-watcher-2.0.0.tar.gz')},
  842. 'zaqar-base': {
  843. 'type': 'url',
  844. 'location': ('$tarballs_base/zaqar/'
  845. 'zaqar-8.0.0.tar.gz')},
  846. 'zun-base': {
  847. 'type': 'url',
  848. 'location': ('$tarballs_base/zun/'
  849. 'zun-3.0.0.tar.gz')}
  850. }
  851. # NOTE(SamYaple): Only increment the UID. Never reuse old or removed UIDs.
  852. # Starting point 42400+ was chosen arbitrarily to ensure no conflicts
  853. USERS = {
  854. 'kolla-user': {
  855. 'uid': 42400,
  856. 'gid': 42400,
  857. },
  858. 'ansible-user': {
  859. 'uid': 42401,
  860. 'gid': 42401,
  861. },
  862. 'aodh-user': {
  863. 'uid': 42402,
  864. 'gid': 42402,
  865. },
  866. 'barbican-user': {
  867. 'uid': 42403,
  868. 'gid': 42403,
  869. },
  870. 'bifrost-user': {
  871. 'uid': 42404,
  872. 'gid': 42404,
  873. },
  874. 'ceilometer-user': {
  875. 'uid': 42405,
  876. 'gid': 42405,
  877. },
  878. 'chrony-user': {
  879. 'uid': 42406,
  880. 'gid': 42406,
  881. },
  882. 'cinder-user': {
  883. 'uid': 42407,
  884. 'gid': 42407,
  885. },
  886. 'cloudkitty-user': {
  887. 'uid': 42408,
  888. 'gid': 42408,
  889. },
  890. 'collectd-user': {
  891. 'uid': 42409,
  892. 'gid': 42409,
  893. },
  894. 'congress-user': {
  895. 'uid': 42410,
  896. 'gid': 42410,
  897. },
  898. 'designate-user': {
  899. 'uid': 42411,
  900. 'gid': 42411,
  901. },
  902. 'elasticsearch-user': {
  903. 'uid': 42412,
  904. 'gid': 42412,
  905. },
  906. 'etcd-user': {
  907. 'uid': 42413,
  908. 'gid': 42413,
  909. },
  910. 'freezer-user': {
  911. 'uid': 42414,
  912. 'gid': 42414,
  913. },
  914. 'glance-user': {
  915. 'uid': 42415,
  916. 'gid': 42415,
  917. },
  918. 'gnocchi-user': {
  919. 'uid': 42416,
  920. 'gid': 42416,
  921. },
  922. 'grafana-user': {
  923. 'uid': 42417,
  924. 'gid': 42417,
  925. },
  926. 'heat-user': {
  927. 'uid': 42418,
  928. 'gid': 42418,
  929. },
  930. 'horizon-user': {
  931. 'uid': 42420,
  932. 'gid': 42420,
  933. },
  934. 'influxdb-user': {
  935. 'uid': 42421,
  936. 'gid': 42421,
  937. },
  938. 'ironic-user': {
  939. 'uid': 42422,
  940. 'gid': 42422,
  941. },
  942. 'kafka-user': {
  943. 'uid': 42423,
  944. 'gid': 42423,
  945. },
  946. 'keystone-user': {
  947. 'uid': 42425,
  948. 'gid': 42425,
  949. },
  950. 'kibana-user': {
  951. 'uid': 42426,
  952. 'gid': 42426,
  953. },
  954. 'qemu-user': {
  955. 'uid': 42427,
  956. 'gid': 42427,
  957. },
  958. 'magnum-user': {
  959. 'uid': 42428,
  960. 'gid': 42428,
  961. },
  962. 'manila-user': {
  963. 'uid': 42429,
  964. 'gid': 42429,
  965. },
  966. 'mistral-user': {
  967. 'uid': 42430,
  968. 'gid': 42430,
  969. },
  970. 'monasca-user': {
  971. 'uid': 42431,
  972. 'gid': 42431,
  973. },
  974. 'mongodb-user': {
  975. 'uid': 42432,
  976. 'gid': 65534,
  977. },
  978. 'murano-user': {
  979. 'uid': 42433,
  980. 'gid': 42433,
  981. },
  982. 'mysql-user': {
  983. 'uid': 42434,
  984. 'gid': 42434,
  985. },
  986. 'neutron-user': {
  987. 'uid': 42435,
  988. 'gid': 42435,
  989. },
  990. 'nova-user': {
  991. 'uid': 42436,
  992. 'gid': 42436,
  993. },
  994. 'octavia-user': {
  995. 'uid': 42437,
  996. 'gid': 42437,
  997. },
  998. 'panko-user': {
  999. 'uid': 42438,
  1000. 'gid': 42438,
  1001. },
  1002. 'rabbitmq-user': {
  1003. 'uid': 42439,
  1004. 'gid': 42439,
  1005. },
  1006. 'rally-user': {
  1007. 'uid': 42440,
  1008. 'gid': 42440,
  1009. },
  1010. 'sahara-user': {
  1011. 'uid': 42441,
  1012. 'gid': 42441,
  1013. },
  1014. 'searchlight-user': {
  1015. 'uid': 42442,
  1016. 'gid': 42442,
  1017. },
  1018. 'senlin-user': {
  1019. 'uid': 42443,
  1020. 'gid': 42443,
  1021. },
  1022. 'solum-user': {
  1023. 'uid': 42444,
  1024. 'gid': 42444,
  1025. },
  1026. 'swift-user': {
  1027. 'uid': 42445,
  1028. 'gid': 42445,
  1029. },
  1030. 'tacker-user': {
  1031. 'uid': 42446,
  1032. 'gid': 42446,
  1033. },
  1034. 'td-agent-user': {
  1035. 'uid': 42447,
  1036. 'gid': 42447,
  1037. },
  1038. 'telegraf-user': {
  1039. 'uid': 42448,
  1040. 'gid': 42448,
  1041. },
  1042. 'trove-user': {
  1043. 'uid': 42449,
  1044. 'gid': 42449,
  1045. },
  1046. 'vmtp-user': {
  1047. 'uid': 42450,
  1048. 'gid': 42450,
  1049. },
  1050. 'watcher-user': {
  1051. 'uid': 42451,
  1052. 'gid': 42451,
  1053. },
  1054. 'zaqar-user': {
  1055. 'uid': 42452,
  1056. 'gid': 42452,
  1057. },
  1058. 'zookeeper-user': {
  1059. 'uid': 42453,
  1060. 'gid': 42453,
  1061. },
  1062. 'haproxy-user': {
  1063. 'uid': 42454,
  1064. 'gid': 42454,
  1065. },
  1066. 'ceph-user': {
  1067. 'uid': 64045,
  1068. 'gid': 64045,
  1069. },
  1070. 'memcached-user': {
  1071. 'uid': 42457,
  1072. 'gid': 42457,
  1073. },
  1074. 'karbor-user': {
  1075. 'uid': 42458,
  1076. 'gid': 42458,
  1077. },
  1078. 'vitrage-user': {
  1079. 'uid': 42459,
  1080. 'gid': 42459,
  1081. },
  1082. 'redis-user': {
  1083. 'uid': 42460,
  1084. 'gid': 42460,
  1085. },
  1086. 'ironic-inspector-user': {
  1087. 'uid': 42461,
  1088. 'gid': 42461,
  1089. },
  1090. 'odl-user': {
  1091. 'uid': 42462,
  1092. 'gid': 42462,
  1093. },
  1094. 'zun-user': {
  1095. 'uid': 42463,
  1096. 'gid': 42463,
  1097. },
  1098. 'dragonflow-user': {
  1099. 'uid': 42464,
  1100. 'gid': 42464,
  1101. },
  1102. 'qdrouterd-user': {
  1103. 'uid': 42465,
  1104. 'gid': 42465,
  1105. },
  1106. 'ec2api-user': {
  1107. 'uid': 42466,
  1108. 'gid': 42466,
  1109. },
  1110. 'sensu-user': {
  1111. 'uid': 42467,
  1112. 'gid': 42467,
  1113. },
  1114. 'skydive-user': {
  1115. 'uid': 42468,
  1116. 'gid': 42468,
  1117. },
  1118. 'kuryr-user': {
  1119. 'uid': 42469,
  1120. 'gid': 42469,
  1121. },
  1122. 'novajoin-user': {
  1123. 'uid': 42470,
  1124. 'gid': 42470,
  1125. },
  1126. 'blazar-user': {
  1127. 'uid': 42471,
  1128. 'gid': 42471,
  1129. },
  1130. 'prometheus-user': {
  1131. 'uid': 42472,
  1132. 'gid': 42472,
  1133. },
  1134. 'libvirt-user': {
  1135. 'uid': 42473, # unused user, but we need the group for socket access
  1136. 'gid': 42473,
  1137. },
  1138. 'fluentd-user': {
  1139. 'uid': 42474,
  1140. 'gid': 42474,
  1141. },
  1142. 'almanach-user': {
  1143. 'uid': 42475,
  1144. 'gid': 42475,
  1145. },
  1146. 'openvswitch-user': {
  1147. 'uid': 42476, # unused user
  1148. 'gid': 42476,
  1149. },
  1150. 'hugetlbfs-user': {
  1151. 'uid': 42477, # unused user, but we need the group for vhost socket
  1152. 'gid': 42477,
  1153. },
  1154. 'logstash-user': {
  1155. 'uid': 42478,
  1156. 'gid': 42478,
  1157. },
  1158. 'storm-user': {
  1159. 'uid': 42479,
  1160. 'gid': 42479,
  1161. },
  1162. 'tempest-user': {
  1163. 'uid': 42480,
  1164. 'gid': 42480,
  1165. },
  1166. 'nfast-user': {
  1167. 'uid': 42481, # unused user, but we need the group for thales hsm
  1168. 'gid': 42481,
  1169. },
  1170. 'placement-user': {
  1171. 'uid': 42482,
  1172. 'gid': 42482,
  1173. },
  1174. 'cyborg-user': {
  1175. 'uid': 42483,
  1176. 'gid': 42483,
  1177. }
  1178. }
  1179. def get_source_opts(type_=None, location=None, reference=None):
  1180. return [cfg.StrOpt('type', choices=['local', 'git', 'url'],
  1181. default=type_,
  1182. help='Source location type'),
  1183. cfg.StrOpt('location', default=location,
  1184. help='The location for source install'),
  1185. cfg.StrOpt('reference', default=reference,
  1186. help=('Git reference to pull, commit sha, tag '
  1187. 'or branch name'))]
  1188. def get_user_opts(uid, gid):
  1189. return [
  1190. cfg.IntOpt('uid', default=uid, help='The user id'),
  1191. cfg.IntOpt('gid', default=gid, help='The group id'),
  1192. ]
  1193. def gen_all_user_opts():
  1194. for name, params in USERS.items():
  1195. uid = params['uid']
  1196. gid = params['gid']
  1197. yield name, get_user_opts(uid, gid)
  1198. def gen_all_source_opts():
  1199. for name, params in SOURCES.items():
  1200. type_ = params['type']
  1201. location = params['location']
  1202. reference = params.get('reference')
  1203. yield name, get_source_opts(type_, location, reference)
  1204. def list_opts():
  1205. return itertools.chain([(None, _CLI_OPTS),
  1206. (None, _BASE_OPTS),
  1207. ('profiles', _PROFILE_OPTS)],
  1208. gen_all_source_opts(),
  1209. gen_all_user_opts(),
  1210. )
  1211. def parse(conf, args, usage=None, prog=None,
  1212. default_config_files=None):
  1213. conf.register_cli_opts(_CLI_OPTS)
  1214. conf.register_opts(_BASE_OPTS)
  1215. conf.register_opts(_PROFILE_OPTS, group='profiles')
  1216. for name, opts in gen_all_source_opts():
  1217. conf.register_opts(opts, name)
  1218. for name, opts in gen_all_user_opts():
  1219. conf.register_opts(opts, name)
  1220. conf(args=args,
  1221. project='kolla',
  1222. usage=usage,
  1223. prog=prog,
  1224. version=version.cached_version_string(),
  1225. default_config_files=default_config_files)
  1226. # NOTE(jeffrey4l): set the default base tag based on the
  1227. # base option
  1228. conf.set_default('base_tag', DEFAULT_BASE_TAGS.get(conf.base))
  1229. if not conf.base_image:
  1230. conf.base_image = conf.base