How to Publish Simulink Model Comparisons Without a Display in Linux?
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Engenuity
el 29 de Abr. de 2023
Comentada: Engenuity
el 4 de Mayo de 2023
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.
0 comentarios
Respuesta aceptada
MathWorks Support Team
el 2 de Mayo de 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.
Más respuestas (0)
Ver también
Categorías
Más información sobre Reporting and Database Access en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!