mikelangelo-project / capstan

Capstan, a tool for packaging and running your application on OSv.
http://osv.io/capstan/
Other
19 stars 7 forks source link

Support running sequential config_sets #76

Closed miha-plesko closed 6 years ago

miha-plesko commented 6 years ago

With this commit we make it possible to use --boot more than once, like this:

$ capstan package compose demo --boot conf1 --boot conf2 --boot conf3

The command above will result in following bootcmd being set:

runscript /run/conf1;runscript /run/conf2;runscript /run/conf3

With this commit we also support the very same behavior within meta/run.yaml when using config_set_default:

runtime: native
config_set:
 ...
config_set_default: conf1,conf2,conf3

The config_set_default value "conf1 -> conf2 -> conf3" will result in bootcmd as shown above.

miha-plesko commented 6 years ago

Hi @gberginc, I was planning this commit for quite some time, but only implemented it now that @wkozaczuk came with a usecase. The main usecase would be to simplify preparing base unikernel for compose-remote approach, where we currently have to compose it like this:

$ capstan package compose base --run "runscript /run/init;runscript /run/app"

After merge, the command will be simplified into:

$ capstan package compose base --boot init --boot app

However, even if compose-remote approach will not be accepted (there are some security questions open that I'm not sure how we'll address, see osv-dev mailing list discussion), I think Capstan would still benefit from this commit.

I kindly ask for a review.

miha-plesko commented 6 years ago

Merging this one as well. The review has more or less converged, only the Merge button wasn't pressed. I've tested it once again locally and everything seems to be working. Should any additional changes be needed, we can fix them in a followup PR.