Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.

Generate tarball along with wheel build, and upload both in a package to GH #138

Merged
merged 3 commits into from
Mar 28, 2024

Conversation

dhuangnm
Copy link
Member

  1. Generate nm-vllm tar.gz file along with wheel generation
  2. Upload both tar.gz and .whl in a package to GH

A run will look like this:
https://github.com/neuralmagic/nm-vllm/actions/runs/8359879522

@dhuangnm dhuangnm requested a review from mgoin March 28, 2024 15:04
ls -alh dist/
BASE=$(./.github/scripts/convert-version ${{ inputs.python }})
WHL_FILEPATH=$(find dist -iname "*nm_vllm*${BASE}*.whl")
WHL=$(basename ${WHL_FILEPATH})
echo "whl=${WHL}" >> "$GITHUB_OUTPUT"
# generate .tar.gz
$SUCCESS || python3 setup.py sdist || SUCCESS=$?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Dan. The $SUCCESS || in $SUCCESS || python3 setup.py sdist || SUCCESS=$? isn't doing what is intended. I see

/opt/actions-runner/_work/_temp/68fcf277-8944-46d0-8362-4c8020852b3b.sh: line 12: 0: command not found

in https://github.com/neuralmagic/nm-vllm/actions/runs/8359879522/job/22884186408
I think it is safe to remove.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Varun, the $SUCCESS in $SUCCESS || python3 setup.py sdist || SUCCESS=$? is to keep the value in SUCCESS if the previous wheel generation step failed. It'll only run the tarball generation only if $SUCCESS=0, i.e. the wheel generation step is successful.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated command so it'll work as intended, good catch.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Dan.

ls -alh dist/
BASE=$(./.github/scripts/convert-version ${{ inputs.python }})
WHL_FILEPATH=$(find dist -iname "*nm_vllm*${BASE}*.whl")
WHL=$(basename ${WHL_FILEPATH})
echo "whl=${WHL}" >> "$GITHUB_OUTPUT"
# generate .tar.gz
$SUCCESS || python3 setup.py sdist || SUCCESS=$?
ls -alh dist/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is intentional. Using the same dist folder includes the wheel in the tarball. May be use a different directory if it isn't intentional ? @mgoin

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sdist argument is to generate source distribution, i.e. the tar.gz file. It'll be generated under the same folder as the wheel which is generated in an earlier step, i.e. dist/. This is the default output folder for generated packages. We want to keep them under dist/ since we'll upload them both to GH in one step by just providing the dist/ path to an upload action.

@dhuangnm dhuangnm merged commit bdfdb77 into main Mar 28, 2024
6 checks passed
@dhuangnm dhuangnm deleted the tarball branch March 28, 2024 18:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants