Skip to content

Commit

Permalink
Update docker images and add a EGL CI (#784)
Browse files Browse the repository at this point in the history
* Add an egl build

* fixup egl

* Use another docker image

* Adding egl dep

* install meson

* rename

* update mesa

* missing tool

* missing

* remove useless

* wayland

* ii

* iii

* upload

* Just update !

* Add vtk patch

* update docker image

* remove

* Fixup assimp

* Increasing threshold for one test

* fixup external

* fixup

* fixup clang

* fixups

* fixup again

* Adding upload

* update images

* Add doc

* commit

* commit2
  • Loading branch information
mwestphal authored May 6, 2023
1 parent d822802 commit 0c1ee5d
Show file tree
Hide file tree
Showing 7 changed files with 126 additions and 9 deletions.
25 changes: 25 additions & 0 deletions .github/actions/assimp-install-dep/0001-Fix-librt-link.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From 7339dda7aba5e32be553fe252c9d4f322cd9bdfe Mon Sep 17 00:00:00 2001
From: Mathieu Westphal <[email protected]>
Date: Thu, 4 May 2023 19:57:47 +0200
Subject: [PATCH] Fix librt link

---
code/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt
index b87bc665f..9230548ea 100644
--- a/code/CMakeLists.txt
+++ b/code/CMakeLists.txt
@@ -1327,7 +1327,7 @@ ENDIF()

# Add RT-extension library for glTF importer with Open3DGC-compression.
IF (RT_FOUND AND ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC)
- TARGET_LINK_LIBRARIES(assimp ${RT_LIBRARY})
+ TARGET_LINK_LIBRARIES(assimp rt)
ENDIF ()


--
2.40.1

7 changes: 7 additions & 0 deletions .github/actions/assimp-install-dep/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ runs:
path: './dependencies/assimp'
ref: v5.2.5

# https://github.com/assimp/assimp/pull/5087
- name: Patch Assimp librt
if: steps.cache-assimp.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}/dependencies/assimp
shell: bash
run: patch -p1 < $GITHUB_ACTION_PATH/0001-Fix-librt-link.patch

- name: Setup ASSIMP
if: steps.cache-assimp.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}/dependencies
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
From c30cbb45765c6f5369040a6fa2f80d8aed5687b4 Mon Sep 17 00:00:00 2001
From: Mathieu Westphal <[email protected]>
Date: Thu, 4 May 2023 08:26:04 +0200
Subject: [PATCH] fix missing limits include

---
Common/Core/vtkGenericDataArrayLookupHelper.h | 1 +
Common/DataModel/vtkPiecewiseFunction.cxx | 1 +
Rendering/Core/vtkColorTransferFunction.cxx | 1 +
3 files changed, 3 insertions(+)

diff --git a/Common/Core/vtkGenericDataArrayLookupHelper.h b/Common/Core/vtkGenericDataArrayLookupHelper.h
index f278e27c0f..06995f4780 100644
--- a/Common/Core/vtkGenericDataArrayLookupHelper.h
+++ b/Common/Core/vtkGenericDataArrayLookupHelper.h
@@ -27,6 +27,7 @@
#include <cmath>
#include <unordered_map>
#include <vector>
+#include <limits>

namespace detail
{
diff --git a/Common/DataModel/vtkPiecewiseFunction.cxx b/Common/DataModel/vtkPiecewiseFunction.cxx
index c75935fd19..dfc6b04f76 100644
--- a/Common/DataModel/vtkPiecewiseFunction.cxx
+++ b/Common/DataModel/vtkPiecewiseFunction.cxx
@@ -24,6 +24,7 @@
#include <iterator>
#include <set>
#include <vector>
+#include <limits>

vtkStandardNewMacro(vtkPiecewiseFunction);

diff --git a/Rendering/Core/vtkColorTransferFunction.cxx b/Rendering/Core/vtkColorTransferFunction.cxx
index 40504e5398..e1e0f25187 100644
--- a/Rendering/Core/vtkColorTransferFunction.cxx
+++ b/Rendering/Core/vtkColorTransferFunction.cxx
@@ -23,6 +23,7 @@
#include <iterator>
#include <set>
#include <vector>
+#include <limits>

vtkStandardNewMacro(vtkColorTransferFunction);

--
2.40.1

19 changes: 17 additions & 2 deletions .github/actions/vtk-install-dep/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ inputs:
description: 'Label to control raytracing'
required: false
default: 'no-raytracing'
egl_label:
description: 'Label to control egl'
required: false
default: 'no-egl'

runs:
using: "composite"
steps:
Expand All @@ -38,7 +43,7 @@ runs:
uses: actions/cache@v3
with:
path: dependencies/vtk_install
key: vtk-${{env.VTK_SHA_OR_TAG}}-${{runner.os}}-${{inputs.raytracing_label}}-1
key: vtk-${{env.VTK_SHA_OR_TAG}}-${{runner.os}}-${{inputs.raytracing_label}}-${{inputs.egl_label}}-1

- name: Setup VTK
if: steps.cache-vtk.outputs.cache-hit != 'true'
Expand All @@ -59,6 +64,14 @@ runs:
path: './dependencies/vtk'
ref: ${{env.VTK_SHA_OR_TAG}}

- name: Patch VTK 9.0 limits include
if: |
steps.cache-vtk.outputs.cache-hit != 'true' &&
inputs.vtk_version == 'v9.0.0'
working-directory: ${{github.workspace}}/dependencies/vtk
shell: bash
run: patch -p1 < $GITHUB_ACTION_PATH/0001-fix-missing-limits-include.patch

- name: Patch VTK 9.0 source macos
if: |
steps.cache-vtk.outputs.cache-hit != 'true' &&
Expand All @@ -83,12 +96,13 @@ runs:
-DCMAKE_PREFIX_PATH:PATH=$(pwd)/../install/
-DVTKOSPRAY_ENABLE_DENOISER=ON
-DVTK_BUILD_TESTING=OFF
-DVTK_DEBUG_LEAKS=ON
-DVTK_DEFAULT_RENDER_WINDOW_HEADLESS=${{ inputs.egl_label == 'egl' && 'ON' || 'OFF' }}
-DVTK_ENABLE_LOGGING=OFF
-DVTK_ENABLE_WRAPPING=OFF
-DVTK_GROUP_ENABLE_Rendering=DEFAULT
-DVTK_GROUP_ENABLE_StandAlone=DEFAULT
-DVTK_LEGACY_REMOVE=ON
-DVTK_DEBUG_LEAKS=ON
-DVTK_MODULE_ENABLE_VTK_CommonSystem=YES
-DVTK_MODULE_ENABLE_VTK_FiltersGeneral=YES
-DVTK_MODULE_ENABLE_VTK_FiltersGeometry=YES
Expand All @@ -112,6 +126,7 @@ runs:
-DVTK_MODULE_ENABLE_VTK_RenderingRayTracing=${{ inputs.raytracing_label == 'raytracing' && 'YES' || 'DEFAULT' }}
-DVTK_MODULE_ENABLE_VTK_RenderingVolumeOpenGL2=YES
-DVTK_MODULE_ENABLE_VTK_TestingCore=YES
-DVTK_OPENGL_HAS_EGL=${{ inputs.egl_label == 'egl' && 'ON' || 'OFF' }}
-DVTK_VERSIONED_INSTALL=OFF
${{ inputs.vtk_version != 'v9.0.0' && '-DVTK_ENABLE_REMOTE_MODULES=OFF -DVTK_SMP_IMPLEMENTATION_TYPE=STDThread' || null }}
${{ runner.os == 'macOS' && '-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15' || null }}
Expand Down
28 changes: 22 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
include:
- raytracing_label: raytracing
- bundle_label: no-bundle
- egl_label: no-egl
- vtk_version: v9.0.0
raytracing_label: no-raytracing
- os: windows
Expand All @@ -39,6 +40,10 @@ jobs:
vtk_version: commit
raytracing_label: no-raytracing
bundle_label: bundle
- build_type: headless
os: ubuntu
vtk_version: commit
egl_label: egl

runs-on: ${{matrix.os}}-latest
container: ${{ matrix.os == 'ubuntu' && 'ghcr.io/f3d-app/f3d-ci' || null }}
Expand Down Expand Up @@ -82,6 +87,7 @@ jobs:
vtk_version: ${{matrix.vtk_version}}
vtk_sha_file: ./source/.github/actions/vtk_commit_sha
raytracing_label: ${{matrix.raytracing_label}}
egl_label: ${{matrix.egl_label}}

- name: Install F3D dependencies
uses: ./source/.github/actions/f3d-dependencies
Expand All @@ -100,7 +106,8 @@ jobs:
if: |
runner.os == 'Linux' &&
( matrix.vtk_version == 'v9.0.0' ||
matrix.vtk_version == 'v9.1.0' )
matrix.vtk_version == 'v9.1.0'
)
working-directory: ${{github.workspace}}/dependencies/
shell: bash
run: echo "LD_LIBRARY_PATH=$(pwd)/install/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
Expand Down Expand Up @@ -131,7 +138,7 @@ jobs:
-DF3D_LINUX_GENERATE_MAN=ON
-DF3D_LINUX_INSTALL_DEFAULT_CONFIGURATION_FILE_IN_PREFIX=ON
-DF3D_MACOS_BUNDLE=${{ matrix.bundle_label == 'bundle' && 'ON' || 'OFF' }}
-DF3D_MODULE_EXTERNAL_RENDERING=ON
-DF3D_MODULE_EXTERNAL_RENDERING=${{ matrix.egl_label == 'egl' && 'OFF' || 'ON' }}
-DF3D_MODULE_RAYTRACING=${{ matrix.raytracing_label == 'raytracing' && 'ON' || 'OFF' }}
-DF3D_PLUGINS_STATIC_BUILD=${{ matrix.bundle_label == 'bundle' && 'ON' || 'OFF' }}
-DF3D_PLUGIN_BUILD_ALEMBIC=ON
Expand All @@ -152,7 +159,9 @@ jobs:
run: cmake --build . --parallel 2 --config Release

- name: Run Xvfb ubuntu
if: runner.os == 'Linux'
if: |
runner.os == 'Linux' &&
matrix.egl_label != 'egl'
run: Xvfb $DISPLAY -screen 0 1280x1024x24 &

- name: Install Mesa Windows
Expand Down Expand Up @@ -365,7 +374,7 @@ jobs:
- name: Generate XML Coverage
working-directory: ${{github.workspace}}/source
run: |
lcov --base-directory . --directory . -c -o coverage.info --gcov-tool /usr/bin/gcov-8
lcov --base-directory . --directory . -c -o coverage.info --gcov-tool /usr/bin/gcov
lcov --remove coverage.info "*/dependencies/*" -o coverage.info
lcov --remove coverage.info "*/cxxopts.hpp" -o coverage.info
lcov --remove coverage.info "*/json.hpp" -o coverage.info
Expand Down Expand Up @@ -396,8 +405,8 @@ jobs:

env:
DISPLAY: :0
CC: clang-10
CXX: clang++-10
CC: clang
CXX: clang++

steps:

Expand Down Expand Up @@ -470,3 +479,10 @@ jobs:
export LSAN_OPTIONS=suppressions=$(pwd)/../source/.lsan.supp:use_tls=0
export TSAN_OPTIONS=suppressions=$(pwd)/../source/.tsan.supp
ctest -C Release -j 2 --output-on-failure || ctest -C Release -j 1 --rerun-failed -VV
- name: Upload Tests Artifact
if: failure()
uses: actions/upload-artifact@v3
with:
path: ./build/Testing/Temporary
name: f3d-tests-artifact-sanitizer-${{matrix.santype}}
4 changes: 4 additions & 0 deletions .tsan.supp
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# False positive with Qt test
race:libQt5Core
race:libQt5XcbQpa

# Issue in mesa sw_rast
race:swrast_dri
2 changes: 1 addition & 1 deletion application/testing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ if(VTK_VERSION VERSION_GREATER_EQUAL 9.2.20221220)
f3d_test(NAME TestHDRI8Bit DATA suzanne.ply ARGS --hdri=${CMAKE_SOURCE_DIR}/testing/data/logo.tif HDRI)
f3d_test(NAME TestHDRIOrient DATA suzanne.stl ARGS --up=+Z --hdri=${CMAKE_SOURCE_DIR}/testing/data/palermo_park_1k.hdr HDRI)
f3d_test(NAME TestHDRIToneMapping DATA suzanne.ply ARGS -t --hdri=${CMAKE_SOURCE_DIR}/testing/data/palermo_park_1k.hdr HDRI)
f3d_test(NAME TestInteractionHDRIMove DATA suzanne.ply ARGS --hdri=${CMAKE_SOURCE_DIR}/testing/data/palermo_park_1k.hdr HDRI INTERACTION) #Shift+MouseRight;
f3d_test(NAME TestInteractionHDRIMove DATA suzanne.ply ARGS --hdri=${CMAKE_SOURCE_DIR}/testing/data/palermo_park_1k.hdr HDRI INTERACTION THRESHOLD 60) #Shift+MouseRight;
f3d_test(NAME TestInteractionHDRIBlur DATA suzanne.ply ARGS --hdri=${CMAKE_SOURCE_DIR}/testing/data/palermo_park_1k.hdr INTERACTION HDRI DEFAULT_LIGHTS) #U
f3d_test(NAME TestInteractionHDRIReload DATA suzanne.ply ARGS --hdri=${CMAKE_SOURCE_DIR}/testing/data/palermo_park_1k.hdr INTERACTION HDRI DEFAULT_LIGHTS) #Up
f3d_test(NAME TestInteractionHDRIChange DATA multi ARGS --hdri=${CMAKE_SOURCE_DIR}/testing/data/palermo_park_1k.hdr INTERACTION HDRI DEFAULT_LIGHTS) #Right
Expand Down

0 comments on commit 0c1ee5d

Please sign in to comment.