Issue Summary:
KMMO should support the scenario of driver (code) version upgrading.
Suggested Priority(P1-P3) & Urgent(Urgent, medium, Low):
P1 & Urgent
Issue Detail:
For the OOT(OutOfTree) Driver, the Driver(code) version might kept upgrading for adding new feature or bug fixing. So KMMO should support the upgrading of driver version to automatically (build and) upgrade kernel version according to user's configuration.
For Pre-build mode when the pre-build and released OOT driver container images are used, the KMMO should check whether there is a new released(latest) driver image can be used and upgrade the existing driver according to user's configuration. If there are several OOT driver version images exists, the latest (or the specific) version of driver container images can be deployed according to user's configuration.
For on-promise build mode it also can pick up the proper version (or latest) driver source from repo to build driver and package the driver binaries into the driver container image with the proper name and version.
Solution Proposal
Let's start from the OOT driver image name and version control. Below Name Patten is recommended.
DriverName:DriverVersion-KernelVersion(-MachineType)
Machine Type is optional If only single Machine Type is supported.
Using KMMO existing regexp and $KERNEL_FULL_VERSION variable mechanism, KMMO can find the proper driver container image for specific machine type and kernel version.
Adding the DriverVersion into the Name Patten, KMMO can find the proper driver version according to user's configuration.
In order to achieve this goal,
- A new variable $MODULE_VERSION need to be introduced into KMMO
- $MODULE_VERSION should be acquired from the driver project git hub Tags by KMMO
- MODULE_PROJECT_URL Primitive should be introduced into module CRD for KMMO for user to input the URL of the driver project
- MODULE_VERSION primitive should be introduced into module CRD for user to select to use the Latest or specific Version of driver
- in on-premise build mode the Proper driver version code in the specified DRIVER_VERSION (this can be secured when we decouple the building process from module CRD yamal)
- KMMO should automatically upgrade the driver image if user uses latest driver release
Example:
Module CR Yaml
spec:
moduleVersion: Latest
moduleProjectURL: https://github.com/intel/dgpu
...
kernelMappings:
- regexp: '^.*\.x86_64$'
containerImage: quay.io/ocpeng/intel-dgpu-driver-container:$MODUEL_VERSION-$KERNEL_FULL_VERSION
...
For this example, KMMO will always use the latest version of driver code to build the driver container image in on-premise mode; in pre-build mode, it will always find the latest version of prebuild driver container image with the proper kernel version. And the Module Version should acquired by KMMO from the tags of moduleProjetURL: https://github.com/intel/dgpu.
Module CR Yaml
spec:
moduleVersion: 0.1
moduleProjectURL: https://github.com/intel/dgpu
...
kernelMappings:
- regexp: '^.*\.x86_64$'
containerImage: quay.io/ocpeng/intel-dgpu-driver-container:$MODUEL_VERSION-$KERNEL_FULL_VERSION
...
For this example, KMMO will always use the 0.1 version of driver code to build the driver container image in on-premise mode; in pre-build mode, it will always find the 0.1 version of prebuild driver container image with the proper kernel version. And the Module Version should acquired by KMMO from the tags of moduleProjetURL: https://github.com/intel/dgpu.
Subtasks
Obviously, it is a big task and we should split it into several sub tasks to discuss and track