Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python39 base image for lighter image build pipeline job #266

Open
gpplo opened this issue Jan 6, 2025 · 1 comment
Open

python39 base image for lighter image build pipeline job #266

gpplo opened this issue Jan 6, 2025 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@gpplo
Copy link

gpplo commented Jan 6, 2025

Hi Helene,
I managed to build the Grafana Bridge image (v8.0.2) on one of my bare metal servers but the same operation fails inside our GitLab runner on K8s. This latest step is needed to integrate the build operation in our build/deploy pipeline on k8s, where cpu/mem/disk space are limited.
The build operation breaks at this point

“””
STEP 56: RUN yum install -y python39 python3-pip
158Updating Subscription Management repositories.
159Unable to read consumer identity
160This system is not registered with an entitlement server. You can use subscription-manager to register.
161Fatal glibc error: allocatestack.c:192 (advise_stack_range): assertion failed: freesize < size
162subprocess exited on aborted
163subprocess exited with status 1
164error building at STEP "RUN yum install -y python39 python3-pip": exit status 1
“””

Which is actually a heavy step.
I have worked around this doing the following:

  • changing the base image from ubi:9.5-1732804088 to python-39:9.5-1734610342
  • commenting out (at this point unnecessary) “RUN yum install -y python39 python3-pip”

Is this an enhancement you could consider integrating upstream?
Maybe other users would benefit from this.

@gpplo gpplo added the enhancement New feature or request label Jan 6, 2025
@Helene
Copy link
Member

Helene commented Jan 15, 2025

Hi Giuseppe,
I made some changes in the dockerfile with #272

Could you please test it from master branch and give me quick feedback if it works for you or not? (See example 3)

Example usage:

Image building FROM default BASE image (registry.access.redhat.com/ubi9/ubi:9.5-1732804088)

# podman build --format=docker -t bridge_from_ubi:1.0_prod .

Image building with requirements_ubi9 verification (only for internal usage)

# podman build --format=docker --build-arg=BUILD_ENV=test -t bridge_from_ubi:1.1_test .

Image building from passed build-arg BASE (python-39:9.5-1736743782)

Imprtant!
Building image from ubi/python requires to invoke a separate python requirements list.
Therefore the build-arg BUILD_ENV=custom need to be passed through with build command

# podman build --format=docker --build-arg=BASE=python-39:9.5-1736743782 \
               --build-arg=BUILD_ENV=custom -t bridge_from_python:1.0_custom .

Note if you are using docker instead of podman for building images the --format=docker could be skipped.

I'm also waiting for feedback from our CNSA build automation team.
If they don't report any problems, I will include this PR in the next grafana-bridge release.

Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants