cross-platform-actions / action

Cross-platform GitHub action
MIT License
128 stars 19 forks source link

NetBSD - very slow network (IPv6 timeouts?) #46

Closed kobalicek closed 1 year ago

kobalicek commented 1 year ago

I have tried to use cross-platform-actions to run NetBSD and I have noticed that when I use for example pkg_add or pkgin it takes virtually forever to complete.

After some googling I have found that there is some problem with IPv6, QEMU ticket here:

Is this something that cross-platform-actions could help with and give an option to workaround? I would not mind having ipv6 disabled in the VM if there was such option to do so. The problem is that it's almost unusable at the moment to even install a C++ compiler on such a runner.

I have also tried another project that provides NetBSD and it runs pretty well, although it uses a different virtualization software (virtualbox on macos only):

Thanks a lot for these actions btw!

jacob-carlborg commented 1 year ago

IPv6 should already be disabled. The NetBSD action is currently running on Linux which doesn't support hardware accelerated nested virtualization. I've recently added support for macOS runners which do support hardware accelerated nested virtualization. I've not created a new release yet but you should be able to use the commit hash directly. Could you please try https://github.com/cross-platform-actions/action/commit/c6ffabb3c8bd9899a52924b7ecf314c60625dcc0?

kobalicek commented 1 year ago

I have actually tried macos-12 host on cross-platform-actions master branch (which already had that aforementioned commit merged) with NetBSD.

I'm using at the moment vmactions to test NetBSD because of this, but I can create a branch and run NetBSD with cross-platform-actions to double check the issue.

jacob-carlborg commented 1 year ago

Ok, then I'll take a look. Do you have a link to a job that I can try?

kobalicek commented 1 year ago

I have created a branch in one of my projects, and an example run could be this one:

The netbsd-9.2 is the one that actually takes forever when run with cross-platform-actions. The other one (just called netbsd) uses vmactions/netbsd-vm - it fails, but that's because of scripting (when it succeeds it's like 10 minutes run time).

(update: I have killed the job and it basically only succeeded by executing pkg_add once, then was stuck forever when executing pkgin - this took more than 1 hour.)

BTW: There is still a possibility I did something wrong in my scripts that prepare the environment as I'm really new to BSDs, but on the other hand this is something I can reproduce easily.

One more thing that is happening to the runners sometimes is that they are stuck after run finishes (even when everything is successful), basically until I kill the job (an example here: https://github.com/asmjit/asmjit/actions/runs/4250851364/jobs/7392460230) - but I can create another issue to track this problem, as I think this is not an issue in my scripts.

BTW if you are interested in the actual workflow, it can be seen here:

But I think there is not anything unusual, it uses cross-platform-actions/action@master at the moment.

jacob-carlborg commented 1 year ago

One more thing that is happening to the runners sometimes is that they are stuck after run finishes (even when everything is successful)

Might be https://github.com/cross-platform-actions/action/issues/21, but if you're already using master it might be something else. Could https://github.com/cross-platform-actions/action/issues/29 be related?

kobalicek commented 1 year ago

Definitely not related to #21 (I've got few of these EPIPE errors before, then switched to master and they are gone).

Likely to be #29 related yeah, so no need to open an additional issue.

kobalicek commented 1 year ago

BTW This is not crazily important for me to get netbsd working with cross-platform-actions as I will just use vmactions/netbsd-vm instead. What I found nice on cross-platform-actions is the ability to have all the OSes in a build matrix and just share all the boilerplate around it. With vmactions you basically are forced to use a separate action for each supported OS, which is not really ideal for me.

jacob-carlborg commented 1 year ago

BTW This is not crazily important for me to get netbsd working with cross-platform-actions

It is important. Others are using the action with NetBSD as well.

kobalicek commented 1 year ago

The question is how they install the dependencies. It almost feels like pkgin is the problem in my case. I can install it via pkg_add to install other dependencies, but when it's used it just takes enormous time to complete. In the vmactions VM I can actually use pkg_add instead to install python310 and the rest of the dependencies (totally avoiding pkgin), but I have no idea why the same approach doesn't work in cross-platform-actions VM.

jacob-carlborg commented 1 year ago

I think this is working better: https://github.com/jacob-carlborg/asmjit/actions/runs/4256157138/jobs/7404681643. Installing Python was pretty quick but installing Cmake and Clang seems to take longer. Could you please give the netbsd-slow-network-46 branch a try?

jacob-carlborg commented 1 year ago

It finished after 16m and 16s.

kobalicek commented 1 year ago

yeah that's pretty great - 16 minutes would work for me actually. Maybe if I can ditch pkgin it would be even better, but I have no idea why pkg_add doesn't find python

jacob-carlborg commented 1 year ago

You could perhaps try pkgin for Python and pkg_add for the others.

Please let me know if the fix in netbsd-slow-network-46 is good enough.

kobalicek commented 1 year ago

The fix is good enough, thanks! I think that if you merge the fix this could be closed. If there are different issues I would just open a new issue.