diff --git a/.github/workflows/publish-to-docker.yml b/.github/workflows/publish-to-docker.yml index 5fa57a8f6..60fc6edd4 100644 --- a/.github/workflows/publish-to-docker.yml +++ b/.github/workflows/publish-to-docker.yml @@ -1,6 +1,7 @@ name: Docker Build and Publish on: + push: workflow_dispatch: inputs: version: @@ -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 @@ -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 @@ -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 @@ -87,22 +93,34 @@ jobs: - name: Start up built docker image run: | - cd distributions/together - docker compose up - - - name: Start up built docker image - run: | - llama-stack-client models list - - - 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 + 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 + + if [ $timeout -le 0 ]; then + echo "Timeout waiting for endpoint to become available" + exit 1 + fi + + - name: Run test on docker server + run: | + 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 diff --git a/distributions/fireworks/compose.yaml b/distributions/fireworks/compose.yaml index 5cf598ee2..a8645d340 100644 --- a/distributions/fireworks/compose.yaml +++ b/distributions/fireworks/compose.yaml @@ -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 diff --git a/distributions/together/compose.yaml b/distributions/together/compose.yaml index bc41e61f9..354a0bd6e 100644 --- a/distributions/together/compose.yaml +++ b/distributions/together/compose.yaml @@ -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