mikelangelo-project / capstan-packages

Docker container that builds OSv from source and recompiles all Capstan packages it has recipe for.
Other
2 stars 3 forks source link

info about recipes for MPM package building #17

Closed redblade closed 6 years ago

redblade commented 6 years ago

Hi, so far, a good use case I see for Mikelangelo is the development in Java/Python/NodeJS with your precompiled packages but I am exploring the recipe part for a EU project.

I need a clarification about the workflow to create new MPM packages. According to this post, I have to use a Docker image for the building and, from this picture, it seems I can install the apt packages I need (BTW, go/capstan is ok, but why Java is needed in this phase?)

1st question is if about these apt packages: they will not be available in the final package and they are mentioned only to support the building, right?

2nd: if I needed an unikernel image with iptables, I should refer to the OSv apps examples and download the .so or build them from source, just like the Python examples here and here, correct? Basically, I cannot simply do an apt-get install iptables but I have to manage the dependencies, get the related .so and prepare the recipe for that, right?

3rd: from the statement "Preparing a package requires knowledge about the application itself as well as the OSv limitations" I should be also aware of the limitations of the application I am going to build (I guess for example no usage of fork(), exec(), etc.). Where could I found more details on these limitations? Just to understand if and how an existing app could be ported on unikernel, although I see there are many interesting examples available.

Thanks in advance for the help provided.

BR Francesco

miha-plesko commented 6 years ago

Hi @redblade ,

0) Why Java is needed in this phase? -> so in this phase we install everything we will ever need to compile any package. We happen tp need Java to compile some packages (apache.spark I think) so we install it here.

1) True. The "building phase" could be better named as "prepare building environment in docker container". It creates no MPM package yet. MPM packages are only created in "running phase" where each recipe copies files it wants into the resulting MPM package; no black magic here in building phase.

2) True. It doesn't really matter what are you apt install-ing into Docker container, only the files that you specifically copy into the result directory (per recipe) will be gzipped into MPM package. If you want a new MPM package with iptables, then you need to write a recipe for it, yes. Please see here for instructions. In case osv-apps repo already contains iptables app, then you can make use of it like we do for Erlang for example (recipe). If osv-apps doesn't have such iptables yet, then your recipe will have to do it from scratch (see python recipe, for example).

3) Huh, good question, I'm not sure there is some list of things to be careful about. Not using fork is the most obvious one, yes. Perhaps you could read this article to understand better what OSv is all about. I suggest you ask this on the OSv repository: https://github.com/cloudius-systems/osv

justinc1 commented 6 years ago

@redblade

image with iptables

The iptables command is only a userspace management tool for Linux iptables/nftables. The real work is then done in Linux kernel (the iptable_nat,iptable_mangle etc moduels). If you are thinking about OSv and iptables-based firewall, than that (kernel) part will be missing in OSv. Getting the /usr/sbin/iptables (/usr/sbin/xtables-multi) compiled will not be enough.

redblade commented 6 years ago

Interesting, maybe another thing to ask about the limitation of OSv