mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-10 04:08:31 +00:00
Addressing Comments
This commit is contained in:
parent
8a86a96786
commit
af9371bf95
2 changed files with 15 additions and 91 deletions
91
.github/workflows/build_playground.yml
vendored
91
.github/workflows/build_playground.yml
vendored
|
@ -1,91 +0,0 @@
|
||||||
name: "Build and Push Playground Image"
|
|
||||||
|
|
||||||
env:
|
|
||||||
IMAGE_NAME: "jland/llama-stack-playground"
|
|
||||||
IMAGE_TAG_LATEST: "latest"
|
|
||||||
REGISTRY_URL: "quay.io" # Replace with your registry URL
|
|
||||||
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
|
|
||||||
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- 'llama_stack/distribution/ui/**'
|
|
||||||
push:
|
|
||||||
paths:
|
|
||||||
- 'llama_stack/distribution/ui/**'
|
|
||||||
tags:
|
|
||||||
- '*'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
########################################
|
|
||||||
#### Validate Code and Image Builds ####
|
|
||||||
########################################
|
|
||||||
validate-code:
|
|
||||||
name: Validate Playground Code
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: '3.9'
|
|
||||||
|
|
||||||
- name: "Validate Code"
|
|
||||||
id: validate_code
|
|
||||||
run: |
|
|
||||||
cd llama_stack/distribution/ui
|
|
||||||
pip install -r requirements.txt
|
|
||||||
nohup streamlit run app.py &
|
|
||||||
sleep 10
|
|
||||||
curl -f http://localhost:8501 || exit 1
|
|
||||||
|
|
||||||
########################################
|
|
||||||
#### Validate Code and Image Builds ####
|
|
||||||
########################################
|
|
||||||
validate-image:
|
|
||||||
name: Validate Playground Image Build
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.event_name == 'pull_request'
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
# Build and Push image to registry with tag matching the Git Tag and latest
|
|
||||||
- name: Build and push
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: ./llama_stack/distribution/ui/
|
|
||||||
file: ./llama_stack/distribution/ui/Containerfile
|
|
||||||
push: false
|
|
||||||
tags: ${{ env.REGISTRY_URL }}/${{ env.IMAGE_NAME }}:local
|
|
||||||
ulimit: nofile=4096
|
|
||||||
|
|
||||||
|
|
||||||
validate-and-deploy-image:
|
|
||||||
name: Validate and Deploy Playground Image
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: validate-code
|
|
||||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Login to Image Registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
|
||||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
||||||
registry: ${{ env.REGISTRY_URL }}
|
|
||||||
|
|
||||||
# Build and Push image to registry with tag matching the Git Tag and latest
|
|
||||||
- name: Build and push
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: ./llama_stack/distribution/ui/
|
|
||||||
file: ./llama_stack/distribution/ui/Containerfile
|
|
||||||
push: true
|
|
||||||
tags: ${{ env.REGISTRY_URL }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}, ${{ env.REGISTRY_URL }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG_LATEST }}
|
|
||||||
ulimit: nofile=4096
|
|
|
@ -92,6 +92,8 @@ Interactive pages for users to play with and explore Llama Stack API capabilitie
|
||||||
|
|
||||||
## Starting the Llama Stack Playground
|
## Starting the Llama Stack Playground
|
||||||
|
|
||||||
|
### Llama CLI
|
||||||
|
|
||||||
To start the Llama Stack Playground, run the following commands:
|
To start the Llama Stack Playground, run the following commands:
|
||||||
|
|
||||||
1. Start up the Llama Stack API server
|
1. Start up the Llama Stack API server
|
||||||
|
@ -107,3 +109,16 @@ cd llama_stack/distribution/ui
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
streamlit run app.py
|
streamlit run app.py
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Docker
|
||||||
|
|
||||||
|
Playground can also be started in a docker image:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
export LLAMA_STACK_URL=http://localhost:11434
|
||||||
|
|
||||||
|
docker run \
|
||||||
|
-p 8501:8501 \
|
||||||
|
-e LLAMA_STACK_ENDPOINT=$LLAMA_STACK_URL \
|
||||||
|
quay.io/jland/llama-stack-playground
|
||||||
|
```
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue