Skip to content

Commit ac1c8c3

Browse files
committed
reuse cibw workflow in maint
1 parent 360cfa9 commit ac1c8c3

File tree

4 files changed

+19
-138
lines changed

4 files changed

+19
-138
lines changed

maint/scripts/docker_build_all.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 2 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,5 @@
11
#!/usr/bin/env bash
22
set -euxo pipefail
33

4-
IMAGE="tilelang-builder:manylinux"
5-
6-
HOST_UNAME=$(uname -m)
7-
case "$HOST_UNAME" in
8-
x86_64) TARGETARCH=amd64 ;;
9-
aarch64|arm64) TARGETARCH=arm64 ;;
10-
*) echo "Unsupported architecture: $HOST_UNAME" >&2; exit 1 ;;
11-
esac
12-
13-
if docker buildx version >/dev/null 2>&1; then
14-
if docker info >/dev/null 2>&1; then
15-
docker run --rm --privileged tonistiigi/binfmt --install amd64,arm64 >/dev/null 2>&1 || true
16-
fi
17-
18-
if ! docker buildx inspect multi >/dev/null 2>&1; then
19-
docker buildx create --name multi --driver docker-container --use >/dev/null 2>&1 || true
20-
else
21-
docker buildx use multi >/dev/null 2>&1 || true
22-
fi
23-
docker buildx inspect --bootstrap >/dev/null 2>&1 || true
24-
25-
for ARCH in amd64 arm64; do
26-
TAG_PLATFORM="linux/${ARCH}"
27-
TAG_IMAGE="${IMAGE}-${ARCH}"
28-
29-
docker buildx build \
30-
--platform "${TAG_PLATFORM}" \
31-
--build-arg TARGETARCH="${ARCH}" \
32-
-f "$(dirname "${BASH_SOURCE[0]}")/pypi.manylinux.Dockerfile" \
33-
-t "${TAG_IMAGE}" \
34-
--load \
35-
.
36-
37-
script="sh maint/scripts/local_distribution.sh"
38-
docker run --rm \
39-
--platform "${TAG_PLATFORM}" \
40-
-v "$(pwd):/tilelang" \
41-
"${TAG_IMAGE}" \
42-
/bin/bash -lc "$script"
43-
44-
if [ -d dist ]; then
45-
mv -f dist "dist-local-${ARCH}"
46-
fi
47-
done
48-
49-
else
50-
echo "docker buildx not found; building only host arch: ${TARGETARCH}" >&2
51-
TAG_IMAGE="${IMAGE}-${TARGETARCH}"
52-
TAG_PLATFORM="linux/${TARGETARCH}"
53-
54-
docker build \
55-
--build-arg TARGETARCH="$TARGETARCH" \
56-
-f "$(dirname "${BASH_SOURCE[0]}")/pypi.manylinux.Dockerfile" \
57-
-t "${TAG_IMAGE}" \
58-
.
59-
60-
script="sh maint/scripts/local_distribution.sh"
61-
docker run --rm \
62-
--platform "${TAG_PLATFORM}" \
63-
-v "$(pwd):/tilelang" \
64-
"${TAG_IMAGE}" \
65-
/bin/bash -lc "$script"
66-
67-
if [ -d dist ]; then
68-
mv -f dist "dist-local-${TARGETARCH}"
69-
fi
70-
fi
4+
# Build for local architecture
5+
CIBW_BUILD='cp38-*' cibuildwheel .
Lines changed: 3 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
#!/usr/bin/env bash
22
set -euxo pipefail
33

4-
IMAGE="tilelang-builder:manylinux"
5-
6-
HOST_UNAME=$(uname -m)
7-
case "$HOST_UNAME" in
8-
x86_64) TARGETARCH=amd64 ;;
9-
aarch64|arm64) TARGETARCH=arm64 ;;
10-
*) echo "Unsupported architecture: $HOST_UNAME" >&2; exit 1 ;;
11-
esac
12-
134
if docker buildx version >/dev/null 2>&1; then
145
if docker info >/dev/null 2>&1; then
156
docker run --rm --privileged tonistiigi/binfmt --install amd64,arm64 >/dev/null 2>&1 || true
@@ -21,50 +12,9 @@ if docker buildx version >/dev/null 2>&1; then
2112
docker buildx use multi >/dev/null 2>&1 || true
2213
fi
2314
docker buildx inspect --bootstrap >/dev/null 2>&1 || true
24-
25-
for ARCH in amd64 arm64; do
26-
TAG_PLATFORM="linux/${ARCH}"
27-
TAG_IMAGE="${IMAGE}-${ARCH}"
28-
29-
docker buildx build \
30-
--platform "${TAG_PLATFORM}" \
31-
--build-arg TARGETARCH="${ARCH}" \
32-
-f "$(dirname "${BASH_SOURCE[0]}")/pypi.manylinux.Dockerfile" \
33-
-t "${TAG_IMAGE}" \
34-
--load \
35-
.
36-
37-
script="sh maint/scripts/pypi_distribution.sh"
38-
docker run --rm \
39-
--platform "${TAG_PLATFORM}" \
40-
-v "$(pwd):/tilelang" \
41-
"${TAG_IMAGE}" \
42-
/bin/bash -lc "$script"
43-
44-
if [ -d dist ]; then
45-
mv -f dist "dist-pypi-${ARCH}"
46-
fi
4715
done
4816

49-
else
50-
echo "docker buildx not found; building only host arch: ${TARGETARCH}" >&2
51-
TAG_IMAGE="${IMAGE}-${TARGETARCH}"
52-
TAG_PLATFORM="linux/${TARGETARCH}"
53-
54-
docker build \
55-
--build-arg TARGETARCH="$TARGETARCH" \
56-
-f "$(dirname "${BASH_SOURCE[0]}")/pypi.manylinux.Dockerfile" \
57-
-t "${TAG_IMAGE}" \
58-
.
59-
60-
script="sh maint/scripts/pypi_distribution.sh"
61-
docker run --rm \
62-
--platform "${TAG_PLATFORM}" \
63-
-v "$(pwd):/tilelang" \
64-
"${TAG_IMAGE}" \
65-
/bin/bash -lc "$script"
66-
67-
if [ -d dist ]; then
68-
mv -f dist "dist-pypi-${TARGETARCH}"
69-
fi
17+
export CIBW_ARCHS='x86_64 aarch64'
7018
fi
19+
20+
NO_VERSION_LABEL=ON CIBW_BUILD='cp38-*' cibuildwheel .
Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1-
ARG TARGETARCH
2-
FROM pytorch/manylinux2_28-builder:cuda12.1 AS builder_amd64
3-
ENV CUDA_VERSION=12.1 \
4-
AUDITWHEEL_PLAT=manylinux_2_28_x86_64
5-
RUN pip3 install uv
1+
FROM quay.io/pypa/manylinux2014_x86_64 AS builder_amd64
2+
3+
RUN yum-config-manager --add-repo https://developer.download.nvidia.cn/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo
4+
5+
ARG CUDA_VERSION=12.1
6+
ENV CUDA_VERSION=${CUDA_VERSION}
7+
8+
FROM quay.io/pypa/manylinux_2_28_aarch64 AS builder_arm64
69

7-
FROM pytorch/manylinuxaarch64-builder:cuda12.8 AS builder_arm64
8-
ENV CUDA_VERSION=12.8 \
9-
AUDITWHEEL_PLAT=manylinux_2_28_aarch64
10-
RUN /opt/python/cp312-cp312/bin/pip install uv
10+
RUN dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel8/sbsa/cuda-rhel8.repo
1111

12+
ARG CUDA_VERSION=12.8
13+
ENV CUDA_VERSION=${CUDA_VERSION}
14+
15+
ARG TARGETARCH
1216
FROM builder_${TARGETARCH}
1317

1418
ENV DEBIAN_FRONTEND=noninteractive \
@@ -19,12 +23,7 @@ ENV PATH="/usr/local/cuda/bin:${PATH}"
1923
ENV LD_LIBRARY_PATH="/usr/local/cuda/lib64:${LD_LIBRARY_PATH}"
2024

2125
RUN set -eux; \
22-
uv venv -p 3.12 --seed /venv; \
26+
pipx install cibuildwheel; \
2327
git config --global --add safe.directory '/tilelang'
2428

25-
ENV PATH="/venv/bin:$PATH" \
26-
VIRTUAL_ENV=/venv
27-
28-
RUN uv pip install build wheel
29-
3029
WORKDIR /tilelang

0 commit comments

Comments
 (0)