Skip to content

Use plotly insead of graphviz with adjustment with lobster new version#514

Open
TannazVhdBMWExt wants to merge 7 commits intomainfrom
feature/lobster-html-report-using-graphviz-library-november-nv
Open

Use plotly insead of graphviz with adjustment with lobster new version#514
TannazVhdBMWExt wants to merge 7 commits intomainfrom
feature/lobster-html-report-using-graphviz-library-november-nv

Conversation

@TannazVhdBMWExt
Copy link
Contributor

No description provided.

@TannazVhdBMWExt TannazVhdBMWExt force-pushed the feature/lobster-html-report-using-graphviz-library-november-nv branch 2 times, most recently from 387df9a to 90b527e Compare November 17, 2025 14:34
@phiwuu phiwuu force-pushed the feature/lobster-html-report-using-graphviz-library-november-nv branch from 90b527e to 66d76d2 Compare November 18, 2025 10:45
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file seems to be completely new. Is it a mistake?

README.md Outdated

```
$ sudo apt-get install -y graphviz
$ sudo apt-get install -y plotly
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this will fail because Plotly is not an Ubuntu package. Please verify


def add_arrow_label(
fig: go.Figure, start: Tuple, end: Tuple,
ctrl: Optional[Tuple] = None, text: str = "", font_size: int = 11
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add the font_size value in the constants?

font={"size": font_size, "color": "black"},
align="center",
bgcolor="white",
opacity=0.85,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add the opacity value in the constants?

@@ -34,81 +34,12 @@
height: 24px;
vertical-align: middle;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not using this file anywhere.

html
)
# Normalize timestamps - replace dynamic timestamps with static placeholder
html = re.sub(
Copy link
Contributor

@SurajBDeore SurajBDeore Nov 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion:
Compile regex patterns at module level it is faster than recompiling on every call

from tests_system.lobster_html_report.lobster_UI_system_test_case_base import (
LobsterUISystemTestCaseBase)
from tests_system.asserter import Asserter
from tests_system.lobster_html_report.\
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the same approach in all files. In the other file you are importing it. like
from tests_system.lobster_html_report.lobster_UI_system_asserter import (
LobsterUIAsserter as Asserter)

output = "custom_data_tracing_policy.html"
input_file = self._data_directory / "custom_data_report.lobster"

self.output_dir = self.create_output_directory_and_copy_expected(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is not required?

@SurajBDeore
Copy link
Contributor

@TannazVhdBMWExt
Some checks are not running please check this. I have reviewed this PR once the checks succeed, I will review it again.

@TannazVhdBMWExt TannazVhdBMWExt force-pushed the feature/lobster-html-report-using-graphviz-library-november-nv branch 2 times, most recently from e9de4ff to 94e2438 Compare November 26, 2025 14:46
commit 946f102
Author: Tannaz Vahidi (ext.) <Tannaz.Vahidi@partner.bmw.de>
Date:   Thu Nov 6 18:21:28 2025 +0100

    Adjustments to new version of lobster
    Update unit/system tests and solve merge conflicts

commit d3c09e8
Author: Tannaz Vahidi (ext.) <Tannaz.Vahidi@partner.bmw.de>
Date:   Fri Jul 25 10:43:44 2025 +0200

    Add plotly diagram to lobster-html-report

    Replacing graphviz and dot with plotly.
@TannazVhdBMWExt TannazVhdBMWExt force-pushed the feature/lobster-html-report-using-graphviz-library-november-nv branch from 57a63cf to d35520c Compare November 26, 2025 14:48
requirements.bzl Outdated
"flask": "@flask//:lib",
"GitPython": "@gitpython//:lib",
"kaleido": "@kaleido//:lib",
"kaleido": "@kaleido_py3//:lib",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please correct this and use the newer version of kaleido

@TannazVhdBMWExt TannazVhdBMWExt force-pushed the feature/lobster-html-report-using-graphviz-library-november-nv branch 2 times, most recently from 8d874ef to fc7f54f Compare December 2, 2025 09:24
@SurajBDeore
Copy link
Contributor

@TannazVhdBMWExt
If we are not using Graphviz anywhere, then we need to remove it from docs.yaml.

- name: Install graphviz

There are also some SVGs in the documentation folder that are generated by Graphviz. Please check those as well.

@tannazVahidiVispiron
Copy link

After debugging the reason of hanging the system_tests on windows, we figured it out:

The fact that kaleido can be imported confirms it's installed, but it doesn't prevent the underlying kaleido subprocess from hanging on complex diagrams. This is a known issue with the library.

The multiprocessing code with the timeout is the correct way to handle this

1.Executes the line fig.to_image(format="svg").

2.Launch Subprocess: The plotly library doesn't render the image in your main Python process. Instead, it finds the kaleido executable file that was installed by pip and launches it as a completely separate subprocess. This executable contains its own miniature, built-in Chromium rendering engine.

3.Send Data: Your main Python script serializes your Plotly figure (fig) into a structured JSON format. It then sends this JSON data to the kaleido subprocess through its standard input (stdin).

4.Kaleido Renders: The kaleido subprocess receives the JSON. It uses its internal Chromium engine to render the figure and create the SVG image. This is the critical step where the hang occurs. For complex diagrams, this internal engine can get stuck in a loop or encounter a bug, causing it to stop processing without crashing or sending an error.

5.Python Waits: Back in your main script, the fig.to_image() function is now paused, simply waiting for the kaleido subprocess to send the finished SVG data back through its standard output (stdout).

Why It Hangs Indefinitely
The problem is that your Python process has no insight into what the kaleido subprocess is doing. It's just waiting for data. If the kaleido subprocess gets stuck at Step 4, your Python process will wait forever at Step 5.

This is why a standard try...except block in Python fails to catch the issue—no exception is ever raised in the Python code. The process is just waiting, which is not considered an error.

The multiprocessing solution works because it creates a third process that acts as a "watchdog." It watches the image-generation process and forcefully terminates it if it doesn't finish within the 15-second timeout, preventing your entire application from freezing.

@TannazVhdBMWExt TannazVhdBMWExt force-pushed the feature/lobster-html-report-using-graphviz-library-november-nv branch 2 times, most recently from 37215e2 to 2c86790 Compare December 12, 2025 11:12
@TannazVhdBMWExt TannazVhdBMWExt force-pushed the feature/lobster-html-report-using-graphviz-library-november-nv branch from 839cf88 to 795daf9 Compare January 12, 2026 07:39
@TannazVhdBMWExt TannazVhdBMWExt force-pushed the feature/lobster-html-report-using-graphviz-library-november-nv branch from eaf327e to 5470df4 Compare January 12, 2026 10:00
SurajBDeore and others added 2 commits January 12, 2026 11:16
Automatically create output directories for all LOBSTER tools to prevent
crashes when paths don't exist

Issue: SWF-20884
@TannazVhdBMWExt TannazVhdBMWExt marked this pull request as ready for review January 12, 2026 11:24
@TannazVhdBMWExt TannazVhdBMWExt requested a review from a team as a code owner January 12, 2026 11:24
@SurajBDeore
Copy link
Contributor

SurajBDeore commented Feb 2, 2026

@TannazVhdBMWExt

  1. GitHub Actions Workflow NOT Updated
  2. Update API documentation to remove dot_path parameter
  3. The repository still contains .dot files (Are these still used for documentation purposes, or can they be removed?)
  4. I am not able to generate html report locally also not getting any error message

@phiwuu
Copy link
Member

phiwuu commented Feb 4, 2026

@TannazVhdBMWExt

  1. GitHub Actions Workflow NOT Updated
  2. Update API documentation to remove dot_path parameter
  3. The repository still contains .dot files (Are these still used for documentation purposes, or can they be removed?)
  4. I am not able to generate html report locally also not getting any error message

Hi @SurajBDeore, thanks for your review.
As a comment to your point nr. 4, you are talking about files like https://github.com/bmw-software-engineering/lobster/blob/312f7a7d7099199092e9470f1d1c57b907b92452/documentation/simple.dot
This file is being used in the documentation, see https://github.com/bmw-software-engineering/lobster/blob/312f7a7d7099199092e9470f1d1c57b907b92452/documentation/simple.svg and

![Simple Tracing Policy](simple.svg)

Conclusion: These .dot files must remain and are not related to the removal of the dot tool from lobster-html-report.

"PyYAML>=6.0",
"yamale>=6.0.0",
"GitPython>=3.1.30",
"plotly==5.10.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to include kaleido?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I think so

@phiwuu
Copy link
Member

phiwuu commented Feb 4, 2026

I was able to generate an HTML report using Linux. I did not test on other OS, though.

@SurajBDeore
Copy link
Contributor

I tried generating the HTML report on Windows, but it was not generated. To confirm the issue, I also tried using a different system with this PR, but the HTML report is still not working.

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.

4 participants