Skip to content

[recommendation]: replace debian base image with alpine image#2164

Merged
julianocosta89 merged 1 commit intoopen-telemetry:mainfrom
Red-GV:distroless-python
May 21, 2025
Merged

[recommendation]: replace debian base image with alpine image#2164
julianocosta89 merged 1 commit intoopen-telemetry:mainfrom
Red-GV:distroless-python

Conversation

@Red-GV
Copy link
Copy Markdown
Contributor

@Red-GV Red-GV commented Apr 30, 2025

Changes

This PR updates the Python based images to a distroless image as the final base image instead of the existing slim-bookworm. This results in a smaller image overall.

Merge Requirements

For new features contributions, please make sure you have completed the following
essential items:

  • CHANGELOG.md updated to document new feature additions
  • Appropriate documentation updates in the docs
  • Appropriate Helm chart updates in the helm-charts

Maintainers will not merge until the above have been completed. If you're unsure
which docs need to be changed ping the
@open-telemetry/demo-approvers.

@Red-GV Red-GV requested a review from a team as a code owner April 30, 2025 14:21
@Red-GV
Copy link
Copy Markdown
Contributor Author

Red-GV commented Apr 30, 2025

The image sizes of the resulting images are documented below:

Screenshot 2025-04-30 at 10 14 59 AM

@Red-GV Red-GV force-pushed the distroless-python branch 2 times, most recently from f20264c to d680396 Compare April 30, 2025 15:33
@Red-GV Red-GV changed the title [load-generator/recommendation]: replace alpine base image with distroless image [load-generator/recommendation]: replace debian base image with distroless image Apr 30, 2025
@Red-GV Red-GV force-pushed the distroless-python branch from d680396 to 7161e0f Compare May 5, 2025 02:30
@github-actions
Copy link
Copy Markdown

This PR was marked stale due to lack of activity. It will be closed in 7 days.

Copy link
Copy Markdown
Member

@julianocosta89 julianocosta89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When running this PR, I got the following error on load-generator:

exec /venv/bin/locust: no such file or directory

And this on recommendation:

exec /venv/bin/opentelemetry-instrument: no such file or directory

@Red-GV
Copy link
Copy Markdown
Contributor Author

Red-GV commented May 12, 2025

Heya @julianocosta89 , sorry about that. I had missed that when I created the PR.

I began looking a bit more in the distroless repository and it looks like making the virtual environment work is not as straight forward as I thought. Seems like also alpine is a bit thorny in this arena as well. I'll opt to turn this into a draft and if I cannot find a clean alternative, I will close this PR.

Thanks for your time.

@Red-GV Red-GV marked this pull request as draft May 12, 2025 15:50
@Red-GV Red-GV force-pushed the distroless-python branch 2 times, most recently from 58f0067 to dbe9818 Compare May 20, 2025 02:33
@Red-GV
Copy link
Copy Markdown
Contributor Author

Red-GV commented May 20, 2025

Still working on load generator. Here is the results of using Alpine for recommendation service. Seems to be working with my testing. I did need to bump the grpcio package in order to make it build for this distro.

Screenshot 2025-05-19 at 10 30 56 PM

@Red-GV
Copy link
Copy Markdown
Contributor Author

Red-GV commented May 20, 2025

After some digging, I found this issue which indicates that the playwright plugin is not available in Alpine. I did add a new stage in order to remove some of the libraries that were only used in build phase, which decreased the size by a little.

Screenshot 2025-05-19 at 10 55 33 PM

@Red-GV Red-GV marked this pull request as ready for review May 20, 2025 02:58
@Red-GV
Copy link
Copy Markdown
Contributor Author

Red-GV commented May 20, 2025

@julianocosta89 This PR should be ready for review now. Please see my comments above for new image sizes and changes made.

Copy link
Copy Markdown
Member

@julianocosta89 julianocosta89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Red-GV I've tested locally and I'm still not able to run the load-generator.

No logs this time, just:
load-generator exited with code 1

Signed-off-by: Gerard Vanloo <gerard.vanloo@ibm.com>
@Red-GV Red-GV force-pushed the distroless-python branch from 059b4ad to fb2ff14 Compare May 20, 2025 10:56
@Red-GV Red-GV changed the title [load-generator/recommendation]: replace debian base image with distroless image [recommendation]: replace debian base image with alpine image May 20, 2025
@Red-GV
Copy link
Copy Markdown
Contributor Author

Red-GV commented May 20, 2025

Okay, considering that the base image has not changed, I'll opt to drop the changes out of load-generator. Sorry for the back and forth, @julianocosta89 .

Copy link
Copy Markdown
Member

@julianocosta89 julianocosta89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

thx for bearing with me @Red-GV!

@julianocosta89 julianocosta89 merged commit 9ba8eba into open-telemetry:main May 21, 2025
31 checks passed
@Red-GV Red-GV deleted the distroless-python branch May 21, 2025 14:12
Hailong-am pushed a commit to Hailong-am/opentelemetry-demo that referenced this pull request Jun 9, 2025
cloud-hb pushed a commit to cloud-hb/opentelemetry-demo that referenced this pull request Nov 17, 2025
…try#2164)

Signed-off-by: Gerard Vanloo <gerard.vanloo@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants