-
Notifications
You must be signed in to change notification settings - Fork 63
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
refactor test framework to support docker tests #750
Conversation
Seems like docker is not natively supported on MacOS for Github Action. |
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.
Looks great! I left some suggestions. I wonder if we could just go for testing the federated docker support using Docker Compose. If that is complicated, I would advocate for merging this in and revisiting this issue later.
It would be great if @lhstrh could also comment on the changes made to the test framework.
test/C/src/docker/docker_nonfederated/HelloWorldContainerized.lf
Outdated
Show resolved
Hide resolved
I have not tested this myself, but apparently, this workaround exists to get MacOS docker support working on GitHub Actions. What do you think? Also, have you by any chance tried enabling Windows for non-federated tests? Apparently, Docker is fully supported on Windows on GitHub Actions. Maybe it's worth giving it a try. It could help us be more confident to deploy/publish a non-federated C/Python LF application as a Docker image publicly. |
Ok. Running Linux containers on Windows seems to require running them inside a Linux VM, as per: https://docs.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/linux-containers So I assume it suffices that we test the docker option in the Linux VM? What do you think @Soroosh129 ? |
I would say that suffices. If it runs in a VM anyway, we'd essentially just be testing the VM stack. |
I'll have a closer look at this PR tomorrow. |
Interesting find. Thanks for digging into this. Based on this article and reading about how Linux-based Docker images work on MacOS (i.e., using linuxkit as a Linux VM), I agree with @lhstrh that testing on Linux seems to suffice. I think it was essential to find the limitations of what Docker can and cannot do for us. Thanks anyway :) |
according to here and here, seems like python wheels do not work well with musl, which is the libc version alpine linux uses. Wheels of common packages (ex. numpy) are usually compiled for glibc. I suspect this is the reason the CI was failing for the python docker tests, although I was able to build and run the python images locally. As a temporary fix, I have changed the python docker base image from At first glance, this image size looks pretty bad. However, docker containers that use the same base image do not make a copy of that image, so building multiple containerized python LF programs only results in a one-time overhead of 900MB. I was able to verify the disk usage using |
To me, using With that said, I was able to produce an image of size 446 MB using |
sounds good. I think using |
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.
Looks good to me!
I still think that @lhstrh should perhaps have a look at the changes before merging in, since this PR makes modifications to the test framework.
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.
Looks good! I've made a couple suggestions here and there. It would be great if you could address them before merging this in.
test/Python/src/docker/docker_nonfederated/HelloWorldContainerized.lf
Outdated
Show resolved
Hide resolved
test/Python/src/docker/docker_nonfederated/PingPongContainerized.lf
Outdated
Show resolved
Hide resolved
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.
🚀🚀🚀
major changes:
Making execute() loop through a list of ProcessBuilders allows more flexible testing.
Currently, in order to run a test that spans multiple commands (preprocessing, processing, cleanup), a script needs to be created and ran.