From be07dd94c0b0728e64c7871e8ee9c4f3f09d7e61 Mon Sep 17 00:00:00 2001 From: Alan Liddell Date: Mon, 25 Nov 2024 15:27:00 -0500 Subject: [PATCH] wip --- .github/manylinux-wheel.yml | 12 ------- .github/workflows/manylinux-wheel.yml | 46 +++++++++++++++++++++++++++ manylinux.Dockerfile | 39 ++++++++++++++++++++++- scripts/build-wheel-linux.sh | 8 +++-- 4 files changed, 90 insertions(+), 15 deletions(-) delete mode 100644 .github/manylinux-wheel.yml create mode 100644 .github/workflows/manylinux-wheel.yml diff --git a/.github/manylinux-wheel.yml b/.github/manylinux-wheel.yml deleted file mode 100644 index 53d3c92..0000000 --- a/.github/manylinux-wheel.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: "Build a manylinux wheel" - -on: - pull_request: - branches: - - main - -description: 'Greet someone and record the time' - -runs: - using: 'docker' - image: 'manylinux.Dockerfile' diff --git a/.github/workflows/manylinux-wheel.yml b/.github/workflows/manylinux-wheel.yml new file mode 100644 index 0000000..8d32500 --- /dev/null +++ b/.github/workflows/manylinux-wheel.yml @@ -0,0 +1,46 @@ +name: "Build a manylinux wheel" + +on: + push: + branches: + - manylinux-release + +jobs: + build-wheel: + name: Build manylinux wheel + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Install dependencies + run: | + sudo apt-get install -y wget software-properties-common wget lsb-release gnupg + wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null + sudo apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" + sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa + sudo apt-get install cmake g++-10 + + - name: Install vcpkg + run: | + git clone https://github.com/microsoft/vcpkg.git + cd vcpkg && ./bootstrap-vcpkg.sh + echo "VCPKG_ROOT=${{github.workspace}}/vcpkg" >> $GITHUB_ENV + echo "${{github.workspace}}/vcpkg" >> $GITHUB_PATH + ./vcpkg integrate install + + - name: Install dependencies + run: python -m pip install -U pip "pybind11[global]" cmake build + + - name: Build + run: python -m build -o dist + + - name: Upload wheel + uses: actions/upload-artifact@v4 + with: + name: ubuntu-20.04 wheel + path: ${{github.workspace}}/dist/*.whl diff --git a/manylinux.Dockerfile b/manylinux.Dockerfile index f03334d..b2494ec 100644 --- a/manylinux.Dockerfile +++ b/manylinux.Dockerfile @@ -1,4 +1,41 @@ -FROM dockcross/manylinux-x64 +FROM ubuntu:20.04 + +ENV DEBIAN_FRONTEND=noninteractive +ENV TZ=UTC + +RUN apt-get update && apt-get install -y \ + wget \ + software-properties-common \ + lsb-release \ + gnupg + +RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null +RUN apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" + +RUN apt-get install -y \ + build-essential \ + curl \ + git \ + python3-dev \ + python3-pip \ + python3-venv \ + yasm \ + cmake \ + git \ + zip \ + unzip \ + tar \ + && rm -rf /var/lib/apt/lists/* + +RUN python3 -m pip install --upgrade pip \ + && python3 -m pip install \ + wheel \ + setuptools \ + twine \ + auditwheel \ + build + +RUN cd / && git clone https://github.com/microsoft/vcpkg.git && cd vcpkg && ./bootstrap-vcpkg.sh COPY scripts/build-wheel-linux.sh /entrypoint.sh RUN chmod +x /entrypoint.sh diff --git a/scripts/build-wheel-linux.sh b/scripts/build-wheel-linux.sh index 7149c64..8f0f618 100644 --- a/scripts/build-wheel-linux.sh +++ b/scripts/build-wheel-linux.sh @@ -1,4 +1,8 @@ #!/bin/bash -apt update && apt install git -y -python -m pip install \ No newline at end of file +export VCPKG_ROOT=${PWD} +export PATH=\$VCPKG_ROOT:\$PATH + +cd /acquire-zarr +/usr/bin/python3 -m build -o dist +/usr/bin/ls -l dist \ No newline at end of file