Skip to content

Gracefully degrade QC plot rendering failures - #26

Merged
m-reuter merged 1 commit into
Deep-MI:mainfrom
karl-koschutnig:fix/qc-plots-graceful-degradation
Aug 6, 2026
Merged

Gracefully degrade QC plot rendering failures#26
m-reuter merged 1 commit into
Deep-MI:mainfrom
karl-koschutnig:fix/qc-plots-graceful-degradation

Conversation

@karl-koschutnig

Copy link
Copy Markdown
Contributor

Summary

  • Wraps the lpp.plot_tria_mesh(...) / fig.write_image(...) calls in qcPlots() (mesh, profile, and hull stages) in try/except, so a rendering backend failure logs a warning and skips that image instead of aborting the whole run.
  • This addresses the "worse half" of QC plots fail in the 0.10.1 Docker image: "Kaleido requires Google Chrome to be installed" #24: a fully successful surface reconstruction is no longer discarded just because a QC PNG couldn't be rendered (e.g. kaleido 1.x requiring an external Chrome/Chromium binary). The kaleido/Chrome dependency question itself is left for separate follow-up, as discussed in the issue.

Ran ruff check and ruff format --check on the changed file per the maintainer's request.

Fixes #24

Test plan

  • ruff check hipsta/utils/qc_plots.py passes
  • ruff format --check hipsta/utils/qc_plots.py passes
  • Maintainers to confirm on a pipeline run where kaleido/Chrome is missing that the run now completes with a logged warning instead of aborting

Wrap the mesh/profile/hull rendering calls in qcPlots() in try/except
so a rendering backend failure (e.g. kaleido 1.x requiring Chrome)
logs a warning and skips that image instead of aborting a successful
surface reconstruction run.

Fixes Deep-MI#24
@m-reuter

m-reuter commented Aug 6, 2026

Copy link
Copy Markdown
Member

thanks for the contribution, looks good to me. Did you test this, e.g. you can map this file into the container and re-run? Would be great if you could do this, just to confirm we did not miss anything else. Thanks.

@karl-koschutnig

Copy link
Copy Markdown
Contributor Author

Yes — tested this against the actual `deepmi/hipsta:0.10.1` image (`kaleido 1.3.0`, `plotly 6.8.0`) using the reproducer from #24, mounting the patched `qc_plots.py` over the installed one:

  • Baseline (unpatched 0.10.1): reproduces the exact traceback from QC plots fail in the 0.10.1 Docker image: "Kaleido requires Google Chrome to be installed" #24 — crashes in `qcPlots()` at the mesh stage.
  • Patched: logs `[WARNING: qc_plots.py] Could not create QC plot for mesh stage: ...` and continues into `checkSurface()` instead of aborting. That particular subject's segmentation then hit an unrelated, pre-existing `AssertionError` ("Surface contains holes") — confirmed this also happens on the unpatched baseline with `--no-qc`, so it's a property of that segmentation, not something the patch introduced.
  • Ran a second subject through the full pipeline end-to-end (all three QC call sites — mesh/profile/hull) with the patch applied: all three log the same graceful warning, the `qc/` output directory ends up empty (as expected, since kaleido/Chrome still can't render), and the run finishes with `Hipsta finished without errors.`

So the try/except wrapping is confirmed working as intended — a rendering failure no longer discards a successful run, and I didn't see any other regressions during a full run.

Also opened #27 for the Docker Chrome install, since you mentioned being open to that as a separate stopgap — with that Dockerfile change, the same full pipeline run produces valid, non-empty QC PNGs at all three stages with no warnings, tested both as root and as a non-root `--user`.

@m-reuter
m-reuter merged commit 86d10c2 into Deep-MI:main Aug 6, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

QC plots fail in the 0.10.1 Docker image: "Kaleido requires Google Chrome to be installed"

2 participants