-
Notifications
You must be signed in to change notification settings - Fork 17
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
add block size to unikernel_info, also add the possibility to change arguments in restart #195
base: main
Are you sure you want to change the base?
Conversation
this requires some additional work to re-introduce backward compatibility
TODO: this needs a bit more thought in respect to backwards compatibility
A new client talking to an old server will still not be understood
I added the needed backwards-compatibility code. This is ready for review. So, old clients can talk to new servers. There's no attempt to make new clients talk to old servers (they'd need to send old commands, so figure out which version the server has before sending the initial command, or re-connect on failure and try with an older version). |
type arguments = { | ||
fail_behaviour : fail_behaviour; | ||
cpuid : int ; | ||
memory : int ; | ||
block_devices : (string * string option * int option) list ; | ||
bridges : (string * string option * Macaddr.t option) list ; | ||
argv : string list option ; | ||
} |
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.
that's the new record for restart with arguments
.
type block_info = { | ||
unikernel_device : string ; | ||
host_device : string ; | ||
sector_size : int ; | ||
size : int ; | ||
} | ||
|
||
type net_info = { | ||
unikernel_device : string ; | ||
host_device : string ; | ||
mac : Macaddr.t ; | ||
} | ||
|
||
type info = { | ||
typ : typ ; | ||
fail_behaviour : fail_behaviour; | ||
cpuid : int ; | ||
memory : int ; | ||
block_devices : (string * string option * int option) list ; | ||
bridges : (string * string option * Macaddr.t option) list ; | ||
block_devices : block_info list ; | ||
bridges : net_info list ; | ||
argv : string list option ; | ||
digest : string ; | ||
started : Ptime.t ; | ||
} |
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.
I solved some confusion (hopefully) by moving to records for block and network devices -- they also no longer have any optional fields, but are completely filled.
Maybe to elaborate a bit: we're not concerned about API versioning / compatibility here. We just upgrade the API as we want. ;) What we are concerned are the clients and servers that are deployed by different parties (i.e. not under our control), so esp. an old client should not be punished by our server. In this specific PR, the old client will get reasonable (the same, expected) answers from the new server. This means that in our serialisation (vmm_asn.ml), we do some extra work to keep track of the old wire formats. In addition the For the restart, it is slightly simpler, since the old command did result in a generic reply - not a specific one (i.e. a success or an error only) -- here we can just translate the old wire format to I guess reading the diff is sometimes confusing (as is writing the code) - and we should add tests for the different versions. But I've been too lazy for writing these tests. |
//cc @PizieDust @reynir
There's still more work needed to retain backwards compatibility.
The main question I have is about the
albatross-client
.. Now therestart
subcommand can replace the arguments, but this is guarded by an additional flag "--replace-arguments". I came there since just checking whether the arguments are provided or not does not suffice (due to default values, and also maybe a user wants to restart their "hello world" this time with providing no argv at all. -- this wouldn't easily be possible without such a flag. Still it makes me wonder whether we want a separate (sub)command for it -- but then I struggle with naming. Any ideas?Also, the restart-with-arguments-replaced can't check the manifest on the client side (since there's no image available)... I'm hesitating on what to do here -- I'd like to avoid someone to do a restart and end up with "sorry, your arguments didn't specify the required devices". Any ideas?