This repository has been archived by the owner on Oct 11, 2024. It is now read-only.
feat(scripts): clean LLM latency benchmark (#132) #84
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: push | |
on: | |
push: | |
branches: main | |
jobs: | |
dockerhub: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
architecture: x64 | |
- uses: abatilo/actions-poetry@v3 | |
with: | |
poetry-version: "1.7.1" | |
- name: Resolve dependencies | |
run: | | |
poetry export -f requirements.txt --without-hashes --output requirements.txt | |
poetry export -f requirements.txt --without-hashes --only demo --output demo/requirements.txt | |
- name: Build docker images | |
run: | | |
docker build -f src/Dockerfile . -t quackai/contribution-api:latest | |
docker build -f demo/Dockerfile . -t quackai/gradio:latest | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: quackai | |
password: ${{ secrets.DOCKERHUB_PW }} | |
- name: Push to hub | |
run: | | |
docker push quackai/contribution-api:latest | |
docker push quackai/gradio:latest | |
deploy-dev: | |
needs: dockerhub | |
runs-on: ubuntu-latest | |
steps: | |
- uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.SSH_DEV_HOST }} | |
username: ${{ secrets.SSH_DEV_USERNAME }} | |
key: ${{ secrets.SSH_DEPLOY_DEV }} | |
script: | | |
docker pull quackai/contribution-api:latest | |
docker rmi -f $(docker images -f "dangling=true" -q) | |
cd devops && docker compose stop backend && docker compose up -d && docker compose exec backend alembic upgrade head | |
docker inspect -f '{{ .Created }}' $(docker compose images -q backend) | |
- name: Ping server | |
env: | |
DEV_ENDPOINT: ${{ secrets.DEV_ENDPOINT }} | |
run: sleep 10 && curl $DEV_ENDPOINT |