forked from apache/datafusion-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile-build-wheel.x86_64
More file actions
62 lines (55 loc) · 2.05 KB
/
Dockerfile-build-wheel.x86_64
File metadata and controls
62 lines (55 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# syntax=docker/dockerfile:1
FROM quay.io/pypa/manylinux_2_28_x86_64 AS base
ARG TARGETARCH
WORKDIR /root
RUN <<EOF
dnf install -y epel-release
dnf install -y curl pkg-config openssl ca-certificates openssl-devel patchelf autoconf automake make libtool unzip clang libatomic openssh-clients wget
EOF
# Install a newer version of protoc than is available in rocky linux
ARG PROTOC_VERSION=29.3
RUN <<EOF
set -e
if [ "${TARGETARCH}" = "amd64" ]; then
PROTOC_ARCH=x86_64
elif [ "${TARGETARCH}" = "arm64" ]; then
PROTOC_ARCH=aarch_64
else
echo "Unsupported architecture: ${TARGETARCH}"
exit 1
fi
PROTOC_ZIP=protoc-${PROTOC_VERSION}-linux-$PROTOC_ARCH.zip
wget https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/$PROTOC_ZIP
unzip -o "$PROTOC_ZIP" -d /usr/local bin/protoc
unzip -o "$PROTOC_ZIP" -d /usr/local 'include/*'
rm -f "$PROTOC_ZIP"
EOF
RUN <<EOF
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly -y
EOF
RUN --mount=type=ssh,mode=0666 \
<<EOF
mkdir -p -m 0700 ~/.ssh
ssh-keyscan git.corp.adobe.com >> ~/.ssh/known_hosts
ssh-keyscan github.com >> ~/.ssh/known_hosts
EOF
RUN --mount=type=bind,source=src,target=src,readwrite \
--mount=type=bind,source=python,target=python,readwrite \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
--mount=type=bind,source=build.rs,target=build.rs \
--mount=type=bind,source=Cargo.toml,target=Cargo.toml \
--mount=type=bind,source=Cargo.lock,target=Cargo.lock \
--mount=type=bind,source=README.md,target=README.md \
--mount=type=bind,source=LICENSE.txt,target=LICENSE.txt \
--mount=type=cache,mode=0777,target=/root/target \
--mount=type=cache,mode=0777,target=/usr/local/cargo/registry/ \
--mount=type=ssh,mode=0666 \
<<EOF
export PATH="/usr/local/bin:/root/.cargo/bin:/opt/python/cp312-cp312/bin:$PATH"
python3 -m venv venv
source venv/bin/activate
source /root/.cargo/env
pip3 install maturin==1.8.1
maturin build --release --manylinux 2_28 --features protoc,substrait
cp ./target/wheels/*.whl /
EOF