From 17c44198f529768d6d713a1beb51d556a1ad36ba Mon Sep 17 00:00:00 2001 From: KwongTN <5886584+kwongtn@users.noreply.github.com> Date: Thu, 21 Nov 2024 05:22:37 +0000 Subject: [PATCH] Update builders --- docker/Dockerfile.cli_builder | 10 +++++----- docker/gem.Dockerfile | 2 +- docker/wheel.Dockerfile | 18 ++++++++++++++++-- ffi.mk | 4 ++-- pyroscope_ffi/python/manylinux.sh | 2 +- pyroscope_ffi/python/setup.cfg | 3 ++- 6 files changed, 27 insertions(+), 12 deletions(-) diff --git a/docker/Dockerfile.cli_builder b/docker/Dockerfile.cli_builder index 590626b6..799f0218 100644 --- a/docker/Dockerfile.cli_builder +++ b/docker/Dockerfile.cli_builder @@ -1,7 +1,7 @@ -FROM alpine:3.18 as rust-builder +FROM alpine:3.20 AS rust-builder RUN apk add wget ARG TARGETPLATFORM @@ -20,15 +20,15 @@ RUN case "${TARGETPLATFORM}" in \ RUN source ./.env && \ wget https://static.rust-lang.org/rustup/dist/${RUST_TARGET}/rustup-init && \ chmod +x rustup-init && \ - ./rustup-init -y --default-toolchain=1.76.0 --default-host=${RUST_TARGET} + ./rustup-init -y --default-toolchain=stable --default-host=${RUST_TARGET} ENV PATH=/root/.cargo/bin:$PATH RUN apk add make gcc musl-dev RUN source ./.env && \ - wget https://github.com/libunwind/libunwind/releases/download/v1.6.2/libunwind-1.6.2.tar.gz && \ - tar -zxvf libunwind-1.6.2.tar.gz && \ - cd libunwind-1.6.2 && \ + wget https://github.com/libunwind/libunwind/releases/download/v1.8.1/libunwind-1.8.1.tar.gz && \ + tar -zxvf libunwind-1.8.1.tar.gz && \ + cd libunwind-1.8.1 && \ ./configure --disable-minidebuginfo --enable-ptrace --disable-tests --disable-documentation --prefix=/usr/local/musl/${RUST_TARGET} && \ make -j16 && \ make install diff --git a/docker/gem.Dockerfile b/docker/gem.Dockerfile index 06bb8874..603ddedc 100644 --- a/docker/gem.Dockerfile +++ b/docker/gem.Dockerfile @@ -20,7 +20,7 @@ RUN cargo build -p thread_id --release -FROM ruby:3.1 as builder-gem +FROM ruby:3.3 as builder-gem WORKDIR /gem ADD pyroscope_ffi/ruby /gem/ diff --git a/docker/wheel.Dockerfile b/docker/wheel.Dockerfile index 40c2274c..28194c61 100644 --- a/docker/wheel.Dockerfile +++ b/docker/wheel.Dockerfile @@ -1,6 +1,20 @@ -ARG BASE +ARG PLATFORM=x86_64 +FROM quay.io/pypa/manylinux2014_${PLATFORM} AS builder -FROM ${BASE} as builder +RUN curl https://static.rust-lang.org/rustup/dist/$(arch)-unknown-linux-musl/rustup-init -o ./rustup-init \ + && chmod +x ./rustup-init \ + && ./rustup-init -y --default-toolchain=stable --default-host=$(arch)-unknown-linux-gnu +ENV PATH=/root/.cargo/bin:$PATH +RUN yum -y install gcc libffi-devel openssl-devel wget gcc-c++ glibc-devel make + +# for python +ENV LIBUNWIND_VERSION=1.8.1 +RUN wget https://github.com/libunwind/libunwind/releases/download/v${LIBUNWIND_VERSION}/libunwind-${LIBUNWIND_VERSION}.tar.gz \ + && tar -zxvf libunwind-${LIBUNWIND_VERSION}.tar.gz \ + && cd libunwind-${LIBUNWIND_VERSION} \ + && ./configure --disable-minidebuginfo --enable-ptrace --disable-tests --disable-documentation \ + && make \ + && make install WORKDIR /pyroscope-rs diff --git a/ffi.mk b/ffi.mk index 9ff25cdd..95f3d366 100644 --- a/ffi.mk +++ b/ffi.mk @@ -14,7 +14,7 @@ pyroscope_ffi/clean: .phony: wheel/linux/amd64 wheel/linux/amd64: pyroscope_ffi/clean docker buildx build \ - --build-arg=BASE=$(MANYLINUX_PREFIX)_$(BUILD_ARCH_AMD):$(MANYLINUX_VERSION) \ + --build-arg=PLATFORM=x86_64 \ --platform=linux/amd64 \ --output=pyroscope_ffi/python \ -f docker/wheel.Dockerfile \ @@ -23,7 +23,7 @@ wheel/linux/amd64: pyroscope_ffi/clean .phony: wheel/linux/arm64 wheel/linux/arm64: pyroscope_ffi/clean docker buildx build \ - --build-arg=BASE=$(MANYLINUX_PREFIX)_$(BUILD_ARCH_ARM):$(MANYLINUX_VERSION) \ + --build-arg=PLATFORM=aarch64 \ --platform=linux/arm64 \ --output=pyroscope_ffi/python \ -f docker/wheel.Dockerfile \ diff --git a/pyroscope_ffi/python/manylinux.sh b/pyroscope_ffi/python/manylinux.sh index 9a17cb30..ea338ddc 100755 --- a/pyroscope_ffi/python/manylinux.sh +++ b/pyroscope_ffi/python/manylinux.sh @@ -5,7 +5,7 @@ cargo --version # Build wheels # todo this one is deprecated, use "build" package -/opt/python/cp37-cp37m/bin/python setup.py bdist_wheel +/opt/python/cp39-cp39/bin/python setup.py bdist_wheel # Audit wheels for wheel in dist/*-linux_*.whl; do diff --git a/pyroscope_ffi/python/setup.cfg b/pyroscope_ffi/python/setup.cfg index 43c5679b..cd0aee6a 100644 --- a/pyroscope_ffi/python/setup.cfg +++ b/pyroscope_ffi/python/setup.cfg @@ -8,7 +8,8 @@ url = https://pyroscope.io maintainer = Abid Omar maintainer_email = contact@pyroscope.io license = Apache 2.0 -license_file = LICENSE +license_files = + LICENSE classifiers = Intended Audience :: Developers License :: OSI Approved :: Apache Software License