Skip to content
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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

hannesm
Copy link
Collaborator

@hannesm hannesm commented Oct 24, 2024

//cc @PizieDust @reynir

There's still more work needed to retain backwards compatibility.

The main question I have is about the albatross-client.. Now the restart 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?

this requires some additional work to re-introduce backward compatibility
TODO: this needs a bit more thought in respect to backwards compatibility
@hannesm
Copy link
Collaborator Author

hannesm commented Oct 31, 2024

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).

Comment on lines +126 to +133
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 ;
}
Copy link
Collaborator Author

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.

Comment on lines +150 to 173
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 ;
}
Copy link
Collaborator Author

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.

@hannesm
Copy link
Collaborator Author

hannesm commented Oct 31, 2024

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 `Old_unikernel_info3 has been introduced (used to be named `Unikernel_info), which now results in the `Old_unikernels_info3 (used to be `Unikernel_info) -- the wire format of these two constructors is preserved -- the naming differs, since the current one (used by up-to-date clients and servers) is named `Unikernel_info.

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 `Unikernel_restart None to preserve the existing behaviour.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants