darbyjohnston / DJV

Professional media review software for VFX, animation, and film production
https://darbyjohnston.github.io/DJV/
BSD 3-Clause "New" or "Revised" License
686 stars 59 forks source link

Enable CI for macOS builds #155

Open darbyjohnston opened 4 years ago

jfpanisset commented 4 years ago

Related to #154, any interest in a azure-pipelines.yml which would provide a unified Windows / macOS / Linux build environment? Started playing with it and Linux builds pretty much "out of the box" using the VFX Reference Platform compliant containers from ASWF (very messy WIP for now): https://github.com/jfpanisset/DJV/blob/master/azure-pipelines.yml Test suite doesn't work yet, need to figure out OpenGL / GLFW /xvfb inside container, one approach is to use a GPU accelerated build instance, but those aren't free: https://github.com/jfpanisset/cloud_gpu_build_agent

darbyjohnston commented 4 years ago

Hi,

Yes, I would definitely be interested, I currently only have CI up and running for Linux (with GitHub and Travis). I believe it's also possible to do packaging/releases with Azure? That would be a great reason to switch since I do the packaging manually right now and it takes a fair amount of time and is quite error prone.

I took a look at your azure-pipelines.yml and it looks fairly straightforward; for the OpenGL support maybe it would be possible to use the Mesa software renderer? Another possibility would be to temporarily disable the tests that rely on OpenGL until there is better support.

Darby

jfpanisset commented 4 years ago

CMake / CPack can do packaging for a lot of formats: https://cmake.org/cmake/help/latest/manual/cpack-generators.7.html including MSI (using the WIX generator) and DMG (using the DragNDrop generator), that would seem like a CI-portable approach to packaging? OpenEXR has support for creating installation packages via CPack so that could be a an example to base on. Sounds like that's worth its own GitHub Issue? As for OpenGL, it should be possible to get GLFW / GLX / MESA to work using xvfb for headless testing, but in the meantime I would agree that turning off tests that depend on OpenGL during CI builds would be easiest. A couple of other suggestions:

https://raw.githubusercontent.com/jfpanisset/windows-container-test/master/setup_az_devops_project.sh is a simple script that will create a ready-to-use Azure DevOps / Pipelines project for CI builds.

Have you played around with CTest to drive your test suite? OCIO uses CTest for instance, so can be used as an example, and if you are interested in automatically uploading CTest results to the CDash dashboard, check out https://github.com/jfpanisset/aswf-sample-project#uploading-ctest-results-to-cdash

darbyjohnston commented 4 years ago

Hi,

Sorry, packaging was the wrong word, I meant some sort of process for creating the packages in a CI build and then uploading those packages to either SourceForge or GitHub as a release. I thought I head read somewhere that Azure had some sort of built in help for deployment. DJV does currently use CPack for packaging, though it still involves a fair bit of manual labor on my part to run the build and packaging steps on Linux/OSX/Windows and then upload those packages as a release.

Cool, I'll check out the script; I haven't used Azure before, does that script setup the "Pipelines" for Linux, OSX, and Windows? I guess I should probably read a bit of the Azure documentation. :)

Yes, DJV also uses CTest for running the test suite, though I have not used CDash before, that would be nice to get setup.

darbyjohnston commented 4 years ago

Hi, if you make a pull request for the azure-pipelines.yml file I would be happy to enable it. Also I just checked it out again and it looks like you have the OpenGL tests working, nice job!

jfpanisset commented 4 years ago

I'll submit the PR, the azure-pipelines.yml is pretty basic for now but it's a start, and yes, it seems to be able to run the OpenGL tests using xvfb. The other question is whether you want to keep the CI setup as generic as possible using a shell script, or leveraging the Azure-specific modules for CMake and all.

darbyjohnston commented 4 years ago

Just to follow up on running the tests, I tried enabling them for macOS and get this failure:

Unable to create basic Accelerated OpenGL renderer.
Core Image is now using the software OpenGL renderer. This will be slow.
ERROR: Cannot create GLFW window.

This is probably caused by an unsupported OpenGL version.