mirror of
https://github.com/mudler/LocalAI.git
synced 2024-12-19 12:47:54 +00:00
54688db994
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [docker/metadata-action](https://togithub.com/docker/metadata-action) | action | major | `v4` -> `v5` | --- ### Release Notes <details> <summary>docker/metadata-action (docker/metadata-action)</summary> ### [`v5`](https://togithub.com/docker/metadata-action/compare/v4...v5) [Compare Source](https://togithub.com/docker/metadata-action/compare/v4...v5) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/go-skynet/LocalAI). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi44My4wIiwidXBkYXRlZEluVmVyIjoiMzYuODMuMCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
142 lines
4.7 KiB
YAML
142 lines
4.7 KiB
YAML
---
|
|
name: 'build container images'
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- master
|
|
tags:
|
|
- '*'
|
|
|
|
concurrency:
|
|
group: ci-${{ github.head_ref || github.ref }}-${{ github.repository }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
docker:
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- build-type: ''
|
|
platforms: 'linux/amd64,linux/arm64'
|
|
tag-latest: 'auto'
|
|
tag-suffix: ''
|
|
ffmpeg: ''
|
|
- build-type: 'cublas'
|
|
cuda-major-version: 11
|
|
cuda-minor-version: 7
|
|
platforms: 'linux/amd64'
|
|
tag-latest: 'false'
|
|
tag-suffix: '-cublas-cuda11'
|
|
ffmpeg: ''
|
|
- build-type: 'cublas'
|
|
cuda-major-version: 12
|
|
cuda-minor-version: 1
|
|
platforms: 'linux/amd64'
|
|
tag-latest: 'false'
|
|
tag-suffix: '-cublas-cuda12'
|
|
ffmpeg: ''
|
|
- build-type: ''
|
|
platforms: 'linux/amd64,linux/arm64'
|
|
tag-latest: 'false'
|
|
tag-suffix: '-ffmpeg'
|
|
ffmpeg: 'true'
|
|
- build-type: 'cublas'
|
|
cuda-major-version: 11
|
|
cuda-minor-version: 7
|
|
platforms: 'linux/amd64'
|
|
tag-latest: 'false'
|
|
tag-suffix: '-cublas-cuda11-ffmpeg'
|
|
ffmpeg: 'true'
|
|
- build-type: 'cublas'
|
|
cuda-major-version: 12
|
|
cuda-minor-version: 1
|
|
platforms: 'linux/amd64'
|
|
tag-latest: 'false'
|
|
tag-suffix: '-cublas-cuda12-ffmpeg'
|
|
ffmpeg: 'true'
|
|
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Release space from worker
|
|
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 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
|
|
df -h
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Docker meta
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: quay.io/go-skynet/local-ai
|
|
tags: |
|
|
type=ref,event=branch
|
|
type=semver,pattern={{raw}}
|
|
type=sha
|
|
flavor: |
|
|
latest=${{ matrix.tag-latest }}
|
|
suffix=${{ matrix.tag-suffix }}
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@master
|
|
with:
|
|
platforms: all
|
|
|
|
- name: Set up Docker Buildx
|
|
id: buildx
|
|
uses: docker/setup-buildx-action@master
|
|
|
|
- name: Login to DockerHub
|
|
if: github.event_name != 'pull_request'
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: quay.io
|
|
username: ${{ secrets.LOCALAI_REGISTRY_USERNAME }}
|
|
password: ${{ secrets.LOCALAI_REGISTRY_PASSWORD }}
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
builder: ${{ steps.buildx.outputs.name }}
|
|
build-args: |
|
|
BUILD_TYPE=${{ matrix.build-type }}
|
|
CUDA_MAJOR_VERSION=${{ matrix.cuda-major-version }}
|
|
CUDA_MINOR_VERSION=${{ matrix.cuda-minor-version }}
|
|
FFMPEG=${{ matrix.ffmpeg }}
|
|
context: .
|
|
file: ./Dockerfile
|
|
platforms: ${{ matrix.platforms }}
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|