Skip to content

When matching a bootscript by name, we need to take into account its architecture #255

Closed
@moul

Description

@moul

todo

  • add region and architecture fields in cache entries (the region cache is for later, just create the field for now)
  • populate architecture field in cache entries when possible
  • update the cache helpers to take an optional architecture argument, if the argument is present, skip the other architectures
  • when matching a bootscript with another object context (scw run (image context), scw tag --architecture (architecture argument)), pass the architecture argument to the cache resolver
  • Bonus: related with Reduce resolver matching conflicts on 'create' and 'run' #212, if you feel the courage, also add a owner field, so we can filter by user/XXX = title matching XXX and owner = my organization id, community/XXX = community meta organization, public/XXX or XXX = entity with public=True (official images/bootscripts)

Note: do not create a commercial-type->architecture mapping nor an architecture aliases mapping, for now we need to write the exactly same architecture


example

scw run

  • scw run --bootscript=stable my-arm-image: bootscript matching stable for the architecture armv7l
  • scw run --bootscript=stable my-arm64-image: bootscript matching stable for the architecture aarch64
  • scw run --bootscript=stable my-amd64-image: bootscript matching stable for the architecture x86_64

scw tag

  • scw tag --arch=arm --bootscript=latest my-snapshot: bootscript matching latest for architecture armv7l
  • scw tag --arch=x86_64 --bootscript=latest my-snapshot: bootscript matching latest for architecture x86_64
  • scw tag --arch=arm64 --bootscript=latest my-snapshot: bootscript matching latest for architecture aarch64

live example

Actually we have this error when trying to tag with a bad bootscript

FATA[0001] cannot execute 'tag': cannot create image: Image and Bootscript architecture should be the same

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions