feat: Allow use of akmods module#71
Conversation
The akmods module require having the /rpms directory put into /tmp/rpms. By default we will mount the akmods image with the main-latest tag. If a user supplies version-tag for the akmods module in their recipe, it will pull that image version instead and mount the resulting /rpms. This uses bind mount like all the other modules so these files will not persist into the final image
HexSleeves
left a comment
There was a problem hiding this comment.
We can probs my start using macro templates that make this a bit more human readable
Yeah that will be done for this issue |
|
This latest commit will fail, will come back to this later |
…ndard akmods and nvidia images if nvidia-version is given
|
Ok this most recent change now puts all the akmods rpms into a stage. I also added logic to pull both the nvidia and non-nvidia images so that users don't have to specify 2 separate modules to install nvidia and base rpms. |
|
There is no need to use 2 recipe steps, as - type: akmods
base: surface
nvidia-version: 545
install:
- nvidia
- openrazer
- type: akmods
install:
- openrgbI think it's better to have just this, where with - type: akmods
base: surface
nvidia-version: 545
install:
- openrgb
- openrazer I can update bash module to suit this by parsing So basically, this is how it should be running in order:
|
|
Wait, so does definining an Nvidia version automatically pull in Nvidia drivers? I was always under the impression that, since there's Nvidia and non-Nvidia versions of all akmods, there's a subtle difference there and only akmods for Nvidia images can be installed on Nvidia images. I don't get why anyone would reinstall Nvidia, when |
I tried to dive into those nvidia akmod images, to see what is in them, but It reports that image doesn't exist for some reason. But I assume that it's only used to install Nvidia akmod & nothing else based on Bazzite Containerfile. If it contains Nvidia akmod only, then I believe there shouldn't be any overwrite happening. So yeah, normal akmods work on If someone is using Universal Blue image & wants Nvidia, they should use But if someone will use vanilla Fedora image, he would need to install Nvidia akmod as specified in the recipe with I think that some assistance from Universal Blue folks would be nice here. |
|
Thanks for the partial clarification.
This module currently doesn't officially support upstream Fedora, but if it's determined to be usable I guess that could be extended. |
|
I made a PR in bling for I would like to hear thoughts on my PR, on if everything is synced well between bash & cli module. |
Ok so in this case I would only be concerned about pulling the proper base image? |
Yeah. Recipe format is this one I proposed above: - type: akmods
base: surface
nvidia-version: 545
install:
- openrgb
- openrazer |
So then it would only download the |
With this format, it downloads both I set it up in bash module to install regular akmods 1st & Nvidia drivers last. When only |
.... so I do keep my current implementation? I'm confused. Given the module set in my test: modules:
- type: akmods
base: surface
nvidia-version: 545
install:
- nvidia
- openrazer
- type: akmods
install:
- openrgbIt does the following:
This produces the following stages: FROM scratch as stage-akmods-surface-545
COPY --from=ghcr.io/ublue-os/akmods:surface-39 /rpms /rpms
COPY --from=ghcr.io/ublue-os/akmods-nvidia:surface-39-545 /rpms /rpms
FROM scratch as stage-akmods-main
COPY --from=ghcr.io/ublue-os/akmods:main-39 /rpms /rpmsFor the RUN \
# ...
--mount=type=bind,from=stage-akmods-surface-545,src=/rpms,dst=/tmp/rpms,rw \
# ...
&& source /tmp/exports.sh && /tmp/modules/akmods/akmods.sh '{"type":"akmods","base":"surface","nvidia-version":545,"install":["nvidia","openrazer"]}'
RUN \
# ...
--mount=type=bind,from=stage-akmods-main,src=/rpms,dst=/tmp/rpms,rw \
# ...
&& source /tmp/exports.sh && /tmp/modules/akmods/akmods.sh '{"type":"akmods","install":["openrgb"]}'This ensures that there aren't any rpms being overwritten except that which is in the This currently works as the integration tests are run on the recipe in the pipeline. |
Your current implementation is good, this is what Is wanted. The only thing is recipe file format, which has 2 steps, instead of 1, like I proposed above. Can you maintain the same logic you mentioned in 1 step akmod format? |
Oh absolutely, I just put it in there more as being able to test edge cases like having those multiple stages. So I'm going to keep it as is. This file isn't meant for documentation, only testing. |
The akmods module require having the /rpms directory put into /tmp/rpms. By default we will mount the akmods image with the
main-{{ os_version }}tag.If a user supplies
basefor the akmods module in their recipe, it will pull that image tag instead and mount the resulting /rpms.This would pull the image
ghcr.io/ublue-os/akmods:surface-39.A user can also supply
nvidia-versionwith the numerical version of the driver you would like to use. Doing so will mount the appropriateakmods-nvidiaimage with the version of the driver you want in the tag.This would pull the image
ghcr.io/ublue-os/akmods-nvidia:main-39-545andghcr.io/ublue-os/akmods:main-39.This uses bind mount like all the other modules so these files will not persist into the final image.