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

DNM: Update bundled python to 3.12.0 #3729

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 15 additions & 16 deletions internal/signalfx-agent/bundle/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
ARG ARCH=amd64
ARG JDK_VERSION=11.0.22_7
ARG MAVEN_VERSION=3.6.0
ARG PYTHON_VERSION=3.11.8
ARG PIP_VERSION=21.0.1
ARG PYTHON_VERSION=3.12.2
ARG PIP_VERSION=24.0.0
ARG COLLECTD_VERSION=5.8.0-sfx0
ARG COLLECTD_COMMIT=4d3327b14cf4359029613baf4f90c4952702105e
ARG DOCKER_REPO=docker.io
Expand Down Expand Up @@ -265,9 +265,9 @@ RUN DISABLE_XENCPU=""; if [ "$ARCH" = "ppc64le" ]; then DISABLE_XENCPU="--disabl
--disable-silent-rules \
--disable-static \
--with-java=${JAVA_HOME} \
LIBPYTHON_LDFLAGS="$(python3.11-config --ldflags) -lpython3.11" \
LIBPYTHON_CPPFLAGS="$(python3.11-config --includes)/cpython" \
LIBPYTHON_LIBS="$(python3.11-config --libs) -lpython3.11"
LIBPYTHON_LDFLAGS="$(python3.12-config --ldflags) -lpython3.12" \
LIBPYTHON_CPPFLAGS="$(python3.12-config --includes)/cpython" \
LIBPYTHON_LIBS="$(python3.12-config --libs) -lpython3.12"

# Compile all of collectd first, including plugins
RUN make -j`nproc` &&\
Expand All @@ -293,12 +293,11 @@ COPY scripts/get-collectd-plugins.py /opt/scripts/
COPY scripts/requirements.txt /opt/
COPY collectd-plugins.yaml /opt/

RUN /usr/local/bin/python3 -m pip install -r /opt/requirements.txt

# workaround for https://github.com/yaml/pyyaml/issues/724
RUN /usr/local/bin/python3 -m pip install 'wheel==0.40.0'
RUN /usr/local/bin/python3 -m pip install 'Cython<3.0' 'PyYaml~=5.0' --no-build-isolation

RUN /usr/local/bin/python3 -m pip install -r /opt/requirements.txt

RUN mkdir -p /opt/collectd-python &&\
/usr/local/bin/python3 -u /opt/scripts/get-collectd-plugins.py /opt/collectd-python

Expand All @@ -317,15 +316,15 @@ RUN /usr/local/bin/python3 -m pip list
# Remove pip to avoid usage in python monitor and in exec'd container
RUN /usr/local/bin/python3 -m pip uninstall pip -y
# Delete all bundled wheels
RUN find /usr/local/lib/python3.11 -name "*.whl" -delete
RUN find /usr/local/lib/python3.12 -name "*.whl" -delete

# Delete all compiled python to save space
RUN find /usr/local/lib/python3.11 -name "*.pyc" -o -name "*.pyo" | xargs rm
RUN find /usr/local/lib/python3.12 -name "*.pyc" -o -name "*.pyo" | xargs rm
# We don't support compiling extension modules so don't need this directory
RUN rm -rf /usr/local/lib/python3.11/config-*-linux-gnu
RUN rm -rf /usr/local/lib/python3.12/config-*-linux-gnu

RUN find /usr/local/lib/python3.11 -type d -name __pycache__ | xargs rm -rf {} \;
RUN find /usr/local/lib/python3.11 -wholename "*test*.key" -delete -or -wholename "*test*.pem" -delete
RUN find /usr/local/lib/python3.12 -type d -name __pycache__ | xargs rm -rf {} \;
RUN find /usr/local/lib/python3.12 -wholename "*test*.key" -delete -or -wholename "*test*.pem" -delete


######## Extra packages that don't make sense to pull down in any other stage ########
Expand Down Expand Up @@ -378,9 +377,9 @@ RUN mkdir -p /opt/root/bin &&\
COPY --from=collectd /usr/local/bin/patchelf /usr/bin/

# Gather Python dependencies
COPY --from=python-plugins /usr/local/lib/python3.11 /opt/root/lib/python3.11
COPY --from=python-plugins /usr/local/lib/libpython3.11.so.1.0 /opt/root/lib
COPY --from=python-plugins /usr/local/bin/python3.11 /opt/root/bin/python
COPY --from=python-plugins /usr/local/lib/python3.12 /opt/root/lib/python3.12
COPY --from=python-plugins /usr/local/lib/libpython3.12.so.1.0 /opt/root/lib
COPY --from=python-plugins /usr/local/bin/python3.12 /opt/root/bin/python

# Gather compiled collectd plugin libraries
COPY --from=collectd /usr/sbin/collectd /opt/root/bin/collectd
Expand Down
4 changes: 2 additions & 2 deletions internal/signalfx-agent/bundle/scripts/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PyYAML~=5.0
WMI==1.5.1; sys_platform == "win32"
dbus-python==1.3.2; sys_platform == "linux"
setuptools==69.2.0
setuptools==69.0.3
wheel==0.41.2
4 changes: 2 additions & 2 deletions internal/signalfx-agent/bundle/scripts/windows/bundle.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ $repoDir = "$scriptDir\..\..\..\..\.."
. $scriptDir\common.ps1

$BUILD_DIR="$repoDir\build"
$PYTHON_VERSION="3.11.8"
$PIP_VERSION="21.0.1"
$PYTHON_VERSION="3.12.2"
$PIP_VERSION="24.0.0"
$NUGET_URL="https://aka.ms/nugetclidl"
$NUGET_EXE="nuget.exe"

Expand Down
Loading