cross-build nginx-unit with yocto/bitbake #1627
vitschwilk
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I wanted to use nginx-unit within out yocto-project with an python (Fast-API) application.
Since it was quite a lot of work but ultimately decided against nginx-unit, I wanted to give some pointes for others that might also want to cross-compile nginx-unit.
tl:dr:
People familiar with yocto will probably know the nginx recipe.
Unfortunately the is no recipe for nginx-unit.
Fortunately the configuration and compiling process of nginx-unt is very similar to nginx. So a lot of the work done in the patches in the recipe can be reused (but not reapplied) to nginx-unit.
I don't want to upload the full bitbake files. Tbh. they are kind of crude and hacky.
They will also not work without setting up certain things like directories or users.
As a side note I could not get the nxt_python312_mounts.h to configure correctly so I replaced them.
But here is the do_configure and the do_install (there is no do_deploy)
The applied patch ensures that the configured variables (e.g. NXT_WITH_NXT_INT_SIZE) can be applied from the cli interface of the configure "script".
Basically the config script compiles a lot of C-code for the target, executes it and then checks the stdout.
So most of my patching boiled down to:
Especially the variable handling and testing for a config gave me a lot of trouble.
So please don't use my patch in a productive environment This was patched in a weekend without variance in testing (I cross compiled it only for one target).
Why I decides against nginx-unit
This is the main reason why I write this post.
Not because I didn't like nginx-unit (tbh. I do) but because I did not see a speed or hardware utilization benefit in comparison to uvicorn.
In my testing the were on par on my target but it is much easier to get uvicorn working in yocto.
Therefore to not just erase my work I wanted to give so pointers for others that might want or need to use nginx-unit in a yocto build environment.
Beta Was this translation helpful? Give feedback.
All reactions