Skip to content

Commit

Permalink
Add release nightly (#432)
Browse files Browse the repository at this point in the history
* add nightly yml

Signed-off-by: NKcqx <[email protected]>

* add nightly build option

Signed-off-by: NKcqx <[email protected]>

* fix yaml

Signed-off-by: NKcqx <[email protected]>

* fix yaml

Signed-off-by: NKcqx <[email protected]>

* disable download from oss source

Signed-off-by: NKcqx <[email protected]>

* test ray/core/generated/

Signed-off-by: NKcqx <[email protected]>

* fix dist folder

Signed-off-by: NKcqx <[email protected]>

* standardize version schema

Signed-off-by: NKcqx <[email protected]>

* (tmp) release sdist

Signed-off-by: NKcqx <[email protected]>

* package name to ant-ray

Signed-off-by: NKcqx <[email protected]>

* first manylinux

Signed-off-by: NKcqx <[email protected]>

* build requirements

Signed-off-by: NKcqx <[email protected]>

* rm platform

Signed-off-by: NKcqx <[email protected]>

* select build python version

Signed-off-by: NKcqx <[email protected]>

* install bazel

Signed-off-by: NKcqx <[email protected]>

* tmp skip macos

Signed-off-by: NKcqx <[email protected]>

* nightly build env

Signed-off-by: NKcqx <[email protected]>

* tmp skip py312

Signed-off-by: NKcqx <[email protected]>

* only build on x86_64

Signed-off-by: NKcqx <[email protected]>

* only build on x86_64 & aarch64

Signed-off-by: NKcqx <[email protected]>

* add pypi-release.yml

Signed-off-by: NKcqx <[email protected]>

* daily run

Signed-off-by: NKcqx <[email protected]>

* nightly env var

Signed-off-by: NKcqx <[email protected]>

* no sdist

Signed-off-by: NKcqx <[email protected]>

* pypi release

Signed-off-by: NKcqx <[email protected]>

---------

Signed-off-by: NKcqx <[email protected]>
  • Loading branch information
NKcqx authored Dec 25, 2024
1 parent f924c52 commit 18f085f
Show file tree
Hide file tree
Showing 4 changed files with 207 additions and 39 deletions.
3 changes: 0 additions & 3 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,3 @@ try-import %workspace%/.llvm-local.bazelrc
build:macos --sandbox_block_path=/usr/local/
# This option controls whether javac checks for missing direct dependencies.
build --experimental_strict_java_deps=off

# Enable the experimental downloader config to allow for customizing the download.
build --experimental_downloader_config=.bazel_downloader.cfg
154 changes: 122 additions & 32 deletions .github/workflows/pypi-nightly.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,131 @@
# name: Ant Ray PyPi Nightly

# on:
# schedule:
# - cron: '0 0 * * *'
# # can manually trigger the workflow
# workflow_dispatch:

# jobs:
# build-and-publish:
# # do not run in forks
# if: ${{ github.repository_owner == 'antgroup' }}
# name: build wheel and upload
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2

# - name: Set up Python 3.9
# uses: actions/setup-python@v1
# with:
# python-version: 3.9

# - name: days since the commit date
# run: |
# :
# timestamp=$(git log --no-walk --date=unix --format=%cd $GITHUB_SHA)
# days=$(( ( $(date --utc +%s) - $timestamp ) / 86400 ))
# if [ $days -eq 0 ]; then
# echo COMMIT_TODAY=true >> $GITHUB_ENV
# fi
# - name: Build wheel
# if: env.COMMIT_TODAY == 'true'
# env:
# RAY_DEBUG_BUILD: nightly
# run: |
# cd python
# python setup.py sdist
# - name: Upload
# if: env.COMMIT_TODAY == 'true'
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# packages-dir: python/dist
# password: ${{ secrets.PYPI_API_TOKEN }}

name: Ant Ray PyPi Nightly

on:
on:
schedule:
- cron: '0 0 * * *'
# can manually trigger the workflow
workflow_dispatch:
# pull_request:
# push:
# branches:
# - main
release:
types:
- published

jobs:
build-and-publish:
# do not run in forks
if: ${{ github.repository_owner == 'antgroup' }}
name: build wheel and upload
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# macos-13 is an intel runner, macos-14 is apple silicon
# os: [ubuntu-latest, windows-latest, macos-13, macos-14]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v4

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BEFORE_BUILD_LINUX: pip install "cython>=0.29.32" wheel && ./ci/env/install-bazel.sh
CIBW_BUILD: |
cp39-manylinux_x86_64
cp39-manylinux_aarch64
cp310-manylinux_x86_64
cp310-manylinux_aarch64
cp311-manylinux_x86_64
cp311-manylinux_aarch64
CIBW_ENVIRONMENT: RAY_DEBUG_BUILD=nightly
with:
package-dir: ./python
output-dir: ./python/dist

- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./python/dist/*.whl

upload_pypi:
needs: [build_wheels]
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
# if: github.event_name == 'release' && github.event.action == 'published'
# # or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this)
# # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v2

- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9

- name: days since the commit date
run: |
:
timestamp=$(git log --no-walk --date=unix --format=%cd $GITHUB_SHA)
days=$(( ( $(date --utc +%s) - $timestamp ) / 86400 ))
if [ $days -eq 0 ]; then
echo COMMIT_TODAY=true >> $GITHUB_ENV
fi
- name: Build wheel
if: env.COMMIT_TODAY == 'true'
env:
RAY_DEBUG_BUILD: nightly
run: |
python setup.py bdist_wheel
- name: Upload
if: env.COMMIT_TODAY == 'true'
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- uses: actions/download-artifact@v4
with:
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: python/dist
merge-multiple: true

- uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: python/dist

upload_test_pypi:
needs: [build_wheels]
runs-on: ubuntu-latest
environment: testpypi-publish
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: python/dist
merge-multiple: true

- uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: python/dist
repository-url: https://test.pypi.org/legacy/
80 changes: 80 additions & 0 deletions .github/workflows/pypi-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Ant Ray PyPi Release

on:
workflow_dispatch:
release:
types:
- published

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# macos-13 is an intel runner, macos-14 is apple silicon
# os: [ubuntu-latest, windows-latest, macos-13, macos-14]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v4

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BEFORE_BUILD_LINUX: pip install "cython>=0.29.32" wheel && ./ci/env/install-bazel.sh
CIBW_BUILD: |
cp39-manylinux_x86_64
cp39-manylinux_aarch64
cp310-manylinux_x86_64
cp310-manylinux_aarch64
cp311-manylinux_x86_64
cp311-manylinux_aarch64
with:
package-dir: ./python
output-dir: ./python/dist

- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./python/dist/*.whl

upload_pypi:
needs: [build_wheels]
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
# if: github.event_name == 'release' && github.event.action == 'published'
# # or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this)
# # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v4
with:
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: python/dist
merge-multiple: true

- uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: python/dist

upload_test_pypi:
needs: [build_wheels]
runs-on: ubuntu-latest
environment: testpypi-publish
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: python/dist
merge-multiple: true

- uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: python/dist
repository-url: https://test.pypi.org/legacy/
9 changes: 5 additions & 4 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ def __init__(
elif build_type == BuildType.TSAN:
self.version: str = f"{version}+tsan"
elif build_type == BuildType.NIGHTLY:
version_postfix = datetime.today().strftime("b%Y%m%d")
self.version: str = f"{version}{version_postfix}"
version_postfix = datetime.today().strftime("%Y%m%d")
version = re.sub(r'dev\d*', f'dev{version_postfix}', version)
self.version: str = version
self.name = f"{self.name}-nightly"
else:
self.version = version
Expand Down Expand Up @@ -132,15 +133,15 @@ def get_packages(self):
# "ray-cpp" wheel package.
setup_spec = SetupSpec(
SetupType.RAY_CPP,
"ray-cpp",
"ant-ray-cpp",
"A subpackage of Ray which provides the Ray C++ API.",
BUILD_TYPE,
)
else:
# "ray" primary wheel package.
setup_spec = SetupSpec(
SetupType.RAY,
"ray",
"ant-ray",
"Ray provides a simple, "
"universal API for building distributed applications.",
BUILD_TYPE,
Expand Down

0 comments on commit 18f085f

Please sign in to comment.