kubevirt / containerized-data-importer

Data Import Service for kubernetes, designed with kubevirt in mind.
Apache License 2.0
395 stars 248 forks source link

Add s390x cross-build libraries to builder container docker file #3289

Open cfilleke opened 1 month ago

cfilleke commented 1 month ago

Is your feature request related to a problem? Please describe: The problem this solves is enabling a cross-build of CDI s390x containers on x86.

Describe the solution you'd like: The libraries for s390x cross-compilation are maintained in the epel repositories, so the preferred solution is to dnf install these libraries directly into the x86 builder container for CDI, i.e. putting these lines into the Dockerfile:

RUN \
       if test "${ARCH}" = amd64; then 
       dnf install -y --setopt=install_weak_deps=False  --installroot /usr/s390x-linux-gnu/sys-root --forcearch s390x --releasever 9 \
          glibc-devel \
          glibc-static && \
      dnf install -y epel-release && \
      dnf install -y --setopt=install_weak_deps=False \
          gcc-s390x-linux-gnu && \
      dnf clean -y all;
fi

Describe alternatives you've considered: It wasn't clear, at first, whether the support for s390x cross-compiles should be statically built into the builder container as in kubevirt, or should be installed on the fly during the build of the CDI images as is done for cross-compile of arm containers.

Additional context: in order to only build the cross-compile support for s390x into the x86 builder container, need to check the architecture of the platform as in the kubevirt builder build.

aglitke commented 1 month ago

/assign @awels

awels commented 1 month ago

So if I understand the question correctly. KubeVirt has one builder per arch, where CDI has one builder, that installs packages based on the detected arch when running the build. And you want to know which version we want to do with CDI. Aka either switch to the KubeVirt model, or keep the CDI model, and install the packages on the fly if we detect s390x build in progress?

cfilleke commented 1 month ago

Good questions! Let me see if I can address that in a design document to attach to the issue today.

On Mon, Jun 3, 2024 at 9:15 AM Alexander Wels @.***> wrote:

So if I understand the question correctly. KubeVirt has one builder per arch, where CDI has one builder, that installs packages based on the detected arch when running the build. And you want to know which version we want to do with CDI. Aka either switch to the KubeVirt model, or keep the CDI model, and install the packages on the fly if we detect s390x build in progress?

— Reply to this email directly, view it on GitHub https://github.com/kubevirt/containerized-data-importer/issues/3289#issuecomment-2145177191, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYDVRINQBMAORXFF2RAUZDZFRT7HAVCNFSM6AAAAABIGLTDCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBVGE3TOMJZGE . You are receiving this because you authored the thread.Message ID: @.***>