From 9f6d31b809e9886db75a375713eb29fe78d908dd Mon Sep 17 00:00:00 2001 From: anakinxc <103552181+anakinxc@users.noreply.github.com> Date: Tue, 12 Dec 2023 14:07:39 +0800 Subject: [PATCH] Add aarch64 publish (#434) Resolved #224 --- .circleci/dev-release-config.yml | 28 ++++++++++++++++++++--- .circleci/release-config.yml | 39 ++++++++++++++++++++++++++++---- setup.py | 3 +++ 3 files changed, 62 insertions(+), 8 deletions(-) diff --git a/.circleci/dev-release-config.yml b/.circleci/dev-release-config.yml index 27a7757d..29fbd4cb 100644 --- a/.circleci/dev-release-config.yml +++ b/.circleci/dev-release-config.yml @@ -30,11 +30,10 @@ parameters: type: string default: "" - # Define a job to be invoked later in a workflow. # See: https://circleci.com/docs/2.0/configuration-reference/#jobs jobs: - linux_publish: + linux_x64_publish: docker: - image: secretflow/release-ci:latest resource_class: 2xlarge+ @@ -52,6 +51,25 @@ jobs: python3 -m pip install twine ls dist/*.whl + python3 -m twine upload -r pypi -u __token__ -p ${PYPI_TWINE_TOKEN} dist/*.whl + linux_aarch64_publish: + docker: + - image: secretflow/release-ci-aarch64:latest + resource_class: arm.2xlarge + shell: /bin/bash --login -eo pipefail + steps: + - checkout + - run: + name: "build package and publish" + command: | + conda update -n base -c defaults conda -y + conda create -n build python=3.8 -y + conda activate build + + sh ./build_wheel_entrypoint.sh + python3 -m pip install twine + ls dist/*.whl + python3 -m twine upload -r pypi -u __token__ -p ${PYPI_TWINE_TOKEN} dist/*.whl macOS_arm64_publish: macos: @@ -88,7 +106,11 @@ jobs: workflows: dev-publish: jobs: - - linux_publish: + - linux_x64_publish: + filters: + tags: + only: /.*/ + - linux_aarch64_publish: filters: tags: only: /.*/ diff --git a/.circleci/release-config.yml b/.circleci/release-config.yml index 0ba872ce..e16c0f4d 100644 --- a/.circleci/release-config.yml +++ b/.circleci/release-config.yml @@ -27,7 +27,6 @@ parameters: type: string default: "" - # Define a job to be invoked later in a workflow. # See: https://circleci.com/docs/2.0/configuration-reference/#jobs jobs: @@ -95,7 +94,7 @@ jobs: ls dist/*.whl python3 -m twine upload -r pypi -u __token__ -p ${PYPI_TWINE_TOKEN} dist/*.whl - linux_publish: + linux_x64_publish: docker: - image: secretflow/release-ci:latest resource_class: 2xlarge+ @@ -116,6 +115,28 @@ jobs: python3 -m pip install twine ls dist/*.whl + python3 -m twine upload -r pypi -u __token__ -p ${PYPI_TWINE_TOKEN} dist/*.whl + linux_aarch64_publish: + docker: + - image: secretflow/release-ci-aarch64:latest + resource_class: arm.2xlarge + parameters: + python_ver: + type: string + shell: /bin/bash --login -eo pipefail + steps: + - checkout + - run: + name: "build package and publish" + command: | + conda update -n base -c defaults conda -y + conda create -n build python=<< parameters.python_ver >> -y + conda activate build + + sh ./build_wheel_entrypoint.sh + python3 -m pip install twine + ls dist/*.whl + python3 -m twine upload -r pypi -u __token__ -p ${PYPI_TWINE_TOKEN} dist/*.whl # Invoke jobs via workflows @@ -123,7 +144,15 @@ jobs: workflows: publish: jobs: - - linux_publish: + - linux_x64_publish: + matrix: + parameters: + python_ver: ["3.8", "3.9", "3.10", "3.11"] + # This is mandatory to trigger a pipeline when pushing a tag + filters: + tags: + only: /.*/ + - linux_aarch64_publish: matrix: parameters: python_ver: ["3.8", "3.9", "3.10", "3.11"] @@ -134,7 +163,7 @@ workflows: - macOS_x64_publish: matrix: parameters: - python_ver: ['3.8', '3.9', '3.10', '3.11'] + python_ver: ["3.8", "3.9", "3.10", "3.11"] # This is mandatory to trigger a pipeline when pushing a tag filters: tags: @@ -142,7 +171,7 @@ workflows: - macOS_arm64_publish: matrix: parameters: - python_ver: ['3.8', '3.9', '3.10', '3.11'] + python_ver: ["3.8", "3.9", "3.10", "3.11"] # This is mandatory to trigger a pipeline when pushing a tag filters: tags: diff --git a/setup.py b/setup.py index 944da6ae..87e1982d 100644 --- a/setup.py +++ b/setup.py @@ -241,6 +241,9 @@ def has_ext_modules(self): plat_name = "macosx_12_0_x86_64" else: plat_name = "macosx_12_0_arm64" +elif platform.machine() == "aarch64": + # Linux aarch64 + plat_name = "manylinux_2_28_aarch64" setuptools.setup( name=setup_spec.name,