[docs] revamp documentation #41
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: CI | |
on: | |
schedule: | |
- cron: "0 10 * * *" | |
push: | |
branches: | |
- "main" | |
tags: | |
- "v*.*.*" | |
pull_request: | |
branches: | |
- "main" | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
pip install "torch>=2.2.2" | |
FLASH_ATTENTION_SKIP_CUDA_BUILD=TRUE FLASH_ATTENTION_FORCE_BUILD=TRUE pip install --no-build-isolation -e ".[CORE,OPTIONAL,DEV,DOCS]" | |
- name: Run tests | |
run: pytest . | |
docker: | |
name: Docker | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- name: Clean unused files | |
run: | | |
sudo rm -rf /usr/local/lib/android || true # will release about 10 GB | |
sudo rm -rf /usr/share/dotnet || true # will release about 20GB | |
sudo rm -rf /opt/ghc || true | |
sudo rm -rf /usr/local/.ghcup || true | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
ghcr.io/servicenow/fast-llm | |
tags: | | |
type=schedule | |
type=ref,event=branch | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
type=sha | |
type=raw,value=latest,enabled={{github.ref == 'refs/heads/main'}} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GHCR | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
# push: ${{ github.event_name != 'pull_request' }} | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=registry,ref=ghcr.io/servicenow/fast-llm:cache | |
cache-to: type=registry,ref=ghcr.io/servicenow/fast-llm:cache,mode=max |