How to Publish Simulink Model Comparisons Without a Display in Linux?

14 visualizzazioni (ultimi 30 giorni)
When I attempt to publish a simulink model comparison in an Ubuntu CICD pipeline (Gitlab), I receive incomplete .html files in the output folder and the following error message:
"Error using slxmlcomp.SimulinkModelComparison/publish. Printing is not supported in -nodisplay mode."
My .yml file's job uses the command
matlab -batch "mySlxComparisonScript"
to call the visdiff and publish functions:
comparison = visdiff('target.slx', 'source.slx');
publish(comparison, Name='foo', OutputFolder="bar/");
When I run the same batch command on my local Windows machine, the comparison reports are published as expected without errors. This may mean that the publish behavior is different in Linux vs Windows. I cannot find any MathWorks documentation for slxmlcomp objects, SimulinkModelComparison objects, or using the publish command for these objects. Any workarounds, help, or insights are appreciated.

Risposta accettata

MathWorks Support Team
MathWorks Support Team il 2 Mag 2023
Before R2023a, Simulink requires a display to generate images that show which blocks are modified in the changed models. This is why it is working on your Windows machine but not in your GitLab runner. GitLab runners often do not have displays by default. Two possible options for you to make progress are
1) In R2023a a new setting was introduced to disable generation of model screenshots so that the change report can be generated without a display. See the Simulink release notes here: 
2) The display does not need to be a physical display, it can be a virtual one too. You could use a command such as "xvfb-run" on Linux to run the report generation command with a virtual display in your CI/CD Gitlab runner.  The following would work: 
xvfb-run matlab -batch "generateDiffReports('$1', $2, $3, '$4')"
where "generateDiffReports" is your diff report generation script. 

Più risposte (0)

Categorie

Scopri di più su Simulink Report Generator in Help Center e File Exchange

Prodotti


Release

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by