Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CICD] github workflow to push nightly package to testpypi #734

Merged
merged 66 commits into from
Jan 11, 2025

Conversation

yanxi0830
Copy link
Contributor

@yanxi0830 yanxi0830 commented Jan 9, 2025

What does this PR do?

  • Set up github workflow to push nightly package to testpypi

How it works / Test Plan

  1. Get the version for release package based on how push happens.

  2. Trigger workflow in llama-stack-client & llama-models to build a package using the version:

  3. Wait for the workflows to finish.

  4. After client and models package workflow finishes is pushed, update llama-stack package version & requirements. Then push a package for llama-stack.

image
  1. Simple tests on published package
image

Verify the updated package

pip install --index-url https://pypi.org/simple/ --extra-index-url https://test.pypi.org/simple/ llama-stack==0.0.64.dev20250110

llama stack build --template fireworks --image-type conda
llama stack run fireworks
image

Sources

Please link relevant resources if necessary.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Ran pre-commit to handle lint / formatting issues.
  • Read the contributor guideline,
    Pull Request section?
  • Updated relevant documentation.
  • Wrote necessary unit or integration tests.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jan 9, 2025
@yanxi0830 yanxi0830 changed the title [test only] workflow to push package for testpypi [CICD] github workflow to push package for testpypi Jan 9, 2025
@yanxi0830 yanxi0830 changed the title [CICD] github workflow to push package for testpypi [CICD] github workflow to push nightly rc package to testpypi Jan 9, 2025
@yanxi0830 yanxi0830 marked this pull request as ready for review January 9, 2025 01:24
llama stack list-providers inference
llama stack list-providers telemetry

# TODO: add trigger for integration test workflow & docker builds
Copy link
Contributor Author

Choose a reason for hiding this comment

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

cc @sixianyi0721 we can add a step to trigger integration test flow here using the built package

elif [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT
else
echo "version=${version}.dev$(shuf -i 10000000-99999999 -n 1)" >> $GITHUB_OUTPUT
Copy link
Contributor

Choose a reason for hiding this comment

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

this case happens when you run the workflow adhoc by pressing a button from the UI, for example?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, this case only happens with testing (e.g. on push). If you press the button, you will need to enter the version:
image

| jq '.workflow_runs[0].id')
echo "workflow_id=$run_id" >> $GITHUB_OUTPUT

wait-for-workflows:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

might be able to replace with this action: https://github.com/marketplace/actions/trigger-workflow-and-wait , but keeping it raw and explicit for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

@yanxi0830 yeah I read about some stuff; sounds good to me

fi

# Get the run ID of the triggered workflow
sleep 5 # Wait for workflow to be created
Copy link
Contributor

Choose a reason for hiding this comment

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

is the number "5" recommended? curious.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could probably add a while loop here as well to wait for workflow to be created, like this action (e.g. https://github.com/convictional/trigger-workflow-and-wait/blob/f69fa9eedd3c62a599220f4d5745230e237904be/entrypoint.sh#L137-L142)

@yanxi0830 yanxi0830 merged commit 6d85284 into main Jan 11, 2025
1 check passed
@yanxi0830 yanxi0830 deleted the testpypi-workflow branch January 11, 2025 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants