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

Image name schema #164

Merged
merged 5 commits into from Sep 23, 2022
Merged

Image name schema #164

merged 5 commits into from Sep 23, 2022

Conversation

Szubie
Copy link
Collaborator

@Szubie Szubie commented Sep 23, 2022

Implements the approach to image naming schema mentioned here in #140.
Also addresses issue #152 regarding storing image architecture.

Image naming schema

Using this new image naming schema, the user can optionally provide the image version and architecture as part of the image field by using slashes as delimiters.

The schema is as mentioned in the issue above except the remote prefix is not yet implemented:
name[/version][/arch]

If version is not provided, it defaults to "1.0". Arch will default to the bravetools runtime architecture if not specified - in future it would be best to infer arch based on architecture of LXD build server/deploy server by querying the LXD server.

If the user seperately provides a value for the Service.Version field, that overrides the version in the image field.

Image file metadata (architecture and version)

The image files on disk now also contain architecture information, for example:
python-auth_1.0_amd64.tar.gz

The metadata fields are delimited by _ and are in the same order as above:
name[_version][_arch].tar.gz

This change is backwards compatible in a sense, although the new metadata fields will be set to defaults as above if they are missing. For example:
python-api-1.0.tar.gz will be read as

IMAGE                           VERSION ARCH
python-api-1.0                  1.0     amd64

This metadata (version and arch) is read and presented when running brave images.

brave images

IMAGE                       VERSION ARCH    CREATED         SIZE    HASH
python-api                  1.0     amd64   2 days ago      28MB    7cd1b20142480707b1fb2dbbaa4c1000
python-auth                 1.0     amd64   just now        28MB    5f9e37a9eadb98cefb16d706572e0054
python-auth                 2.0     amd64   just now        28MB    4c6553c35bd9de678ead8c2bd5cf4da9

functions for parsing struct from user-provided strings or filenames.

Updated name includes schema for specifying version and arch using slash
delimiters.

Filenames also store this info in underscore delimited fields.
…epresentation for reporting errors for existing/missing images (since it includes version and arch as well as image name).
@idroz idroz merged commit 5991994 into bravetools:master Sep 23, 2022
@Szubie Szubie deleted the image-name-schema branch September 26, 2022 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants