Skip to content

Commit 109386a

Browse files
committed
Run 'butler ingest-graph' in QBB runs.
1 parent 939dcbd commit 109386a

4 files changed

Lines changed: 36 additions & 5 deletions

File tree

data/SConscript

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ rc2 = (
102102
where="instrument='HSC'",
103103
extra_qg_args=["--data-id-table", "resource://lsst.ci.middleware/data/data_ids.ecsv"],
104104
)
105-
.add("step1", where="instrument='HSC' AND exposure NOT IN (18202, 96980)")
105+
.add("step1", where="instrument='HSC' AND exposure NOT IN (18202, 96980)", ingest_graph=False)
106106
# Add more side runs to check --extend-run and --clobber-outputs.
107107
.add_side_run(
108108
"test-clobber-without-skip",
@@ -139,6 +139,7 @@ rc2 = (
139139
where="skymap='ci_mw' AND tract=0",
140140
group="attempt1",
141141
fail=['''consolidateForcedSourceTable::"skymap='ci_mw' AND tract=0"'''],
142+
ingest_graph=False,
142143
)
143144
.add("step5", where="skymap='ci_mw' AND tract=0", group="attempt2", skip_existing_in_last=True)
144145
.add("step6")
@@ -166,8 +167,9 @@ prod = (
166167
group="i-attempt1",
167168
where="band='i'",
168169
fail=['''calibrateImage::"instrument='HSC' AND visit=18202"'''],
170+
ingest_graph=False
169171
)
170-
.add("step1", group="i-attempt2", where="band='i'", skip_existing_in_last=True)
172+
.add("step1", group="i-attempt2", where="band='i'", skip_existing_in_last=True, ingest_graph=False)
171173
.add("step2a", group="r", where="band='r'")
172174
.add("step2a", group="i", where="band='i'")
173175
.add("step2b", group="even", where="skymap='ci_mw' AND tract IN (0, 2)")

python/lsst/ci/middleware/scons.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ def add(
187187
fail: Sequence[str] = (),
188188
skip_existing_in_last: bool = False,
189189
auto_retry_mem: tuple[str, str] | None = None,
190+
ingest_graph: bool = True,
190191
) -> PipelineCommands:
191192
"""Add a new QuantumGraph and its execution to the build.
192193
@@ -217,6 +218,10 @@ def add(
217218
``fail`` setting that causes the first attempt for one or more
218219
quanta to simulate an out-of-memory failure for the first value
219220
only, effectively testing BPS auto-retry logic.
221+
ingest_graph : `bool`, optional
222+
Whether to ingest the provenance quantum graph (only for QBB right
223+
now). Must be `False` if a side run with ``extend_run=True`` will
224+
be added.
220225
221226
Returns
222227
-------
@@ -252,6 +257,7 @@ def add(
252257
output_run=output_run,
253258
expect_failure=bool(fail),
254259
auto_retry_mem=auto_retry_mem,
260+
ingest_graph=ingest_graph,
255261
)
256262
self.last_output_run = output_run
257263
return self
@@ -626,6 +632,7 @@ def _add_qbb(
626632
pre_exec_init: bool = True,
627633
auto_retry_mem: tuple[str, str] | None = None,
628634
raise_on_partial_outputs: bool = False,
635+
ingest_graph: bool = True,
629636
) -> File:
630637
"""Make an SCons target for direct execution of the quantum graph
631638
with ``pipetask run-qbb`` and `lsst.daf.butler.QuantumBackedButler`.
@@ -648,6 +655,9 @@ def _add_qbb(
648655
raise_on_partial_outputs : `bool`, optional
649656
If `True`, pass ``--raise-on-partial-outputs`` to
650657
``pipetask run-qbb``.
658+
ingest_graph : `bool`, optional
659+
Whether to ingest the provenance quantum graph. Must be `False` if
660+
a side run will use ``extend_run=True``.
651661
652662
Returns
653663
-------
@@ -718,6 +728,23 @@ def _add_qbb(
718728
"-o",
719729
"${TARGETS[2]}",
720730
"--mock-storage-classes",
731+
*(["--promise-ingest-graph"] if ingest_graph else [])
732+
),
733+
python_cmd(
734+
BUTLER_BIN,
735+
"--long-log",
736+
"--log-level",
737+
"VERBOSE",
738+
"--log-file",
739+
f"data/{log}",
740+
"--no-log-tty",
741+
"ingest-graph",
742+
repo_in_cmd,
743+
"${TARGETS[2]}",
744+
"--batch-size",
745+
"50",
746+
"-t",
747+
"copy",
721748
),
722749
tar_repo_cmd(repo_in_cmd, "${TARGETS[0]}"),
723750
]

tests/test_ci_hsc_outputs.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def setUp(self) -> None:
5454

5555
def test_direct_qbb_equivalence(self) -> None:
5656
"""Test that the direct and QBB runs produce exactly the same
57-
collections, dataset types, and datasets."""
57+
collections, dataset types, and datasets (except for provenance)."""
5858
self.assertEqual(
5959
list(
6060
self.direct.butler.registry.queryCollections(
@@ -69,7 +69,8 @@ def test_direct_qbb_equivalence(self) -> None:
6969
)
7070
self.assertEqual(
7171
set(self.direct.butler.registry.queryDatasetTypes(...)),
72-
set(self.qbb.butler.registry.queryDatasetTypes(...)),
72+
set(self.qbb.butler.registry.queryDatasetTypes(...))
73+
- {self.qbb.butler.get_dataset_type("run_provenance")},
7374
)
7475
self.assertEqual(
7576
set(self.direct.butler.registry.queryDatasets(get_mock_name("isr_config"))),

tests/test_prod_outputs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,8 @@ def check_step1_qpg(self, helper: OutputRepoTests) -> None:
240240
for message in quantum_summary.messages:
241241
self.assertIsInstance(message, str)
242242
self.assertTrue(
243-
message.startswith("Execution of task '_mock_calibrateImage' on quantum")
243+
message.startswith("Execution of task '_mock_calibrateImage' on quantum"),
244+
message
244245
)
245246
self.assertIn(
246247
"Exception ValueError: Simulated failure: task=_mock_calibrateImage", message

0 commit comments

Comments
 (0)