Skip to content

Commit

Permalink
Update builders
Browse files Browse the repository at this point in the history
  • Loading branch information
kwongtn committed Nov 21, 2024
1 parent 3941cb0 commit 17c4419
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 12 deletions.
10 changes: 5 additions & 5 deletions docker/Dockerfile.cli_builder
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@



FROM alpine:3.18 as rust-builder
FROM alpine:3.20 AS rust-builder

RUN apk add wget
ARG TARGETPLATFORM
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docker/gem.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/

Expand Down
18 changes: 16 additions & 2 deletions docker/wheel.Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions ffi.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion pyroscope_ffi/python/manylinux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion pyroscope_ffi/python/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ url = https://pyroscope.io
maintainer = Abid Omar
maintainer_email = [email protected]
license = Apache 2.0
license_file = LICENSE
license_files =
LICENSE
classifiers =
Intended Audience :: Developers
License :: OSI Approved :: Apache Software License
Expand Down

0 comments on commit 17c4419

Please sign in to comment.