ibmruntimes / Semeru-Runtimes

Issue repo for all things IBM Semeru Runtimes
14 stars 4 forks source link

Issues with installing criu dependencies in UBI based images #58

Closed tjwatson closed 1 year ago

tjwatson commented 1 year ago

The pattern for installing the criu dependencies looks to be identical across the different versions of Java and UBI. It looks like this:

https://github.com/ibmruntimes/semeru-containers/blob/941df52d62fd18a7ff399066dfad840bcb3598a5/11/jdk/ubi/ubi9/Dockerfile.open.releases.full#L20-L25

The last line && dnf update -y; dnf clean all; is problematic becuase of the use of semi-colon (;) instead of &&. This prevents image builds from failing if there is an error in the installation of the dependenices. I noticed this when trying out the Java 17 EA image icr.io/appcafe/ibm-semeru-runtimes:open-17-ea-jdk-ubi9-amd64 where it appears none of the prerequisites were installed in the UBI9 image.

Turns out that it failed to install curl which made it fail to install all the other prerequisites also. When I run the above in my own Dockerfile with UBI9 I saw this error:

Error: 
 Problem: problem with installed package curl-minimal-7.76.1-23.el9_2.2.x86_64
  - package curl-minimal-7.76.1-23.el9_2.2.x86_64 conflicts with curl provided by curl-7.76.1-23.el9_2.2.x86_64
  - package curl-minimal-7.76.1-14.el9.x86_64 conflicts with curl provided by curl-7.76.1-23.el9_2.2.x86_64
  - package curl-minimal-7.76.1-14.el9_0.5.x86_64 conflicts with curl provided by curl-7.76.1-23.el9_2.2.x86_64
  - package curl-minimal-7.76.1-14.el9_0.4.x86_64 conflicts with curl provided by curl-7.76.1-23.el9_2.2.x86_64
  - package curl-minimal-7.76.1-19.el9.x86_64 conflicts with curl provided by curl-7.76.1-23.el9_2.2.x86_64
  - package curl-minimal-7.76.1-19.el9_1.1.x86_64 conflicts with curl provided by curl-7.76.1-23.el9_2.2.x86_64
  - package curl-minimal-7.76.1-19.el9_1.2.x86_64 conflicts with curl provided by curl-7.76.1-23.el9_2.2.x86_64
  - package curl-minimal-7.76.1-23.el9.x86_64 conflicts with curl provided by curl-7.76.1-23.el9_2.2.x86_64
  - package curl-minimal-7.76.1-23.el9_2.1.x86_64 conflicts with curl provided by curl-7.76.1-23.el9_2.2.x86_64
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

I believe two things are required to resolve this issue:

  1. Use && between each dnf call so that if any of them fail it will cause a failure to build the image
  2. Do not try to install curl on UBI9. It appears curl-minimum is already installed in the UBI9 base image which causes conflicts if you try to install the "full" curl package. It seems curl-minimum should provide all that we need in the semeru images.
tjwatson commented 1 year ago

Closing this since it was addressed elsewhere. Thanks.