firecracker-microvm / firecracker-containerd

firecracker-containerd enables containerd to manage containers as Firecracker microVMs
Apache License 2.0
2.23k stars 182 forks source link

Consider supporting external container grouping OCI annotations #162

Open sipsma opened 5 years ago

sipsma commented 5 years ago

As mentioned in the comments on #160 we should consider whether we want to support the other OCI annotations that exist for grouping containers under a single shim or in a single sandbox in our own shim, for the purposes of grouping containers in a single firecracker VM.

Considerations: On one hand, it would be nice to automatically group containers into VMs using these already defined annotations so users can switch to firecracker-containerd more seamlessly.

On the other hand, I don't know if we want to entangle ourselves and our users with keys that have meaning out of our control. I.e. what if some other random part of a user's stack starts also interpreting io.kubernetes.cri.sandbox-id or io.containerd.runc.v2.group but does something the user doesn't want? That user would probably prefer to just have a key like aws.firecracker.vm.id so they can specify the firecracker VM without any extra side-effects.

Maybe what'd be best is for our shim implementation to interpret each one with some priority, i.e. use aws.firecracker.vm.id if set, if not check io.kubernetes.cri.sandbox-id, if not check another, etc.

kzys commented 5 years ago

runc already does something similar. It checks io.containerd.runc.v2.group before io.kubernetes.cri.sandbox-id.

https://github.com/containerd/containerd/blob/a0696b2bc6a0110263b711b3af1db4f2e483fbc6/runtime/v2/runc/v2/service.go#L63-L69