Skip to content

Commit

Permalink
Add MultiRepo Build Packaging Flow and Release Upper Bounds (#45)
Browse files Browse the repository at this point in the history
* add build and publish and bump version 0.1.0

Signed-off-by: Yu Chin Fabian Lim <[email protected]>

* released torch and trl upper bounds #17

Signed-off-by: Yu Chin Fabian Lim <[email protected]>

* update

Signed-off-by: Yu Chin Fabian Lim <[email protected]>

* undo version bump and minor edit

Signed-off-by: Yu Chin Fabian Lim <[email protected]>

---------

Signed-off-by: Yu Chin Fabian Lim <[email protected]>
  • Loading branch information
fabianlim authored Jul 1, 2024
1 parent 49225b6 commit 7fbcd2f
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 16 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- setup: "3.10"
tox: "py310"
plugin_name:
- "framework"
- "accelerated-peft"
- "fused-ops-and-kernels"

permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing

steps:
- uses: actions/checkout@v4

# should only trigger the release if the plugin has changes
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
plugins:
- 'plugins/${{ matrix.plugin_name }}/**'
- if: steps.changes.outputs.plugins == 'true'
name: Set up Python ${{ matrix.python-version.setup }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version.setup }}

- if: steps.changes.outputs.plugins == 'true'
name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
- if: steps.changes.outputs.plugins == 'true'
name: Build and check wheel package
run: |
cd plugins/${{ matrix.plugin_name }}
tox -e build,twinecheck
ls dist/*
- if: steps.changes.outputs.plugins == 'true'
name: "Upload to PyPI"
uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 # v1.9.0
with:
packages-dir: plugins/${{ matrix.plugin_name }}/dist
3 changes: 1 addition & 2 deletions plugins/framework/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ classifiers=[
]
dependencies = [
"numpy<2.0", # numpy needs to be bounded due to incompatiblity with current torch<2.3
"torch>2.2,<2.3",
"torch>2.2",
"transformers<4.40",
"peft",
"accelerate",
"trl<0.9", # trl version needs to be constrained until below issue is resolved. https://github.com/foundation-model-stack/fms-hf-tuning/issues/198
]

[tool.hatch.build.targets.wheel]
Expand Down
28 changes: 14 additions & 14 deletions plugins/framework/tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py, lint
envlist = py, lint, fmt

[testenv]
deps =
Expand All @@ -23,16 +23,16 @@ commands =
black {posargs:.}
isort {posargs:.}

# [testenv:build]
# description = build wheel
# deps =
# build
# commands = python -m build -w
# skip_install = True
#
# [testenv:twinecheck]
# description = check wheel
# deps =
# twine
# commands = twine check dist/*
# skip_install = True
[testenv:build]
description = build wheel
deps =
build
commands = python -m build -w
skip_install = True

[testenv:twinecheck]
description = check wheel
deps =
twine
commands = twine check dist/*
skip_install = True

0 comments on commit 7fbcd2f

Please sign in to comment.