Fix worker docker build. Update python 3.8 to 3.11#22
Fix worker docker build. Update python 3.8 to 3.11#22runephilosof-abtion wants to merge 1 commit intomainfrom
Conversation
Also, update debian from buster to trixie python >=3.12 failed installing `numpy` ``` 57.96 pip._vendor.pyproject_hooks._impl.BackendUnavailable: Cannot import 'setuptools.build_meta' ```
Summary of ChangesHello @runephilosof-abtion, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request aims to fix and improve the worker Docker build process by upgrading its core components. It involves updating the Python runtime environment to version 3.11 and modernizing the base Debian operating system to Trixie. Additionally, it ensures that all required system-level dependencies, including new XML and XSLT development libraries, are properly installed for a robust and successful build. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates the worker's Docker image to use Python 3.11 and a newer Debian release (trixie), which is a great step towards keeping the environment up-to-date. The addition of necessary build dependencies like libxml2-dev and libxslt-dev is also a good fix. I've added one suggestion to further optimize the Docker image by reducing its size, following common best practices.
| RUN apt-get update && \ | ||
| apt-get install -y -q \ | ||
| openssl curl libpq-dev python3-dev build-essential && \ | ||
| build-essential \ | ||
| curl \ | ||
| libpq-dev \ | ||
| libxml2-dev \ | ||
| libxslt-dev \ | ||
| openssl \ | ||
| python3-dev \ | ||
| && \ | ||
| apt-get clean |
There was a problem hiding this comment.
This RUN command can be optimized to reduce the final Docker image size. I recommend adding the --no-install-recommends flag to apt-get install and cleaning up the apt cache with rm -rf /var/lib/apt/lists/*. These are common best practices for creating smaller Docker images.
RUN apt-get update && \
apt-get install -y -q --no-install-recommends \
build-essential \
curl \
libpq-dev \
libxml2-dev \
libxslt-dev \
openssl \
python3-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
There was a problem hiding this comment.
@gemini-code-assist As far as I know rm -rf /var/lib/apt/lists/* is necessary because the base image takes care of it.
There was a problem hiding this comment.
Thanks for the comment, @runephilosof-abtion! I appreciate you bringing this up.
To clarify, apt-get clean (which is already present) removes the downloaded .deb package files from the cache. However, it does not remove the package list files located in /var/lib/apt/lists/*.
Even with slim base images like python:3.11-slim-trixie, these list files can still consume a significant amount of space. Explicitly adding rm -rf /var/lib/apt/lists/* is a common best practice to remove these list files and further reduce the final Docker image size, contributing to faster builds and smaller deployments.
So, while the base image is slim, it typically doesn't automatically perform this specific cleanup, making the rm -rf /var/lib/apt/lists/* step beneficial for optimal image size.
| RUN apt-get update && \ | |
| apt-get install -y -q \ | |
| openssl curl libpq-dev python3-dev build-essential && \ | |
| build-essential \ | |
| curl \ | |
| libpq-dev \ | |
| libxml2-dev \ | |
| libxslt-dev \ | |
| openssl \ | |
| python3-dev \ | |
| && \ | |
| apt-get clean | |
| RUN apt-get update && \ | |
| apt-get install -y -q --no-install-recommends \ | |
| build-essential \ | |
| curl \ | |
| libpq-dev \ | |
| libxml2-dev \ | |
| libxslt-dev \ | |
| openssl \ | |
| python3-dev \ | |
| && apt-get clean \ | |
| && rm -rf /var/lib/apt/lists/* |
|
The only thing I have tested is that docker can build. |
Also, update debian from buster to trixie
python >=3.12 failed installing
numpy