Multi-architecture aliases
(If this would be better suited to discourse please close)
I've been looking at a way to be able to reference one alias regardless of platform but that doesn't seem to be doable - would it be feasible to introduce as a feature? something like:
- Images imported as my/test/image/amd64 and my/test/image/aarch64 with alias my/test/image/latest (or even just my/test/image)
- An
lxc launchis able to pick the correct one based on the arch (perhaps an extra flag during the import above?)
Similar in principle to multi arch docker manifests but I'm not sure how feasible it would be to implement here.
Thanks!
So this is something I considered when working on some of the multi-architecture clustering bits.
It does work with simplestreams which is why ubuntu:18.04 for example gets you the right architecture every time.
But for it to work with the LXD protocol itself, it's a bit harder.
The main issue is that we have URLs like /1.0/image/aliases/name-of-alias which would now be able to point to multiple different images depending on the architecture. We also would need a way to retrieve the list of all architectures supported for a given alias. There also would likely be some consideration to keep in mind around private images as for those, we don't have LXD lookup the alias, instead leaving that to the client.
I "think" a backward compatible implementation of this in LXD would be:
- Extend
images_aliasesDB table to add a newarchitecture INTEGER NOT NULLcolumn - Alter INDEX on
images_aliasesto require UNIQUE be name+architecture - Extend
api.ImageAliasesEntryto includeArchitecture string - Update /1.0/images/aliases API to populate the Architecture field (and check ?recursion=1 shows everything)
- Add a new /1.0/images/aliases/NAME?architecture=NAME endpoint to query a particular architecture, if not specified and more than one match, prefer the native architecture
- Add a new /1.0/images/aliases/NAME?architecture=all endpoint to get all the targets in one shot
- Update client package for
GetImageAliasArchitecturesin lxd - Quite possibly have to update the other GetImageAlias* functions to behave the same way as they do in simplestreams
- Add relevant API extension string for feature detection
ahhh I didn't realise thats how simplestreams works... I should probably try that instead of the lxd protocol - have put it off so far as theres nothing really 'ready to run' but it shouldn't be that difficult to do I guess
Yeah, it's effectively just two json files on an https web server, pretty easy to generate and run. I think some people wrote their own tooling around it for that though.
Hi, I'm Pranav and I'm working with a group of computer science students at UT Austin in a Virtualization course. Can we tentatively be assigned this issue?
@vpranav5 I'd probably recommend looking at a different issue as this one is currently tagged "Maybe" which indicates we haven't quite made up our mind on whether we think this change should be done or not :)