Skip to content

Commit 84932c6

Browse files
author
Patrick Donnelly
committed
teuthology/suite: wire in the graph representation
Reviewer's note: we will probably want to make the matrix representation a valid fallback using a command line switch. This is also important when doing reruns with subsets generated via the matrix representation. Signed-off-by: Patrick Donnelly <[email protected]>
1 parent d23fa11 commit 84932c6

File tree

2 files changed

+12
-16
lines changed

2 files changed

+12
-16
lines changed

teuthology/suite/merge.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -132,23 +132,17 @@ def config_merge(configs, suite_name=None, **kwargs):
132132

133133
yaml_complete_obj = copy.deepcopy(base_config.to_dict())
134134
deep_merge(yaml_complete_obj, dict(TEUTHOLOGY_TEMPLATE))
135-
for path in paths:
136-
if path not in yaml_cache:
137-
with open(path) as f:
138-
txt = f.read()
139-
yaml_cache[path] = (txt, yaml.safe_load(txt))
140-
141-
yaml_fragment_txt, yaml_fragment_obj = yaml_cache[path]
135+
for (path, yaml_fragment_obj) in paths:
142136
if yaml_fragment_obj is None:
143137
continue
144138
yaml_fragment_obj = copy.deepcopy(yaml_fragment_obj)
145139
premerge = yaml_fragment_obj.get('teuthology', {}).pop('premerge', '')
146140
if premerge:
147141
log.debug("premerge script running:\n%s", premerge)
148142
env, script = new_script(premerge, log, deep_merge, yaml.safe_load)
149-
env['base_frag_paths'] = [strip_fragment_path(x) for x in paths]
143+
env['base_frag_paths'] = [strip_fragment_path(path) for (path, yaml) in paths]
150144
env['description'] = desc
151-
env['frag_paths'] = paths
145+
env['frag_paths'] = [path for (path, yaml) in paths]
152146
env['suite_name'] = suite_name
153147
env['yaml'] = yaml_complete_obj
154148
env['yaml_fragment'] = yaml_fragment_obj
@@ -164,9 +158,9 @@ def config_merge(configs, suite_name=None, **kwargs):
164158
postmerge = "\n".join(postmerge)
165159
log.debug("postmerge script running:\n%s", postmerge)
166160
env, script = new_script(postmerge, log, deep_merge, yaml.safe_load)
167-
env['base_frag_paths'] = [strip_fragment_path(x) for x in paths]
161+
env['base_frag_paths'] = [strip_fragment_path(path) for (path, yaml) in paths]
168162
env['description'] = desc
169-
env['frag_paths'] = paths
163+
env['frag_paths'] = [path for (path, yaml) in paths]
170164
env['suite_name'] = suite_name
171165
env['yaml'] = yaml_complete_obj
172166
for k,v in kwargs.items():

teuthology/suite/run.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
from teuthology.suite import util
2323
from teuthology.suite.merge import config_merge
24-
from teuthology.suite.build_matrix import build_matrix
24+
from teuthology.suite.build_graph import build_graph
2525
from teuthology.suite.placeholder import substitute_placeholders, dict_templ
2626
from teuthology.util.time import parse_offset, parse_timestamp, TIMESTAMP_FMT
2727

@@ -627,10 +627,12 @@ def schedule_suite(self):
627627
if self.args.dry_run:
628628
log.debug("Base job config:\n%s" % self.base_config)
629629

630-
configs = build_matrix(suite_path,
631-
subset=self.args.subset,
632-
no_nested_subset=self.args.no_nested_subset,
633-
seed=self.args.seed)
630+
configs = build_graph(suite_path,
631+
subset=self.args.subset,
632+
no_nested_subset=self.args.no_nested_subset,
633+
seed=self.args.seed,
634+
suite_repo_path=self.suite_repo_path,
635+
config=config)
634636
generated = len(configs)
635637
log.info(f'Suite {suite_name} in {suite_path} generated {generated} jobs (not yet filtered or merged)')
636638
configs = list(config_merge(configs,

0 commit comments

Comments
 (0)