-
Notifications
You must be signed in to change notification settings - Fork 94
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
defunctorised versions of unikernels #407
base: main
Are you sure you want to change the base?
Conversation
@@ -12,5 +12,5 @@ let packages = | |||
package ~min:"0.2.0" "randomconv"; | |||
] | |||
|
|||
let main = main "Unikernel.Main" ~packages (random @-> job) | |||
let () = register "crypto-test" [ main $ default_random ] | |||
let main = main "Unikernel" ~packages ~deps:[ dep noop ] job |
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.
Why is the dep noop
needed here?
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.
to delay the execution of start (now having a unit argument).
what happens if you forget it is that mirage configure will complain (see mirage/mirage#1544) -- certainly we should adapt the error message :)
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.
is there any useful unikernel/app that could be written with main "Unikernel" ~packages job
? If not, should we just insert it that noop
by default in that case (with a warning message to make clear that some magic has happened)? I'm just a bit concerned that this makes the "hello world" unikernel unnecessary harder to write (as you have to explain what deps
is, what noop
is, etc).
Or maybe we should have a noop -> job
signature that just adds a ()
argument to the main function without changing the functor structure. That seems a bit more convoluted though.
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.
sure, we can always add a () argument to the job of main. I'd make this unconditionally, and not "only if there's no other dep/functor). Now that's an orthogonal change requiring mirage/functoria insights and needs to be tested with mirage-www/dns-primary-git unikernels (esp. with --enable-monitoring variant).
Please feel free to provide a PR that does this in the mirage/mirage repository. I'm very low on functoria skills.
@@ -3,8 +3,7 @@ open Mirage | |||
|
|||
let main = | |||
let packages = [ package "duration" ] in | |||
main ~packages "Unikernel.Main" (time @-> pclock @-> mclock @-> job) | |||
main ~packages ~deps:[ dep noop ] "Unikernel" job |
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.
same question here :-) What happens if you forget to add it?
No description provided.