intel-device-plugins-for-kubernetes icon indicating copy to clipboard operation
intel-device-plugins-for-kubernetes copied to clipboard

intel-idxd-config-initcontainer cannot use UBI base images.

Open mregmi opened this issue 1 year ago • 5 comments

Describe the support request intel-idxd-config-initcontainer cannot be used in OpenShift. The idxd-config initcontainer cannot use UBI minimal images as it is using apt-get to install accel-config. All other Dockerfiles are compatible with UBI. Can we make so that this can also be used with UBI?

System (please complete the following information if applicable):

  • OS version: RHEL 9.2 (openshift)
  • Kernel version: Linux 5.15
  • Device plugins version: v0.29.0
  • Hardware info: DSA

mregmi avatar Mar 20 '24 16:03 mregmi

Can we make so that this can also be used with UBI?

we would not be able to validate (test build) that image since we cannot install accel-config from UBI without the subscription. I guess we could maintain the conditional build flow but we'd need your help to make it suitable for your needs

mythi avatar Mar 21 '24 09:03 mythi

Sure, we are happy to help. we might need help to understand how the conditional flow work in the codebase.

mregmi avatar Mar 21 '24 15:03 mregmi

Would something like this work?

ARG BASEIMG=debian:unstable-slim
FROM ${BASEIMG}
ARG USE_DNF=0
COPY ./LICENSE /licenses/intel-device-plugins-for-kubernetes/LICENSE
RUN if [ $USE_DNF -eq 0 ]; then \
    apt-get update && apt-get install -y --no-install-recommends accel-config jq && rm -rf /var/lib/apt/lists/\*; \
    else dnf install -y accel-config jq; fi
COPY demo/idxd-init.sh /usr/local/bin/
COPY demo/dsa.conf /idxd-init/
COPY demo/iaa.conf /idxd-init/
RUN mkdir /idxd-init/scratch
WORKDIR /idxd-init
ENTRYPOINT ["/usr/local/bin/idxd-init.sh"]

Without build arguments, it would generate the debian based version. With BASEIMG=ubi-something-minimal and USE_DNF=1 it would generate the ubi based one.

Tested with rockylinux:9 which worked, but I'm not sure how the ubi image works.

tkatila avatar Mar 28 '24 12:03 tkatila

We can test this approach and let you know. Thanks

mregmi avatar Mar 29 '24 16:03 mregmi

Without build arguments, it would generate the debian based version.

This has two problems: 1) the OCP build environment (at least used to) does not allow users to add custom build args so the default needs to be what OCP expects and our builder adds custom args, 2) our builder setup currently knows only about "distroless" base image for all the Go images so some additional logic would be needed to decide when to use distroless vs debian.

mythi avatar Apr 02 '24 07:04 mythi