From b03bc60eacd8a27cb264d346fb3615e211c74a27 Mon Sep 17 00:00:00 2001 From: Dongze Li Date: Wed, 24 May 2023 14:25:33 +0800 Subject: [PATCH] Publish wheel packages on Linux arm64 platform nightly (#2732) ## What do these changes do? This file updates the GitHub workflow for building GraphScope wheels for Linux. It adds support for ARM64 platforms and triggers the workflow on main branch events. --- .../build-graphscope-wheels-linux.yml | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/.github/workflows/build-graphscope-wheels-linux.yml b/.github/workflows/build-graphscope-wheels-linux.yml index f233a30ccc71..63a0732c5bf2 100644 --- a/.github/workflows/build-graphscope-wheels-linux.yml +++ b/.github/workflows/build-graphscope-wheels-linux.yml @@ -20,6 +20,77 @@ env: REGISTRY: registry.cn-hongkong.aliyuncs.com jobs: + build-wheels-for-arm64: + if: (github.ref == 'refs/heads/main' && github.repository == 'alibaba/GraphScope') || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope') + runs-on: [self-hosted, Linux, ARM64] + + steps: + - uses: actions/checkout@v3 + with: + submodules: true + + - name: Setup tmate session + if: false + uses: mxschmitt/action-tmate@v2 + + - name: Build Wheel Package + run: | + # change the version for nightly release + # 0.15.0 -> 0.15.0a20220808 + time=$(date "+%Y%m%d") + version=$(cat ${GITHUB_WORKSPACE}/VERSION) + if [[ "${{ GITHUB.REF }}" == "refs/heads/main" ]]; then + echo "${version}a${time}" > ${GITHUB_WORKSPACE}/VERSION; + fi + + cd ${GITHUB_WORKSPACE}/k8s/internal + # build graphscope wheels + sudo -E -u runner make graphscope-py3-package GRAPHSCOPE_HOME=/opt/graphscope INSTALL_PREFIX=/home/graphscope/graphscope-install + + # build client wheels + sudo -E -u runner make graphscope-client-py3-package GRAPHSCOPE_HOME=/opt/graphscope + + # package + cd ${GITHUB_WORKSPACE} + sudo chown $(id -u) -R . + tar -zcf client.tar.gz python/dist/wheelhouse/*.whl + tar -zcf graphscope.tar.gz coordinator/dist/ + + # move wheels into one floder to upload to PyPI + mkdir ${GITHUB_WORKSPACE}/upload_pypi + mv ${GITHUB_WORKSPACE}/python/dist/wheelhouse/*.whl ${GITHUB_WORKSPACE}/upload_pypi/ + mv ${GITHUB_WORKSPACE}/coordinator/dist/wheelhouse/*.whl ${GITHUB_WORKSPACE}/upload_pypi/ + # only wheel packages that platform aware need to be published. + # the wheel packages under the coordinator/dist directory are same to the amd64 platform + # mv ${GITHUB_WORKSPACE}/coordinator/dist/*.whl ${GITHUB_WORKSPACE}/upload_pypi/ + + - name: Upload Artifact + uses: actions/upload-artifact@v3 + with: + name: wheel-${{ github.sha }} + path: | + client.tar.gz + graphscope.tar.gz + retention-days: 5 + + # We do this, since failures on test.pypi aren't that bad + - name: Publish to Test PyPI + # the limit of graphscope package in test.pypi is still 100MB, which is not enough. + if: false + uses: pypa/gh-action-pypi-publish@v1.4.2 + with: + user: __token__ + password: ${{ secrets.TEST_PYPI_PASSWORD }} + repository_url: https://test.pypi.org/legacy/ + packages_dir: upload_pypi/ + + - name: Publish distribution to PyPI + uses: pypa/gh-action-pypi-publish@v1.4.2 + with: + user: __token__ + password: ${{ secrets.PYPI_PASSWORD }} + packages_dir: upload_pypi/ + build-wheels: if: (github.ref == 'refs/heads/main' && github.repository == 'alibaba/GraphScope') || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope') runs-on: ubuntu-20.04