Running Ignition Fortress headless in Docker for CI
Dear Ignition Community,
i am trying to integrate Ignition Gazebo Fortress into a Continous Integration Pipeline in gitlab using Docker. Therefore, the installation instructions are followed inside Docker [1]. The linting steps, build steps, etc. are working so far.
For the test stage i have defined a *.test, where the ros_ign parameter bridge as well as ignition gazebo are to be started, since my test class is working on subscribed ROS topic, which are to be interpreted in terms of statistics (do lidars obtain the correct intensities, reflections, and so on ...).
The rostest file looks like:
<?xml version="1.0"?>
<launch>
<include file="$(find ign_my_package)/test/test_ros_gpu_lidar_subscriber.launch"/>
<test test-name="test_ros_gpu_lidar_subscriber" pkg="ign_my_package" type="test_ros_gpu_lidar_subscriber" time-limit="180.0" />
</launch>
The referenced test_ros_gpu_lidar_subscriber.launch file looks like:
<?xml version="1.0"?>
<launch>
<!-- Launch the bridge -->
<node name="parameter_bridge_ros_subscriber" pkg="ros_ign_bridge" type="parameter_bridge" args="/lidar@sensor_msgs/LaserScan@ignition.msgs.LaserScan /lidar/points@sensor_msgs/PointCloud2@ignition.msgs.PointCloudPacked"/>
<include file="$(find ros_ign_gazebo)/launch/ign_gazebo.launch">
<arg name="ign_args" value="-r -s -v 4 gpu_lidar_retro_values_sensor.sdf --headless-rendering"/>
</include>
</launch>
Since I have no rendering window available, i thought the recently released and mentioned EGL headless mode [2], would be the ideal application to enable a renderless runner via
ign gazebo -s --headless-rendering
But when my CI pipeline comes the the test stage, where i am going to run some rostests based on the execution of launch files, i obtain the following error:
[Err] [Ogre2RenderEngine.cc:394] Unable to open display: terminate called after throwing an instance of 'Ogre::RenderingAPIException' what(): OGRE EXCEPTION(3:RenderingAPIException): No Interface could be loaded. Check previous error messages.Try disabling OpenGL plugin from plugins.cfg. in GlSwitchableSupport::GlSwitchableSupport at [...]
Are there any indications why this fails? Are there positive experiences integrating rostests with IGNITION GAZEBO (FORTRESS) within Docker headless?
Update:
Using the hints from the dolly example in the comments below
export DISPLAY=:1.0
export MESA_GL_VERSION_OVERRIDE=3.3
result to the following error:
[Err] [Ogre2RenderEngine.cc:394] Unable to open display: :1.0 terminate called after throwing an instance of 'Ogre::RenderingAPIException' what(): OGRE EXCEPTION(3:RenderingAPIException): No Interface could be loaded. Check previous error messages.Try disabling OpenGL plugin from plugins.cfg. in GlSwitchableSupport::GlSwitchableSupport [...]
I can think of two reasons for this:
- Somehow, the combination of mesa/opengl/ogre-library combination does not fit well. But since i am installing the libraries as the default ignition tutorial proposes, this should work.
- Second, maybe and somehow the way how my tests are build up using rostest and therefore starting ingition via launch-files (and the headless parameter) could also potentially bring in some problems. The dolly example is based on a dedicated test fixture class [3] starting up ignition.
Are there other examples using iginition headless using test suites, to see if
- some packages/dependencies/whatever (preconditions for docker environment) are wrong or
- the rostest integration is incorrect or not suitable for headless execution in CI/CD environments?
Best regards, Marc
References:
- [1] https://ignitionrobotics.org/docs/for...
- [2 ...