Merge lp:~thedac/openstack-mojo-specs/rendered into lp:openstack-mojo-specs

Proposed by David Ames
Status: Work in progress
Proposed branch: lp:~thedac/openstack-mojo-specs/rendered
Merge into: lp:openstack-mojo-specs
Diff against target: 680 lines (+515/-1)
30 files modified
helper/tests/simple_os_checks.py (+0/-1)
rendered/POC_README.md (+30/-0)
rendered/base/SPEC_INFO.txt (+1/-0)
rendered/bundle-merge.py (+61/-0)
rendered/collect (+17/-0)
rendered/example_override_stage/collect (+18/-0)
rendered/example_override_stage/manifest (+25/-0)
rendered/example_stage/stage-bundle-overrides.yaml (+8/-0)
rendered/example_stage/stage-collect (+2/-0)
rendered/example_stage/stage-collect-manifest (+2/-0)
rendered/example_stage/stage-operations-manifest (+3/-0)
rendered/example_stage/stage-validation-manifest (+3/-0)
rendered/ha/SPEC_INFO.txt (+12/-0)
rendered/ha/preflight.py (+41/-0)
rendered/ha/stage-bundle-overrides.yaml (+117/-0)
rendered/juju-wait.sh (+6/-0)
rendered/l3ha/SPEC_INFO.txt (+3/-0)
rendered/l3ha/preflight.py (+33/-0)
rendered/l3ha/stage-bundle-overrides.yaml (+11/-0)
rendered/l3ha/stage-validation-manifest (+2/-0)
rendered/manifest (+37/-0)
rendered/preflight.py (+36/-0)
rendered/render.sh (+22/-0)
rendered/setup-manifest (+8/-0)
rendered/ssl/SPEC_INFO.txt (+1/-0)
rendered/ssl/stage-bundle-overrides.yaml (+8/-0)
rendered/stage-collect-manifest (+1/-0)
rendered/stage-operations-manifest (+1/-0)
rendered/stage-validation-manifest (+1/-0)
rendered/validation-manifest (+5/-0)
To merge this branch: bzr merge lp:~thedac/openstack-mojo-specs/rendered
Reviewer Review Type Date Requested Status
OpenStack Charm Testing Maintainers Pending
Review via email: mp+319489@code.launchpad.net

Description of the change

Master bundle render proof of concept spec

The rendered specs demonstrate a method to render a collected bundle on the
fly for a mojo spec.

Highlights:

* Bundles, utilities and helpers can all be collected from upstream sources in
flight and used by the mojo spec. Bundles can be rendered from a master source
and merged with stage specific overrides. This will include the ability to add
HA vip overrides.

* This method significantly reduces duplication in individual spec directories.
Only what is needed to override the defaults is required in the stage
directory. The rendered top level directory is not quite as "clean" but it
reduces redundancy and the need for sym links (almost) entirely.

* This method leverages mojo's search path algorithm which checks the most
specific to least specific and overrides with the most specific configuration,
manifest or script file.

* This method leverages mojo's manifest file inclusion capabilities to define
discrete repeatable multi-step processes that can be shared by all stages or
overridden as required.

* This method can also live side by side with the sym link versions until all are
converted.

To post a comment you must log in.
306. By David Ames

HA with VIPs from the environment

307. By David Ames

Generic names for specs

As we will be generating on the fly next or stable soures. We do not need
to name specs next_* or stable_*.

Add ssl spec

308. By David Ames

Use render bundle tool

Unmerged revisions

308. By David Ames

Use render bundle tool

307. By David Ames

Generic names for specs

As we will be generating on the fly next or stable soures. We do not need
to name specs next_* or stable_*.

Add ssl spec

306. By David Ames

HA with VIPs from the environment

305. By David Ames

Master bundle render proof of concept spec

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added symlink 'helper/tests/images.yaml'
2=== target is u'../setup/images.yaml'
3=== modified file 'helper/tests/simple_os_checks.py'
4--- helper/tests/simple_os_checks.py 2016-10-03 10:21:13 +0000
5+++ helper/tests/simple_os_checks.py 2017-03-14 16:40:53 +0000
6@@ -64,7 +64,6 @@
7
8 priv_key = mojo_os_utils.create_keypair(novac, 'mojo')
9 mojo_os_utils.add_secgroup_rules(novac)
10- print(novac.servers.list())
11 for server in novac.servers.list():
12 novac.servers.delete(server.id)
13 for instanceset in machines:
14
15=== added directory 'rendered'
16=== added file 'rendered/POC_README.md'
17--- rendered/POC_README.md 1970-01-01 00:00:00 +0000
18+++ rendered/POC_README.md 2017-03-14 16:40:53 +0000
19@@ -0,0 +1,30 @@
20+General
21+=======
22+
23+Master bundle render proof of concept spec
24+
25+The rendered specs demonstrate a method to render a collected bundle on the
26+fly for a mojo spec.
27+
28+Highlights:
29+
30+* Bundles, utilities and helpers can all be collected from upstream sources in
31+flight and used by the mojo spec. Bundles can be rendered from a master source
32+and merged with stage specific overrides. This will include the ability to add
33+HA vip overrides.
34+
35+* This method significantly reduces duplication in individual spec directories.
36+Only what is needed to override the defaults is required in the stage
37+directory. The rendered top level directory is not quite as "clean" but it
38+reduces redundancy and the need for sym links (almost) entirely.
39+
40+* This method leverages mojo's search path algorithm which checks the most
41+specific to least specific and overrides with the most specific configuration,
42+manifest or script file.
43+
44+* This method leverages mojo's manifest file inclusion capabilities to define
45+discrete repeatable multi-step processes that can be shared by all stages or
46+overridden as required.
47+
48+* This method can also live side by side with the sym link versions until all are
49+converted.
50
51=== added directory 'rendered/base'
52=== added file 'rendered/base/SPEC_INFO.txt'
53--- rendered/base/SPEC_INFO.txt 1970-01-01 00:00:00 +0000
54+++ rendered/base/SPEC_INFO.txt 2017-03-14 16:40:53 +0000
55@@ -0,0 +1,1 @@
56+Openstack Base Bundle
57
58=== added file 'rendered/bundle-merge.py'
59--- rendered/bundle-merge.py 1970-01-01 00:00:00 +0000
60+++ rendered/bundle-merge.py 2017-03-14 16:40:53 +0000
61@@ -0,0 +1,61 @@
62+#!/usr/bin/python
63+
64+import argparse
65+import logging
66+import os
67+import yaml
68+
69+# TODO: Add this to the bunde_reducer tool or whatever it becomes
70+
71+
72+def get_yaml_dict(filename):
73+ if os.path.isfile(filename):
74+ with open(filename) as yamlfile:
75+ try:
76+ return yaml.load(yamlfile)
77+ except yaml.parser.ParserError as e:
78+ logging.error("Invalid YAML:{}".format(e))
79+ except yaml.constructor.ConstructorError as e:
80+ logging.error("Invalid YAML: Likely templating "
81+ "{{{{variable}}}} breaking YAML".format(e))
82+ else:
83+ logging.error("Not a file:", filename)
84+
85+
86+def main():
87+ parser = argparse.ArgumentParser(description=__doc__)
88+ parser.add_argument('-p', '--primary', required=True)
89+ parser.add_argument('-o', '--override', required=True)
90+ parser.add_argument('-d', '--destination', default="merged.yaml")
91+ args = parser.parse_args()
92+
93+ primary_data = get_yaml_dict(args.primary)
94+ override_data = get_yaml_dict(args.override)
95+
96+ # We can not rely on a simple update at the top level.
97+ # We need to be specific at the parameter level.
98+ if 'services' in override_data:
99+ for charm in override_data['services']:
100+ if primary_data['services'].get(charm):
101+ for param in override_data['services'][charm]:
102+ try:
103+ (primary_data['services'][charm][param]
104+ .update(override_data['services'][charm][param]))
105+ except KeyError:
106+ primary_data['services'][charm][param] = (
107+ override_data['services'][charm][param])
108+ else:
109+ primary_data['services'][charm] = (
110+ override_data['services'][charm])
111+
112+ # XXX: This is additive only
113+ # TODO: This will need to be smarter
114+ if 'relations' in override_data:
115+ primary_data['relations'].extend(override_data['relations'])
116+
117+ with open(args.destination, 'w') as dest:
118+ dest.write(yaml.dump(primary_data))
119+
120+
121+if __name__ == "__main__":
122+ main()
123
124=== added file 'rendered/collect'
125--- rendered/collect 1970-01-01 00:00:00 +0000
126+++ rendered/collect 2017-03-14 16:40:53 +0000
127@@ -0,0 +1,17 @@
128+# Top level collect
129+# Gather resources all stages will use
130+
131+# Collect master bundle and bunde_reducer.py
132+openstack-bundles git://github.com/thedac/openstack-bundles;revno=poc
133+
134+# Collect all helpers
135+juju-wait git://git.launchpad.net/~thedac/juju-wait;revno=alt-binaries
136+
137+# This could include the entire helpers directory
138+# helper git://some-new-source
139+
140+# We can grab individual files from github if necessary
141+#render.sh https://raw.githubusercontent.com/thedac/openstack-bundles/render/tools/bundle_reducer.py
142+
143+# TODO Bug in mojo requires one charm. Will fix.
144+ampq-client cs:~thedac/amqp-client
145
146=== added directory 'rendered/example_override_stage'
147=== added file 'rendered/example_override_stage/collect'
148--- rendered/example_override_stage/collect 1970-01-01 00:00:00 +0000
149+++ rendered/example_override_stage/collect 2017-03-14 16:40:53 +0000
150@@ -0,0 +1,18 @@
151+# Override collect
152+# This collect will run rather than the top level one
153+
154+
155+# Collect master bundle and bunde_reducer.py
156+openstack-bundles git://github.com/thedac/openstack-bundles;revno=poc
157+
158+# Collect all helpers
159+juju-wait git://git.launchpad.net/~thedac/juju-wait;revno=alt-binaries
160+
161+# This could include the entire helpers directory
162+# helper git://some-new-source
163+
164+# We can grab individual files from github if necessary
165+#render.sh https://raw.githubusercontent.com/thedac/openstack-bundles/render/tools/bundle_reducer.py
166+
167+# TODO Bug in mojo requires one charm. Will fix.
168+ampq-client cs:~thedac/amqp-client
169
170=== added file 'rendered/example_override_stage/manifest'
171--- rendered/example_override_stage/manifest 1970-01-01 00:00:00 +0000
172+++ rendered/example_override_stage/manifest 2017-03-14 16:40:53 +0000
173@@ -0,0 +1,25 @@
174+## By naming this 'manifest' it overrides the top level manifest
175+## Any other manifest or script can be overrriden in like maner
176+
177+# Collect everthing we need including tooling
178+collect
179+
180+# Collect stage specific resources
181+include config=stage-collect-manifest
182+
183+# Render the bundle based on env variables
184+script config=render.sh
185+
186+# Deploy with the rendered bundle
187+deploy config=bundle.yaml delay=0 wait=False
188+
189+# Wait for deploy to settle
190+verify config=juju-wait.sh
191+
192+# Stage specific operations
193+include config=stage-operations-manifest
194+
195+# Stage specific operations
196+include config=stage-validation-manifest
197+
198+# Success
199
200=== added directory 'rendered/example_stage'
201=== added file 'rendered/example_stage/stage-bundle-overrides.yaml'
202--- rendered/example_stage/stage-bundle-overrides.yaml 1970-01-01 00:00:00 +0000
203+++ rendered/example_stage/stage-bundle-overrides.yaml 2017-03-14 16:40:53 +0000
204@@ -0,0 +1,8 @@
205+# We can use stage specific yaml bits that can be consumed by
206+# render.sh and/or juju-deployer
207+# Only add what is different
208+
209+services:
210+ keystone:
211+ options:
212+ openstack-origin: cloud:xenial-newton/proposed
213
214=== added file 'rendered/example_stage/stage-collect'
215--- rendered/example_stage/stage-collect 1970-01-01 00:00:00 +0000
216+++ rendered/example_stage/stage-collect 2017-03-14 16:40:53 +0000
217@@ -0,0 +1,2 @@
218+# Stage specific collect
219+bespoke-resource bespoke-source
220
221=== added file 'rendered/example_stage/stage-collect-manifest'
222--- rendered/example_stage/stage-collect-manifest 1970-01-01 00:00:00 +0000
223+++ rendered/example_stage/stage-collect-manifest 2017-03-14 16:40:53 +0000
224@@ -0,0 +1,2 @@
225+# Stage specific collect
226+collect config=stage-collect
227
228=== added file 'rendered/example_stage/stage-operations-manifest'
229--- rendered/example_stage/stage-operations-manifest 1970-01-01 00:00:00 +0000
230+++ rendered/example_stage/stage-operations-manifest 2017-03-14 16:40:53 +0000
231@@ -0,0 +1,3 @@
232+# Stage specific operations
233+
234+# Do something bespoke
235
236=== added file 'rendered/example_stage/stage-validation-manifest'
237--- rendered/example_stage/stage-validation-manifest 1970-01-01 00:00:00 +0000
238+++ rendered/example_stage/stage-validation-manifest 2017-03-14 16:40:53 +0000
239@@ -0,0 +1,3 @@
240+# Stage specific validation
241+
242+# Do bespoke validation
243
244=== added directory 'rendered/ha'
245=== added file 'rendered/ha/SPEC_INFO.txt'
246--- rendered/ha/SPEC_INFO.txt 1970-01-01 00:00:00 +0000
247+++ rendered/ha/SPEC_INFO.txt 2017-03-14 16:40:53 +0000
248@@ -0,0 +1,12 @@
249+This spec performs an HA deploy in one shot (not phased).
250+It requires that the following are exported into the
251+environment:
252+MOJO_OS_VIP01
253+MOJO_OS_VIP02
254+MOJO_OS_VIP03
255+MOJO_OS_VIP04
256+MOJO_OS_VIP05
257+MOJO_OS_VIP06
258+MOJO_OS_VIP07
259+MOJO_OS_VIP08
260+MOJO_OS_VIP09
261
262=== added file 'rendered/ha/preflight.py'
263--- rendered/ha/preflight.py 1970-01-01 00:00:00 +0000
264+++ rendered/ha/preflight.py 2017-03-14 16:40:53 +0000
265@@ -0,0 +1,41 @@
266+#!/usr/bin/python
267+
268+import logging
269+import os
270+import sys
271+
272+
273+# Import the top level preflight
274+sys.path.insert(0,
275+ os.path.dirname(
276+ os.path.dirname(__file__)))
277+import preflight
278+
279+
280+REQUIRED = [
281+ 'MOJO_OS_VIP01',
282+ 'MOJO_OS_VIP02',
283+ 'MOJO_OS_VIP03',
284+ 'MOJO_OS_VIP04',
285+ 'MOJO_OS_VIP05',
286+ 'MOJO_OS_VIP06',
287+ 'MOJO_OS_VIP07',
288+ 'MOJO_OS_VIP08',
289+ 'MOJO_OS_VIP09',
290+]
291+
292+
293+logging.info("Running stage specific pre-flight check for environment "
294+ "variables")
295+for var in REQUIRED:
296+ if os.environ.get(var) is None:
297+ raise preflight.MissingEnvVariableExeption(
298+ "The variable, {}, is missing from the environment.\n"
299+ "Make sure all required variables in the {} "
300+ "script are available before running mojo\n\n"
301+ "Required: {}"
302+ "".format(var, os.path.basename(__file__),
303+ ", ".join(preflight.REQUIRED + REQUIRED)))
304+
305+logging.debug("All stage specific required environment variables successfully "
306+ "found.")
307
308=== added file 'rendered/ha/stage-bundle-overrides.yaml'
309--- rendered/ha/stage-bundle-overrides.yaml 1970-01-01 00:00:00 +0000
310+++ rendered/ha/stage-bundle-overrides.yaml 2017-03-14 16:40:53 +0000
311@@ -0,0 +1,117 @@
312+# Add new relations
313+relations:
314+- - percona-cluster
315+ - percona-cluster-hacluster
316+- - keystone
317+ - keystone-hacluster
318+- - nova-cloud-controller
319+ - nova-cc-hacluster
320+- - cinder
321+ - cinder-hacluster
322+- - glance
323+ - glance-hacluster
324+- - openstack-dashboard
325+ - dashboard-hacluster
326+- - ceilometer
327+ - ceilometer-hacluster
328+- - swift-proxy
329+ - swift-hacluster
330+
331+services:
332+
333+ # Update existing services
334+ # Use Variables to set values
335+ ceilometer:
336+ num_units: 3
337+ options:
338+ vip: "{{ MOJO_OS_VIP07 }}"
339+ cinder:
340+ num_units: 3
341+ options:
342+ vip: "{{ MOJO_OS_VIP05 }}"
343+ glance:
344+ num_units: 3
345+ options:
346+ vip: "{{ MOJO_OS_VIP09 }}"
347+ keystone:
348+ num_units: 3
349+ options:
350+ vip: "{{ MOJO_OS_VIP02 }}"
351+ percona-cluster:
352+ num_units: 3
353+ options:
354+ vip: "{{ MOJO_OS_VIP01 }}"
355+ neutron-api:
356+ num_units: 3
357+ options:
358+ vip: "{{ MOJO_OS_VIP08 }}"
359+ nova-cloud-controller:
360+ num_units: 3
361+ options:
362+ vip: "{{ MOJO_OS_VIP04 }}"
363+ openstack-dashboard:
364+ num_units: 3
365+ options:
366+ vip: "{{ MOJO_OS_VIP03 }}"
367+ rabbitmq-server:
368+ num_units: 3
369+ swift-proxy:
370+ num_units: 3
371+ options:
372+ vip: "{{ MOJO_OS_VIP06 }}"
373+
374+ # Add new services
375+ ceilometer-hacluster:
376+ charm: "cs:~openstack-charmers-next/{{ MOJO_SERIES }}/hacluster"
377+ series: "{{ MOJO_SERIES }}"
378+ options:
379+ cluster_count: 3
380+ corosync_transport: unicast
381+ cinder-hacluster:
382+ charm: "cs:~openstack-charmers-next/{{ MOJO_SERIES }}/hacluster"
383+ series: "{{ MOJO_SERIES }}"
384+ options:
385+ cluster_count: 3
386+ corosync_transport: unicast
387+ dashboard-hacluster:
388+ charm: "cs:~openstack-charmers-next/{{ MOJO_SERIES }}/hacluster"
389+ series: "{{ MOJO_SERIES }}"
390+ options:
391+ cluster_count: 3
392+ corosync_transport: unicast
393+ glance-hacluster:
394+ charm: "cs:~openstack-charmers-next/{{ MOJO_SERIES }}/hacluster"
395+ series: "{{ MOJO_SERIES }}"
396+ options:
397+ cluster_count: 3
398+ corosync_transport: unicast
399+ keystone-hacluster:
400+ charm: "cs:~openstack-charmers-next/{{ MOJO_SERIES }}/hacluster"
401+ series: "{{ MOJO_SERIES }}"
402+ options:
403+ cluster_count: 3
404+ corosync_transport: unicast
405+ neutron-hacluster:
406+ charm: "cs:~openstack-charmers-next/{{ MOJO_SERIES }}/hacluster"
407+ series: "{{ MOJO_SERIES }}"
408+ options:
409+ cluster_count: 3
410+ corosync_transport: unicast
411+ nova-cc-hacluster:
412+ charm: "cs:~openstack-charmers-next/{{ MOJO_SERIES }}/hacluster"
413+ series: "{{ MOJO_SERIES }}"
414+ options:
415+ cluster_count: 3
416+ corosync_transport: unicast
417+ percona-cluster-hacluster:
418+ charm: "cs:~openstack-charmers-next/{{ MOJO_SERIES }}/hacluster"
419+ series: "{{ MOJO_SERIES }}"
420+ options:
421+ cluster_count: 3
422+ corosync_transport: unicast
423+ swift-hacluster:
424+ charm: "cs:~openstack-charmers-next/{{ MOJO_SERIES }}/hacluster"
425+ series: "{{ MOJO_SERIES }}"
426+ options:
427+ corosync_transport: unicast
428+ cluster_count: 3
429
430=== added file 'rendered/juju-wait.sh'
431--- rendered/juju-wait.sh 1970-01-01 00:00:00 +0000
432+++ rendered/juju-wait.sh 2017-03-14 16:40:53 +0000
433@@ -0,0 +1,6 @@
434+#!/bin/bash
435+
436+# TODO: We can make the timeout an env variable.
437+# Maybe it already is in OSCI.
438+# Call upstream juju-wait with correct switches
439+${MOJO_BUILD_DIR}/juju-wait/juju-wait -t 2700 -w -v
440
441=== added directory 'rendered/l3ha'
442=== added file 'rendered/l3ha/SPEC_INFO.txt'
443--- rendered/l3ha/SPEC_INFO.txt 1970-01-01 00:00:00 +0000
444+++ rendered/l3ha/SPEC_INFO.txt 2017-03-14 16:40:53 +0000
445@@ -0,0 +1,3 @@
446+This spec deploys with neutron L3 HA (VRRP) enabled.
447+It requires that NETWORK_TOPOLOGY=vrrpha is exported into the
448+environment.
449
450=== added file 'rendered/l3ha/preflight.py'
451--- rendered/l3ha/preflight.py 1970-01-01 00:00:00 +0000
452+++ rendered/l3ha/preflight.py 2017-03-14 16:40:53 +0000
453@@ -0,0 +1,33 @@
454+#!/usr/bin/python
455+
456+import logging
457+import os
458+import sys
459+
460+
461+# Import the top level preflight
462+sys.path.insert(0,
463+ os.path.dirname(
464+ os.path.dirname(__file__)))
465+import preflight
466+
467+
468+REQUIRED = [
469+ 'NET_TOPOLOGY'
470+]
471+
472+
473+logging.info("Running stage specific pre-flight check for environment "
474+ "variables")
475+for var in REQUIRED:
476+ if os.environ.get(var) is None:
477+ raise preflight.MissingEnvVariableExeption(
478+ "The variable, {}, is missing from the environment.\n"
479+ "Make sure all required variables in the {} "
480+ "script are available before running mojo\n\n"
481+ "Required: {}"
482+ "".format(var, os.path.basename(__file__),
483+ ", ".join(preflight.REQUIRED + REQUIRED)))
484+
485+logging.debug("All stage specific required environment variables successfully "
486+ "found.")
487
488=== added file 'rendered/l3ha/stage-bundle-overrides.yaml'
489--- rendered/l3ha/stage-bundle-overrides.yaml 1970-01-01 00:00:00 +0000
490+++ rendered/l3ha/stage-bundle-overrides.yaml 2017-03-14 16:40:53 +0000
491@@ -0,0 +1,11 @@
492+services:
493+ neutron-api:
494+ options:
495+ overlay-network-type: 'vxlan'
496+ l2-population: False
497+ neutron-security-groups: True
498+ enable-dvr: False
499+ enable-l3ha: True
500+ flat-network-providers: physnet1
501+ neutron-gateway:
502+ num_units: 2
503
504=== added file 'rendered/l3ha/stage-validation-manifest'
505--- rendered/l3ha/stage-validation-manifest 1970-01-01 00:00:00 +0000
506+++ rendered/l3ha/stage-validation-manifest 2017-03-14 16:40:53 +0000
507@@ -0,0 +1,2 @@
508+# Test guest connectivity after stopping and starting gateway
509+verify config=../../helper/tests/test_vrrp_ha.py
510
511=== added file 'rendered/manifest'
512--- rendered/manifest 1970-01-01 00:00:00 +0000
513+++ rendered/manifest 2017-03-14 16:40:53 +0000
514@@ -0,0 +1,37 @@
515+# Run pre-flight to check if we have all the right variables in the environment
516+script config=preflight.py
517+
518+# Collect everthing we need including tooling
519+collect
520+
521+## TODO: simple mojo change will allow using $MOJO_BUILD_DIR
522+## to call collected scripts directly from the manifest
523+##script config=${MOJO_BUILD_DIR}/hello.sh
524+
525+# Collect stage specific resources
526+include config=stage-collect-manifest
527+
528+# Render the bundle based on env variables
529+script config=render.sh
530+
531+# Deploy with the rendered bundle
532+## In theory we could use local=override-file.yaml but without a target=
533+## juju-deployer gets confused
534+deploy config=bundle.yaml delay=0 wait=False
535+
536+# Wait for deploy to settle
537+verify config=juju-wait.sh
538+
539+# Setup the cloud
540+include config=setup-manifest
541+
542+# Validate the cloud
543+include config=validation-manifest
544+
545+# Stage specific operations
546+include config=stage-operations-manifest
547+
548+# Stage specific operations
549+include config=stage-validation-manifest
550+
551+# Success
552
553=== added file 'rendered/preflight.py'
554--- rendered/preflight.py 1970-01-01 00:00:00 +0000
555+++ rendered/preflight.py 2017-03-14 16:40:53 +0000
556@@ -0,0 +1,36 @@
557+#!/usr/bin/python
558+
559+import logging
560+import os
561+
562+
563+REQUIRED = [
564+ 'MOJO_OS_RELEASE',
565+ 'MOJO_STAGE',
566+ 'MOJO_WORKSPACE',
567+ 'MOJO_PROJECT',
568+ 'MOJO_SERIES',
569+ 'MOJO_SPEC',
570+ 'OS_REGION_NAME',
571+ 'OS_PASSWORD',
572+ 'OS_AUTH_URL',
573+ 'OS_USERNAME',
574+ 'OS_TENANT_NAME',
575+]
576+
577+
578+class MissingEnvVariableExeption(Exception):
579+ pass
580+
581+logging.info("Running pre-flight check for environment variables")
582+for var in REQUIRED:
583+ if os.environ.get(var) is None:
584+ raise MissingEnvVariableExeption(
585+ "The variable, {}, is missing from the environment.\n"
586+ "Make sure all required variables in the {} "
587+ "script are available before running mojo\n\n"
588+ "Required: {}"
589+ "".format(var, os.path.basename(__file__),
590+ ", ".join(REQUIRED)))
591+
592+logging.debug("All required environment variables successfully found.")
593
594=== added file 'rendered/render.sh'
595--- rendered/render.sh 1970-01-01 00:00:00 +0000
596+++ rendered/render.sh 2017-03-14 16:40:53 +0000
597@@ -0,0 +1,22 @@
598+#!/bin/bash
599+
600+# Render a bundle given environment variables
601+# This can be expanded for more permutations
602+
603+# XXX Note: we are passing MOJO_OS_RELEASE as an env variable
604+# which releases us from the tedious directory structure
605+
606+# TODO: More complex operations can be exeucted
607+
608+if [ -z "$MOJO_SOURCE" ]; then
609+ MOJO_SOURCE="next"
610+fi
611+
612+# Render collected bundle
613+${MOJO_BUILD_DIR}/openstack-bundles/tools/render_bundle.py \
614+ -b ${MOJO_BUILD_DIR}/openstack-bundles/render/source_bundle.yaml \
615+ -t ${MOJO_SERIES}-${MOJO_OS_RELEASE} \
616+ -src $MOJO_SOURCE \
617+ -o ${MOJO_SPEC_DIR}/${MOJO_STAGE}/stage-bundle-overrides.yaml \
618+ -d ${MOJO_SPEC_DIR}/${MOJO_STAGE}/bundle.yaml \
619+ -l DEBUG
620
621=== added file 'rendered/setup-manifest'
622--- rendered/setup-manifest 1970-01-01 00:00:00 +0000
623+++ rendered/setup-manifest 2017-03-14 16:40:53 +0000
624@@ -0,0 +1,8 @@
625+# Create sdn on overcloud
626+script config=../helper/setup/network_setup.py
627+
628+# Setup glance images
629+script config=../helper/setup/image_setup.py
630+
631+# Setup keystone users
632+script config=../helper/setup/keystone_setup.py
633
634=== added directory 'rendered/ssl'
635=== added file 'rendered/ssl/SPEC_INFO.txt'
636--- rendered/ssl/SPEC_INFO.txt 1970-01-01 00:00:00 +0000
637+++ rendered/ssl/SPEC_INFO.txt 2017-03-14 16:40:53 +0000
638@@ -0,0 +1,1 @@
639+This spec performs a non-ha deploy with ssl enabled.
640
641=== added file 'rendered/ssl/stage-bundle-overrides.yaml'
642--- rendered/ssl/stage-bundle-overrides.yaml 1970-01-01 00:00:00 +0000
643+++ rendered/ssl/stage-bundle-overrides.yaml 2017-03-14 16:40:53 +0000
644@@ -0,0 +1,8 @@
645+services:
646+ rabbitmq-server:
647+ options:
648+ ssl: "only"
649+ keystone:
650+ options:
651+ https-service-endpoints: "True"
652+ use-https: "yes"
653
654=== added file 'rendered/stage-collect-manifest'
655--- rendered/stage-collect-manifest 1970-01-01 00:00:00 +0000
656+++ rendered/stage-collect-manifest 2017-03-14 16:40:53 +0000
657@@ -0,0 +1,1 @@
658+## noop stage collect manifest
659
660=== added file 'rendered/stage-operations-manifest'
661--- rendered/stage-operations-manifest 1970-01-01 00:00:00 +0000
662+++ rendered/stage-operations-manifest 2017-03-14 16:40:53 +0000
663@@ -0,0 +1,1 @@
664+## noop stage operations manifest
665
666=== added file 'rendered/stage-validation-manifest'
667--- rendered/stage-validation-manifest 1970-01-01 00:00:00 +0000
668+++ rendered/stage-validation-manifest 2017-03-14 16:40:53 +0000
669@@ -0,0 +1,1 @@
670+## noop stage validation manifest
671
672=== added file 'rendered/validation-manifest'
673--- rendered/validation-manifest 1970-01-01 00:00:00 +0000
674+++ rendered/validation-manifest 2017-03-14 16:40:53 +0000
675@@ -0,0 +1,5 @@
676+# Create 1 * tiny cirros and 1 * small trusty instances on the overcloud
677+verify config=../helper/tests/simple_os_checks.py MACHINES='cirros:m1.tiny:1 trusty:m1.small:1' CLOUDINIT_WAIT="300"
678+
679+# Test obj store by sending and recieving files
680+verify config=../helper/tests/test_obj_store.py

Subscribers

People subscribed via source and target branches