Open xynydev opened 2 months ago
In the recipe we could have a top level property where you can specify the version of the modules image you want. We could default it to the current major version or to latest and let the user decide to override that
Versioning for individual modules would be better, though. Not sure how that would work, but I have some ideas I'll post later.
Turns out I didn't get to posting my ideas earlier... Anyway, here's some I can think of now.
modules
container could similarly adopt a tag for versioningsource:
type: default-flatpaks@v2
?Same as option B, but
modules
container for the latest versions of images
/
symbol in image names by publishing images such as ghcr.io/blue-build/modules/rpm-ostree
default-flatpaks
module (#146), we could just deprecate it and make a new module called flatpak-manager
or flatpaks
or somethingThat's all I can think of for now. I'm inclided to just go all in with option C, or go the lazy route with D. Please comment your thoughts below.
@xynydev
C sound the best imo.
Everything else has some cons in some way.
Aight, I wont make a branch or PR for it now, but I'll outline the implementation details I have in mind more clearly.
Github Action with two jobs:
module.Containerfile
ghcr.io/blue-build/modules/modulename
with correct tags1GitHub Action with one job:
latest_modules/
modules.Containerfile
which does COPY latest_modules /modules
and push it to ghcr.io/blue-build/modules
CLI would use the individual containers by default, and allow specifying the version manually. Unsure what to do with source:
.
I'm liking this idea so far. If we can keep the classic ghcr.io/blue-build/modules:latest
for backwards compatibility, then I could definitely add functionality to pull the module image for each module type we have. We would just have to have a way to support creating new modules without worrying about updating the CLI for each new one.
I could add some logic to check for the presence of a certain module image like by using skopeo
and then do a bind mount on that RUN
instruction for that particular module. Else we will assume that the module is a user-created one. We can continue to use source
as-is for 3rd-party modules that the user would want to use. As for determining the version to use on a per module basis, we could just add a version
property or go with the @
syntax. We could specify that the @
syntax only works for the builtin modules if we really want to
Here's the module stage we have currently:
# Copy modules
# The default modules are inside blue-build/modules
# Custom modules overwrite defaults
FROM scratch AS stage-modules
COPY --from=ghcr.io/blue-build/modules:latest /modules /modules
{%- if self::modules_exists() %}
COPY ./modules /modules
{% endif %}
And here's a portion of the module run that I could edit to handle pulling the particular module image
{%- if let Some(source) = module.source %}
--mount=type=bind,from={{ source }},src=/modules,dst=/tmp/modules,rw \
{%- else %}
--mount=type=bind,from=stage-modules,src=/modules,dst=/tmp/modules,rw \
{%- endif %}
Just realized that if we publish modules with ghcr.io/blue-build/modules/<moduletype>
we can still use the source:
. Newer versions wouldn't pull the ghcr.io/blue-build/modules
contaiber at all. I guess it could be specified that source: local
is needed for local modules, but do that in some sort of soft way where users have a warning period during whch we check whether a module exists in modules/
locally and throw a deprecation warning if it does.
We should discuss the approach to use for versioning modules. Of course using the module repository image hash or something like that could work, but it would be best IMO if it was possible to use SemVer for the modules, and pin each module to a major version such that non-breaking changes are automatically updated to.