Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigation on Github actions tests runs on Windows and MacOS #51

Open
Samweli opened this issue May 17, 2023 · 5 comments
Open

Investigation on Github actions tests runs on Windows and MacOS #51

Samweli opened this issue May 17, 2023 · 5 comments
Assignees
Labels
Size: 3 It will take me between 2 hours to half a day testing

Comments

@Samweli
Copy link
Collaborator

Samweli commented May 17, 2023

We need to develop workflow that will enable running plugin tests on GitHub actions under Windows and macOS images, currently there are already known ways for one to use GitHub actions tests runs for QGIS plugins using linux based OS images.

This is part of efforts that will enable extensive plugin testing during development and deployment that will ensure plugin reliability during usage across multiple platforms.

See QGIS Animation Workbench and QGIS STAC Browser for examples on how to current run GitHub actions tests runs with QGIS images for the Ubuntu OS.

@Samweli Samweli added testing Size: 3 It will take me between 2 hours to half a day labels May 17, 2023
@vermeulendivan
Copy link
Collaborator

vermeulendivan commented May 17, 2023

Info on all runners available for github actions, this includes ubuntu, windows and macOS:
https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners

Latest versions with links to build-in tools for each OS:

@Samweli
Copy link
Collaborator Author

Samweli commented May 18, 2023

Info on all runners available for github actions, this includes ubuntu, windows and macOS:
https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners

@vermeulendivan do you know if there are QGIS docker images supported in the mentioned runners?

@vermeulendivan
Copy link
Collaborator

vermeulendivan commented May 23, 2023

@Samweli Tested Windows, getting error that OS not supported on this image:
image
Which is what you mentioned will likely happen.

For MacOS, it seems to be more complex. Docker is NOT installed on MacOS: https://github.com/orgs/community/discussions/25777 because of some licensing issues (more actions/runner-images#17). Looking into working around this. Because macos is also unix-based, maybe the image will work here? I have no idea, have no knowledge of macos and have never used it before. The console commands seems to be the same!

Will add more info as I continue

@vermeulendivan
Copy link
Collaborator

vermeulendivan commented May 23, 2023

More on why its not in macos: actions/runner-images#2150.

image
Same issue here, last post in comments section: docker/for-mac#882

@vermeulendivan
Copy link
Collaborator

@Samweli After a learning some basics of docker, which helped, and a lot of struggle, I thought I want to give you feedback.

Here is how to set up qgis in a linux container: https://docs.qgis.org/3.28/en/docs/server_manual/containerized_deployment.html. But this is mostly useless for a Windows container as the console commands will be useless in windows.

Windows docker images:
https://hub.docker.com/_/microsoft-windows-base-os-images

Just some info on Windows containers: https://learn.microsoft.com/en-us/virtualization/windowscontainers/
An example for .net core: https://learn.microsoft.com/en-us/virtualization/windowscontainers/quick-start/building-sample-app
Dockerize Windows apps: https://blog.sixeyed.com/how-to-dockerize-windows-applications/
I have more links, but found those to be useful.

So I did get something working after with a Dockerfile. But it came with a lot of problems and difficulties and pre-requisites:

  • The Windows images above REQUIRES docker to be making use of the Windows daemon (e.g. you need to switch the docker to Windows containers from Linux containers)

image

  • But on my Linux OS I don't have that option, and all examples I can find is only for Windows. So started going with Windows. Maybe there is a way to do this on Linux, but currently on my Linux I cannot
  • First wanted to get it working on my Laptop Windowss for loadshedding, but just couldn't, Turned out that is because you need to activate 'Hyper-V', which is is not supported on some versions of Windows - in my case it does not work on 'Home'

This needs to be run in Windows to activate Hyper-V:
Enable-WindowsOptionalFeature -Online -FeatureName $("Microsoft-Hyper-V","Containers") -All

  • Luckily I have Windows Professional on my Desktop, which allows support for 'Hyper-V'
  • So could finally then switch over to the Windows containers. Finally were able to run a container which runs Windows. A lot of problems to get to this point (Yoh!):

image

  • I can also access the Windows container and the console

image

Oky, but that is only running the Windows image on its own, no Dockerfile yet. So lets get to that:

  • Played around with how to get an Windows application working, and seems like there are a lot of approaches...
  • On Linux containers its much easier, because EVERYTHING can be installed with single commands. This is not as easy on Windows
  • I cannot find a way to do this with QGIS, all installations on Windows for QGIS is using the exe/msi. @Samweli Maybe you are aware of doing a console installation of QGIS on Windows?
  • Here is an example on how to do this with an MSI file (https://blog.sixeyed.com/how-to-dockerize-windows-applications/), but the problem associated with that if there are option the user should do during the installation, it will not work. Which is the case with QGIS installers...
  • A very simplictic approach would be to copy the QGIS installation to the Docker image, as some people do this with other apps. But whether this would works with QGIS, is difficult to see for me atm. I have done this before with other software between different Windows computers, so won't be suprised if it works
  • I got the app on the image, and can see the QGIS contents:

image

  • I called the QGIS while the container is running, no error. But I'm not sure how to check if its actually running. @Samweli Do you maybe know how I can check this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Size: 3 It will take me between 2 hours to half a day testing
Projects
None yet
Development

No branches or pull requests

2 participants