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 for publishing Docker images #764

Merged
merged 24 commits into from
Jan 15, 2025

Conversation

yanxi0830
Copy link
Contributor

@yanxi0830 yanxi0830 commented Jan 14, 2025

What does this PR do?

  • Add Github workflow for publishing docker images.
  • Manual Inputs
    • We can use a (1) TestPyPi version / (2) build via released PyPi version

Notes

  • Keep this workflow manually triggered as we don't want to publish nightly docker images

Additional Changes

  • Resolve issue with running llama stack build in non-terminal device
  File "/home/runner/.local/lib/python3.12/site-packages/llama_stack/distribution/utils/exec.py", line 25, in run_with_pty
    old_settings = termios.tcgetattr(sys.stdin)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
termios.error: (25, 'Inappropriate ioctl for device')
  • Modified build_container.sh to work in non-terminal environment

Test Plan

image
  • Tested published docker image
image
  • /tools API endpoints are served so that docker is correctly using the TestPyPi package
image 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 14, 2025
@yanxi0830 yanxi0830 marked this pull request as ready for review January 15, 2025 00:18
@yanxi0830 yanxi0830 changed the title [wip] docker github publish workflow [CICD] Github workflow for publishing Docker images Jan 15, 2025
@@ -82,13 +82,17 @@ fi
# Add pip dependencies first since llama-stack is what will change most often
# so we can reuse layers.
if [ -n "$pip_dependencies" ]; then
add_to_docker "RUN pip install --no-cache $pip_dependencies"
add_to_docker << EOF
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Have to add these EOF to make these be added to Dockerfile when running script in non-terminal environment.

@ashwinb
Copy link
Contributor

ashwinb commented Jan 15, 2025

❤️ ❤️ ❤️

@yanxi0830 yanxi0830 added this to the v0.1 milestone Jan 15, 2025
Copy link
Contributor

@raghotham raghotham left a comment

Choose a reason for hiding this comment

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

amazing!

Copy link
Collaborator

@terrytangyuan terrytangyuan left a comment

Choose a reason for hiding this comment

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

Great work!

@yanxi0830 yanxi0830 merged commit 32d3abe into main Jan 15, 2025
2 checks passed
@yanxi0830 yanxi0830 deleted the publish-to-docker-workflow branch January 15, 2025 17:01
id: version
run: |
if [ "${{ github.event_name }}" = "push" ]; then
echo "VERSION=0.0.63.dev20250114" >> $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 is hardcoded?

docker push llamastack/distribution-$template:test-${{ steps.version.outputs.version }}
else
docker tag distribution-$template:${{ steps.version.outputs.version }} llamastack/distribution-$template:${{ steps.version.outputs.version }}
docker push llamastack/distribution-$template:${{ steps.version.outputs.version }}
Copy link
Contributor

Choose a reason for hiding this comment

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

we also need to tag a latest tag for the non-nightlies

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.

5 participants