Skip to content

Commit

Permalink
Add nightly release workflow into Github actions (ray-project#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
jovany-wang authored Apr 10, 2023
1 parent 633aac4 commit 2a90477
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 4 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/pypi-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: RayFed 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 == 'ray-project' }}
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:
RAYFED_BUILD_MODE: nightly
run: |
pip install pytest torch cloudpickle cryptography
pip install ray==2.0.0
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 }}
4 changes: 2 additions & 2 deletions .github/workflows/test_on_ray2.0.0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Install bazel
- name: Install basic dependencies
run: |
apt-get update
apt-get install -yq wget gcc g++ python3.9 zlib1g-dev zip libuv1.dev
apt-get install -yq pip
- name: Install dependencies
- name: Install python dependencies
run: |
python3 -m pip install virtualenv
python3 -m virtualenv -p python3 py3
Expand Down
16 changes: 14 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,22 @@
# limitations under the License.

import os
from datetime import datetime

import setuptools
from setuptools import find_packages, setup

# Package and version.
BASE_VERSION = "0.1.0"
build_mode = os.getenv("RAYFED_BUILD_MODE", "")
package_name = os.getenv("RAYFED_PACKAGE_NAME", "rayfed")

if build_mode == "nightly":
VERSION = BASE_VERSION + datetime.today().strftime("b%Y%m%d.dev0")
package_name = "rayfed-nightly"
else:
VERSION = BASE_VERSION + ".dev0"

this_directory = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
Expand Down Expand Up @@ -51,8 +63,8 @@ def run(self):


setup(
name='rayfed',
version='0.1.1a3',
name=package_name,
version=VERSION,
license='Apache 2.0',
description='A multiple parties joint, distributed execution engine based on Ray,'
'to help build your own federated learning frameworks in minutes.',
Expand Down

0 comments on commit 2a90477

Please sign in to comment.