Skip to content

[add] optimized github actions and dockerfile #64

[add] optimized github actions and dockerfile

[add] optimized github actions and dockerfile #64

# See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/
name: Fly Deploy GPU
on:
push:
branches:
- benchmark
workflow_dispatch: {}
jobs:
deploy:
name: Deploy GPU app
runs-on: ubuntu-latest
concurrency: deploy-group-gpu
# Enable debug logging for GitHub Actions
env:
ACTIONS_RUNNER_DEBUG: true
ACTIONS_STEP_DEBUG: true
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
# Set up uv for Python environment management
- name: Set up uv
id: setup-uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.10"
enable-cache: true
cache-dependency-glob: |
**/requirements*.txt
**/pyproject.toml
src_deploy/setup.sh
# Print system info and uv version
- name: Print system info
run: |
echo "System information:"
uname -a
free -h
df -h
cat /etc/os-release
echo "UV version: ${{ steps.setup-uv.outputs.uv-version }}"
uv --version
- uses: superfly/flyctl-actions/setup-flyctl@master
# Set Fly secrets
- name: Set Fly secrets
run: |
echo "Setting Fly secrets..."
flyctl secrets set --stage --app "stage-content-moderation-server-gpu" HF_TOKEN="$HF_TOKEN"
flyctl secrets set --stage --app "stage-content-moderation-server-gpu" GCP_CREDENTIALS="$GCP_CREDENTIALS"
flyctl secrets set --stage --app "stage-content-moderation-server-gpu" GCS_BUCKET="$GCS_BUCKET"
flyctl secrets set --stage --app "stage-content-moderation-server-gpu" GCS_EMBEDDINGS_PATH="$GCS_EMBEDDINGS_PATH"
flyctl secrets set --stage --app "stage-content-moderation-server-gpu" GCS_PROMPT_PATH="$GCS_PROMPT_PATH"
env:
# todo: use org HF_TOKEN later currently using personal token
HF_TOKEN: ${{ secrets.HF_TOKEN }}
FLY_API_TOKEN: ${{ secrets.FLY_IO_DEPLOY_TOKEN }}
GCP_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS }}
GCS_BUCKET: ${{ secrets.GCS_BUCKET }}
GCS_EMBEDDINGS_PATH: ${{ secrets.GCS_EMBEDDINGS_PATH }}
GCS_PROMPT_PATH: ${{ secrets.GCS_PROMPT_PATH }}
- name: check fly secrets
run: |
echo "Checking fly secrets..."
flyctl secrets list --app stage-content-moderation-server-gpu --verbose
env:
FLY_API_TOKEN: ${{ secrets.FLY_IO_DEPLOY_TOKEN }}
# Check fly status
- name: Check fly status
run: |
echo "Checking fly status..."
flyctl status --app stage-content-moderation-server-gpu --verbose
env:
FLY_API_TOKEN: ${{ secrets.FLY_IO_DEPLOY_TOKEN }}
# Verify Dockerfile exists
- name: Verify Dockerfile
run: |
echo "Checking if Dockerfile exists..."
ls -la ./src_deploy/
cat ./src_deploy/gpu.Dockerfile
# Deploy to Fly with debug flags
- name: Deploy a docker container to fly.io
run: flyctl deploy --remote-only --config src_deploy/gpu.fly.toml --dockerfile ./src_deploy/gpu.Dockerfile
env:
FLY_API_TOKEN: ${{ secrets.FLY_IO_DEPLOY_TOKEN }}