lifecycle icon indicating copy to clipboard operation
lifecycle copied to clipboard

Analyzer phase fails to detect difference between ubi8 and ubi9

Open ddusht opened this issue 11 months ago • 4 comments

Summary

We have put together our version of buildpacks within Amex following the cnb standards. We have three options for base images, jammy (ubuntu 22.04), ubi8 (rhel 8.10) and ubi9 (rhel 9.5). When we build any python app (let's say we run pack build sample-python --descriptor ./project.toml --path .) using builder based on ubi8 and then we build the same app with same name sample-python using ubi9 builder then analyzer phase doesn't seem to be able to differentiate between ubi8 & ubi9 which leads to restorer phase to pick up wrong location for shared libraries. See the libcrypt error below. But if we build using builder based on jammy after any of the ubi based builders analyzer phase correctly establishes the difference between two os.

[builder] Buildpack for Pip 1.1.0
[builder]   Resolving Pip version
[builder]     Candidate version sources (in priority order):
[builder]       <unknown> -> ""
[builder] 
[builder]     Selected Pip version (using <unknown>): 24.2.0
[builder] 
[builder]   Reusing cached layer /layers/pip/pip
[builder]   Reusing cached layer /layers/pip/pip-source
[builder] Paketo Buildpack for Pip Install 0.6.6
[builder]   Executing build process
[builder]     Running 'pip install --exists-action=w --cache-dir=/layers/paketo-buildpacks_pip-install/cache --compile --user --disable-pip-version-check --requirement=requirements.txt'
[builder] pip install failed:
[builder] error: exit status 127
[builder]       /layers/cpython/cpython/bin/python: error while loading shared libraries: libcrypt.so.2: cannot open shared object file: No such file or directory
[builder] ERROR: failed to build: exit status 1
ERROR: failed to build: executing lifecycle: failed with status code: 51

Context

lifecycle version

We are on lifecycle version v0.20.1 But the issue exists on the latest v0.20.5 as well

ddusht avatar Feb 06 '25 19:02 ddusht

Hi @ddusht - thanks for filing this issue. Are you declaring target data on your images? https://github.com/buildpacks/spec/blob/main/platform.md#target-data

I am thinking in particular that you need to declare io.buildpacks.base.distro.version for the lifecycle to be able to tell the two rhel versions apart.

natalieparellano avatar Feb 24 '25 19:02 natalieparellano

not related to your issue, but would you be willing to be put in our ADOPTERS.md file?

hone avatar Mar 05 '25 03:03 hone

Hello @natalieparellano, Thank you a quick response and I apologize about the delayed response. But yes we do add io.buildpacks.base.distro.version in our base images but seems to not able to differentiate between 8.10 and 9.5

ARG distro_name="rhel"
ARG distro_version="9.5"
LABEL io.buildpacks.base.distro.name="${distro_name}"
LABEL io.buildpacks.base.distro.version="${distro_version}"
ARG distro_name="rhel"
ARG distro_version="8.10"
LABEL io.buildpacks.base.distro.name="${distro_name}"
LABEL io.buildpacks.base.distro.version="${distro_version}"

ddusht avatar Mar 27 '25 18:03 ddusht

@ddusht - that is interesting. Is it possible to share more output from the analyze & detect phases? What buildpack and platform API versions are you using?

natalieparellano avatar Apr 01 '25 15:04 natalieparellano