This repository has been archived by the owner on Oct 11, 2024. It is now read-only.
forked from vllm-project/vllm
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upload RELEASE wheel to pypi.org (#361)
Besides uploading all generated assets to our NeuralMagic pypi server, we also want to push generated wheels to the external pypi.org server for RELEASE versions only. The structure of the workflows doesn't allow pre-testing of these changes, since they should only apply when wf_category is "RELEASE". Discussing w/ @andy-neuma , we'll just have to see if it fails/succeeds when we're ready to release. --------- Co-authored-by: Andy Linfoot <[email protected]> Co-authored-by: andy-neuma <[email protected]>
- Loading branch information
1 parent
f43762f
commit 52844c0
Showing
4 changed files
with
71 additions
and
11 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,18 +1,17 @@ | ||
name: cp assets | ||
description: "cp whl and tarfile to Google storage 'neuralmagic-public-pypi/dist'" | ||
inputs: | ||
whl: | ||
description: "the wheel asset file path" | ||
required: true | ||
targz: | ||
description: "the tar.gz asset file path" | ||
required: true | ||
runs: | ||
using: composite | ||
steps: | ||
- id: cp_assets | ||
run: | | ||
WHL=$(find assets -type f -name "*nm_vllm*.whl") | ||
WHL_FILE=$(basename ${WHL}) | ||
echo "whl: ${WHL}" | ||
echo "whl_file: ${WHL_FILE}" | ||
TAR=$(find assets -path "*nm-vllm*.tar.gz" -type f -name "nm-vllm*.tar.gz") | ||
TAR_FILE=$(basename ${TAR}) | ||
echo "tar: ${TAR}" | ||
echo "tar_file: ${TAR_FILE}" | ||
gcloud storage cp ${WHL} gs://neuralmagic-public-pypi/dist/${WHL_FILE} | ||
gcloud storage cp ${TAR} gs://neuralmagic-public-pypi/dist/${TAR_FILE} | ||
gcloud storage cp ${WHL} gs://neuralmagic-public-pypi/dist/${{ inputs.whl }} | ||
gcloud storage cp ${TAR} gs://neuralmagic-public-pypi/dist/${{ inputs.targz }} | ||
shell: bash |
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,25 @@ | ||
name: get wheel and tar.gz names | ||
description: "retrieve the whl and tarfile names from existing assets" | ||
outputs: | ||
whl: | ||
description: "the wheel asset file path" | ||
value: ${{ steps.whl_targz_names.outputs.whl }} | ||
targz: | ||
description: "the tar.gz asset file path" | ||
value: ${{ steps.whl_targz_names.outputs.targz }} | ||
runs: | ||
using: composite | ||
steps: | ||
- id: whl_targz_names | ||
run: | | ||
WHL=$(find assets -type f -name "*nm_vllm*.whl") | ||
WHL_FILE=$(basename ${WHL}) | ||
echo "whl: ${WHL}" | ||
echo "whl_file: ${WHL_FILE}" | ||
TAR=$(find assets -path "*nm-vllm*.tar.gz" -type f -name "nm-vllm*.tar.gz") | ||
TAR_FILE=$(basename ${TAR}) | ||
echo "tar: ${TAR}" | ||
echo "tar_file: ${TAR_FILE}" | ||
echo "whl=${WHL_FILE}" >> $GITHUB_OUTPUT | ||
echo "targz=${TAR_FILE}" >> $GITHUB_OUTPUT | ||
shell: bash |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,10 @@ on: | |
description: 'git commit hash or branch name' | ||
type: string | ||
required: true | ||
wf_category: | ||
description: "workflow category: REMOTE, NIGHTLY, RELEASE" | ||
type: string | ||
default: "REMOTE" | ||
|
||
workflow_dispatch: | ||
inputs: | ||
|
@@ -31,6 +35,10 @@ on: | |
description: 'git commit hash or branch name' | ||
type: string | ||
required: true | ||
wf_category: | ||
description: "workflow category: REMOTE, NIGHTLY, RELEASE" | ||
type: string | ||
default: "REMOTE" | ||
|
||
jobs: | ||
|
||
|
@@ -68,6 +76,30 @@ jobs: | |
with: | ||
path: assets | ||
|
||
- name: get wheel and tar.gz names | ||
id: whl_targz_names | ||
uses: ./.github/actions/nm_whl_tar_gz_names | ||
|
||
# this workflow is only run if push-to-pypi is True, and we only | ||
# want to push RELEASE assets to the external pypi.org | ||
# publish the wheel file | ||
- name: push wheel to pypi.org | ||
if: ${{ inputs.wf_category == "RELEASE" }} | ||
uses: neuralmagic/nm-actions/actions/publish_whl/[email protected] | ||
with: | ||
username: ${{ secrets.PYPI_PUBLIC_USER }} | ||
password: ${{ secrets.PYPI_PUBLIC_AUTH }} | ||
whl: ${{ steps.whl_targz_names.outputs.whl }} | ||
|
||
# publish the tar.gz file | ||
- name: push tar.gz to pypi.org | ||
if: ${{ inputs.wf_category == "RELEASE" }} | ||
uses: neuralmagic/nm-actions/actions/publish_whl/[email protected] | ||
with: | ||
username: ${{ secrets.PYPI_PUBLIC_USER }} | ||
password: ${{ secrets.PYPI_PUBLIC_AUTH }} | ||
whl: ${{ steps.whl_targz_names.outputs.targz }} | ||
|
||
# GCP | ||
- name: 'Authenticate to Google Cloud' | ||
id: auth | ||
|
@@ -85,6 +117,9 @@ jobs: | |
- name: cp assets | ||
id: cp-assets | ||
uses: ./.github/actions/nm-cp-assets/ | ||
with: | ||
whl: ${{ steps.whl_targz_names.outputs.whl }} | ||
targz: ${{ steps.whl_targz_names.outputs.targz }} | ||
|
||
- name: trigger stratus nm-pypi update workflow to update nm-pypi index | ||
uses: actions/github-script@v6 | ||
|