-
Notifications
You must be signed in to change notification settings - Fork 6
Add GitHub Action to build and test FANS #19
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
Conversation
…iner' option The container option doesn't support QEMU emulation and thus selecting a architecture different from the runners/host's one crashed the container with a 'exec format error'. Unfortunately this breaks running the workflows locally using nektos/act. I still have to figure out why exactly.
…es instead of double quotes to prevent host side shell expansion
I did some more research on running the action locally: According to this article, sharing the Docker daemon socket with the runner container is the way to go to emulate Docker in Docker. Using the hosts Docker daemon however means that bind mounts in the action will mount host directories into the created act --container-options "--group-add $(stat -c %g /var/run/docker.sock)" --job build --matrix UBUNTU_VERSION:jammy --matrix ARCH:amd64 I'm aware that bind mounting the Docker socket has huge security implications, but since Regarding the other two points from the post above I guess we just need to wait for GitHub to make the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need to manually work with Docker inside a GitHub Action. You can simply use a container by stating it in the container
parameter. For example, the container precice/precice:nightly is used like this. This is of course applicable if we are pushing images for every change, which we should not do.
I would suggest manually installing FANS inside the Action then. Using Docker over-complicates the whole thing.
I wanted to use the
We need Docker to be able to build for linux/arm64. |
Is there a reason to specifically target linux/arm64? If things work with a reasonable Linux distribution like Ubuntu, I would take this as a successful test. I would keep the test and Action simple: get the FANS source code, compile manually, and run the tests. Anything platform specific can be done separately. Quickly asked @sanathkeshav and now I understand why ARM architecture testing is being done. This is to support MacOS. For this we can try |
We wanted to make sure it also runs on @sanathkeshav's MacBook Air which has an ARM CPU and thus cannot run linux/amd64 containers. But I agree. In the draft ctest PR the QEMU emulated test runs take forever (already >1h), that's not practical... The amd64 ones are reasonably fast (~3min), would you thus agree to keep testing for the three Ubuntu versions? Or should we test for just one version? |
Yes exactly. But using macos-latest would mean to adapt the CMake recipe not only to arm64, but also to MacOS which is a lot more effort I think. I suggest to temporarily drop arm64 support and wait for GitHub to make its linux/arm64 runners available. |
My 2 cents is that the only way FANS works on MacOS so far is via Docker. If the consensus is that supporting ARM is too complicated, We can choose to drop support. This is a very niche case as is (me). But Is it is easy to do as @IshaanDesai suggests via |
… fans-ci image as well
…se of container: parameter
Closes #9
This workflow defines a job to build and test FANS upon pushes to
main
anddevelop
as well as for every pull request. It works fine so far, but I think the implementation could be more elegant (see below).P.S.: CTest test cases are not yet included. I plan to open another PR specifically for the test cases. So far CTest just outputs that it couldn't find any tests and exits with code 0, thus not breaking the workflow execution.
Features
Issues regarding QEMU emulation and a readable workflow file
To support the
linux/arm64
platform I use the QEMU emulation tool. This however seems to not be supported by thejobs.<job_id>.container
option described here. I tried passing the--platform linux/...
flag, but that caused the container to crash in the case oflinux/arm64
when I tried running the workflow on my private repo. That's why I reverted back to use the explicit Docker commands for creating the container and running commands in it. Unfortunately this make the workflow file much less readable. For comparison the old version.Running actions locally
With nektos/act one can run GitHub Actions locally, which I think is very useful for debugging them. To accomplish this,
act
sets up an own Docker container emulating a GitHub hosted runner. Unfortunately this seems to not support the explicit Docker commands mentioned above, I guess because that would mean to have nested Docker containers. With thejobs.<job_id>.container
option it worked, howeveract
explicitly forbids the usage of the--platform
flag, thus making emulation not possible for local runs. If I understood it correctly,act
with thecontainer
option creates another container next to the runner container and mounts the same volume into both of them to avoid nesting containers.So in summary I am unsure how to combine the support for
arm64
, a readable workflow file and the possibility to run the workflow locally. GitHub is planning to releaseARM
runners for open source projects by the end of the year (source). This would make emulation obsolete and the workflow file more readable by allowing to use thecontainer
option again. However this would still not enable one to useQEMU
emulation locally withact
. But I think with a running workflow that's the least important of the three issues...If you have any ideas how to solve the above problems please tell me :)