-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose infra as a package, publish dev builds (#696)
Publish levanter dev build automatically move stuff from infra/**/*.py into src/levanter/infra/{cli_helpers,tpu,docker}.py make the extra context stuff be optional (I actually have another way of dealing with it in Marin now
- Loading branch information
Showing
14 changed files
with
770 additions
and
595 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Build and Push Docker TPU Base Image | ||
name: Build and Push Docker TPU Images | ||
|
||
on: | ||
push: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Publish Dev Build | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Run Tests"] | ||
types: | ||
- completed | ||
branches: [main] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-package: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success'}} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Calculate Version and Build Number | ||
run: | | ||
PROJECT_VERSION=$(sed -n 's/__version__ = "\(.*\)"/\1/p' src/levanter/__init__.py) | ||
BUILD_NUMBER=$(git rev-list --count HEAD) | ||
FULL_VERSION="${PROJECT_VERSION}.dev${BUILD_NUMBER}" | ||
echo "FULL_VERSION=${FULL_VERSION}" >> $GITHUB_ENV | ||
echo "Calculated version with build number: $FULL_VERSION" | ||
- name: Update pyproject.toml version | ||
run: | | ||
# replace the version in pyproject.toml | ||
sed -i "s/version = \".*\"/version = \"$FULL_VERSION\"/g" pyproject.toml | ||
- name: Build package | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
python -m build | ||
- name: Upload package | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: package | ||
path: dist/ | ||
|
||
|
||
# cf https://test.pypi.org/manage/project/levanter/settings/publishing/ | ||
publish-dev: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build-package | ||
permissions: | ||
id-token: write | ||
steps: | ||
- name: Retrieve release distributions | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: package | ||
path: dist/ | ||
|
||
- name: Publish release distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.