Skip to content

Commit

Permalink
try test docker
Browse files Browse the repository at this point in the history
  • Loading branch information
yanxi0830 committed Jan 18, 2025
1 parent d140b73 commit ff55bac
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 22 deletions.
54 changes: 36 additions & 18 deletions .github/workflows/publish-to-docker.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Docker Build and Publish

on:
push:
workflow_dispatch:
inputs:
version:
Expand All @@ -11,6 +12,10 @@ on:
jobs:
build-and-push:
runs-on: ubuntu-latest
env:
TOGETHER_API_KEY: ${{ secrets.TOGETHER_API_KEY }}
FIREWORKS_API_KEY: ${{ secrets.FIREWORKS_API_KEY }}
TAVILY_SEARCH_API_KEY: ${{ secrets.TAVILY_SEARCH_API_KEY }}
permissions:
contents: read
packages: write
Expand All @@ -32,7 +37,7 @@ jobs:
id: version
run: |
if [ "${{ github.event_name }}" = "push" ]; then
echo "VERSION=0.0.63.dev20250114" >> $GITHUB_OUTPUT
echo "VERSION=0.0.63.dev51206766" >> $GITHUB_OUTPUT
else
echo "VERSION=${{ inputs.version }}" >> $GITHUB_OUTPUT
fi
Expand Down Expand Up @@ -72,7 +77,8 @@ jobs:
- name: Build docker image
run: |
TEMPLATES=("ollama" "bedrock" "remote-vllm" "fireworks" "together" "tgi" "meta-reference-gpu")
# TEMPLATES=("ollama" "bedrock" "remote-vllm" "fireworks" "together" "tgi" "meta-reference-gpu")
TEMPLATES=("fireworks")
for template in "${TEMPLATES[@]}"; do
if [ "$PYPI_SOURCE" = "testpypi" ]; then
TEST_PYPI_VERSION=${{ steps.version.outputs.version }} llama stack build --template $template --image-type container
Expand All @@ -87,22 +93,34 @@ jobs:
- name: Start up built docker image
run: |
cd distributions/together
docker compose up
cd distributions/fireworks
docker compose up -d
# Wait for the container to start
timeout=300
while ! curl -s -f http://localhost:8321/v1/version > /dev/null && [ $timeout -gt 0 ]; do
echo "Waiting for endpoint to be available..."
sleep 5
timeout=$((timeout - 5))
done
- name: Start up built docker image
run: |
llama-stack-client models list
if [ $timeout -le 0 ]; then
echo "Timeout waiting for endpoint to become available"
exit 1
fi
- name: Push to dockerhub
- name: Run test on docker server
run: |
TEMPLATES=("ollama" "bedrock" "remote-vllm" "fireworks" "together" "tgi" "meta-reference-gpu")
for template in "${TEMPLATES[@]}"; do
if [ "$PYPI_SOURCE" = "testpypi" ]; then
docker tag distribution-$template:test-${{ steps.version.outputs.version }} llamastack/distribution-$template:test-${{ steps.version.outputs.version }}
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 }}
fi
done
LLAMA_STACK_BASE_URL="http://localhost:8321" pytest -v tests/client-sdk/inference/test_inference.py --md-report --md-report-verbose=1
# - name: Push to dockerhub
# run: |
# TEMPLATES=("ollama" "bedrock" "remote-vllm" "fireworks" "together" "tgi" "meta-reference-gpu")
# for template in "${TEMPLATES[@]}"; do
# if [ "$PYPI_SOURCE" = "testpypi" ]; then
# docker tag distribution-$template:test-${{ steps.version.outputs.version }} llamastack/distribution-$template:test-${{ steps.version.outputs.version }}
# 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 }}
# fi
# done
4 changes: 2 additions & 2 deletions distributions/fireworks/compose.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
services:
llamastack:
image: llamastack/fireworks
image: distribution-fireworks:test-0.0.63.dev51206766
ports:
- "8321:8321"
environment:
- FIREWORKS_API_KEY=${FIREWORKS_API_KEY}
entrypoint: bash -c "llama stack run fireworks"
entrypoint: bash -c "python -m llama_stack.distribution.server.server --template fireworks"
deploy:
restart_policy:
condition: on-failure
Expand Down
4 changes: 2 additions & 2 deletions distributions/together/compose.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
services:
llamastack:
image: llamastack/together
image: distribution-together:test-0.0.63.dev51206766
ports:
- "8321:8321"
environment:
- TOGETHER_API_KEY=${TOGETHER_API_KEY}
entrypoint: bash -c "llama stack run together"
entrypoint: bash -c "python -m llama_stack.distribution.server.server --template together"
deploy:
restart_policy:
condition: on-failure
Expand Down

0 comments on commit ff55bac

Please sign in to comment.