Skip to content

docs: update use llama-server instead #24

docs: update use llama-server instead

docs: update use llama-server instead #24

Workflow file for this run

name: Docker Image
on:
push:
tags:
- '*/v*'
pull_request:
branches:
- 'main'
env:
IMAGE_DOMAIN: premai
jobs:
build-and-push:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# ADD NEW Dockerfile directories HERE!!!
contexts: [deepspeed-mii, elia, llm-cli, gptscript]
steps:
- uses: actions/setup-go@v4
if: startsWith(github.ref, format('refs/tags/{0}/v', matrix.contexts))
with:
go-version: '>=1.17.0'
- name: Checkout repository
if: startsWith(github.ref, format('refs/tags/{0}/v', matrix.contexts))
uses: actions/checkout@v4
- name: Get tags
if: startsWith(github.ref, format('refs/tags/{0}/v', matrix.contexts))
run: git fetch --tags origin --force
- name: Log in to the Container registry
if: startsWith(github.ref, format('refs/tags/{0}/v', matrix.contexts))
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
if: startsWith(github.ref, format('refs/tags/{0}/v', matrix.contexts))
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.IMAGE_DOMAIN }}/${{ matrix.contexts }}
tags: |
type=ref,event=branch,suffix=-{{date 'YYYYMMDDHHmmss'}}
type=sha,suffix=-{{date 'YYYYMMDDHHmmss'}}
type=match,pattern=${{ matrix.contexts }}/v(\d+.\d+.\d+),group=1
flavor: |
prefix=
suffix=
# Taken from LocalAI
- name: Release space from worker
if: startsWith(github.ref, format('refs/tags/{0}/v', matrix.contexts))
run: |
echo "Listing top largest packages"
pkgs=$(dpkg-query -Wf '${Installed-Size}\t${Package}\t${Status}\n' | awk '$NF == "installed"{print $1 "\t" $2}' | sort -nr)
head -n 30 <<< "${pkgs}"
echo
df -h
echo
sudo apt-get remove -y '^llvm-.*|^libllvm.*' || true
sudo apt-get remove --auto-remove android-sdk-platform-tools || true
sudo apt-get purge --auto-remove android-sdk-platform-tools || true
sudo rm -rf /usr/local/lib/android
sudo apt-get remove -y '^dotnet-.*|^aspnetcore-.*' || true
sudo rm -rf /usr/share/dotnet
sudo apt-get remove -y '^mono-.*' || true
sudo apt-get remove -y '^ghc-.*' || true
sudo apt-get remove -y '.*jdk.*|.*jre.*' || true
sudo apt-get remove -y 'php.*' || true
sudo apt-get remove -y hhvm powershell firefox monodoc-manual msbuild || true
sudo apt-get remove -y '^google-.*' || true
sudo apt-get remove -y azure-cli || true
sudo apt-get remove -y '^mongo.*-.*|^postgresql-.*|^mysql-.*|^mssql-.*' || true
sudo apt-get remove -y '^gfortran-.*' || true
sudo apt-get remove -y microsoft-edge-stable || true
sudo apt-get remove -y firefox || true
sudo apt-get remove -y powershell || true
sudo apt-get remove -y r-base-core || true
sudo apt-get autoremove -y
sudo apt-get clean
echo
echo "Listing top largest packages"
pkgs=$(dpkg-query -Wf '${Installed-Size}\t${Package}\t${Status}\n' | awk '$NF == "installed"{print $1 "\t" $2}' | sort -nr)
head -n 30 <<< "${pkgs}"
echo
sudo rm -rfv build || true
sudo rm -rf /usr/share/dotnet || true
sudo rm -rf /opt/ghc || true
sudo rm -rf "/usr/local/share/boost" || true
sudo rm -rf "$AGENT_TOOLSDIRECTORY" || true
df -h
- name: Build and push Docker image
if: startsWith(github.ref, format('refs/tags/{0}/v', matrix.contexts))
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: ./containers/${{ matrix.contexts }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}