This repository has been archived by the owner on Dec 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #59 from casperdcl/ci-fun
add CI build matrix, refactoring, linting
- Loading branch information
Showing
49 changed files
with
497 additions
and
457 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,56 @@ | ||
name: CI | ||
|
||
env: | ||
DOCKER_BUILDKIT: 1 | ||
DOCKER_CLI_EXPERIMENTAL: "enabled" | ||
COMPOSE_DOCKER_CLI_BUILD: 1 | ||
|
||
on: | ||
pull_request: | ||
branches: ["main"] | ||
|
||
push: | ||
branches: ["main"] | ||
|
||
pull_request: | ||
jobs: | ||
linter: | ||
setup: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- id: list | ||
name: List modified models | ||
run: | | ||
git diff --stat HEAD~1 | ||
echo "modified=$( | ||
for model in $(ls -d *-*); do | ||
git diff --quiet HEAD~1 -- $model || echo $model | ||
done | sort | jq -Rsc 'split("\n")[:-1]' | ||
)" >> $GITHUB_OUTPUT | ||
outputs: | ||
models: ${{ steps.list.outputs.modified }} | ||
build-test-push: | ||
needs: setup | ||
runs-on: [self-hosted, gpu] | ||
strategy: | ||
fail-fast: false # TODO: remove | ||
matrix: | ||
model: ${{ fromJson(needs.setup.outputs.models) }} | ||
env: | ||
VERSION: '1.0.0' | ||
DOCKER_BUILDKIT: 1 | ||
DOCKER_CLI_EXPERIMENTAL: enabled | ||
COMPOSE_DOCKER_CLI_BUILD: 1 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- run: ./build.sh ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && '--push' || '--load' }} | ||
working-directory: ${{ matrix.model }} | ||
env: | ||
# can't load cross-CPU-platform | ||
BUILDX_PLATFORM: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && 'linux/arm64,linux/amd64' || 'linux/amd64' }} | ||
# can't test cross-CPU-platform | ||
TESTS_SKIP_CPU: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && '1' || '' }} | ||
# avoid OoM errors (TODO: remove when using larger GPU) | ||
TESTS_SKIP_GPU: ${{ contains(fromJSON('["a2t-whisper","cht-dolly-v2","cht-gorilla","cht-llama-v2","cht-mpt","cht-xgen","dfs-dalle","dfs-diffusers"]'), matrix.model) && '1' || '' }} | ||
pass: | ||
needs: build-test-push | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Run pre-commit | ||
uses: pre-commit/action@v3.0.0 | ||
- run: echo success |
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
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
set -e | ||
export VERSION=1.0.1 | ||
|
||
IMAGE=ghcr.io/premai-io/audio-to-text-whisper-tiny-cpu | ||
docker buildx build ${@:1} \ | ||
--file ./docker/cpu/Dockerfile \ | ||
--build-arg="MODEL_ID=tiny" \ | ||
--tag $IMAGE:latest \ | ||
--tag $IMAGE:$VERSION \ | ||
--platform ${BUILDX_PLATFORM:-linux/arm64,linux/amd64} \ | ||
. | ||
if test -z $TESTS_SKIP_CPU; then | ||
docker run --rm $IMAGE:$VERSION pytest | ||
fi | ||
|
||
IMAGE=ghcr.io/premai-io/audio-to-text-whisper-large-v2-gpu | ||
docker buildx build ${@:1} \ | ||
--file ./docker/gpu/Dockerfile \ | ||
--build-arg="MODEL_ID=large-v2" \ | ||
--tag $IMAGE:latest \ | ||
--tag $IMAGE:$VERSION \ | ||
. | ||
if test -z $TESTS_SKIP_GPU; then | ||
docker run --rm --gpus all $IMAGE:$VERSION pytest | ||
fi |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
set -e | ||
export VERSION=1.0.0 | ||
|
||
IMAGE=ghcr.io/premai-io/coder-replit-code-v1-3b-gpu | ||
docker buildx build ${@:1} \ | ||
--file ./docker/gpu/Dockerfile \ | ||
--build-arg="MODEL_ID=replit/replit-code-v1-3b" \ | ||
--tag $IMAGE:latest \ | ||
--tag $IMAGE:$VERSION \ | ||
. | ||
if test -z $TESTS_SKIP_GPU; then | ||
docker run --rm --gpus all $IMAGE:$VERSION pytest | ||
fi |
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
set -e | ||
export VERSION=1.0.0 | ||
|
||
IMAGE=ghcr.io/premai-io/coder-codet5p-220m-py-cpu | ||
docker buildx build ${@:1} \ | ||
--file ./docker/cpu/Dockerfile \ | ||
--build-arg="MODEL_ID=Salesforce/codet5p-220m-py" \ | ||
--tag $IMAGE:latest \ | ||
--tag $IMAGE:$VERSION \ | ||
--platform ${BUILDX_PLATFORM:-linux/arm64,linux/amd64} \ | ||
. | ||
if test -z $TESTS_SKIP_CPU; then | ||
docker run --rm $IMAGE:$VERSION pytest | ||
fi |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
set -e | ||
export VERSION=1.0.3 | ||
|
||
IMAGE=ghcr.io/premai-io/chat-dolly-v2-12b-gpu | ||
docker buildx build ${@:1} \ | ||
--file ./docker/gpu/Dockerfile \ | ||
--build-arg="MODEL_ID=databricks/dolly-v2-12b" \ | ||
--tag $IMAGE:latest \ | ||
--tag $IMAGE:$VERSION \ | ||
. | ||
if test -z $TESTS_SKIP_GPU; then | ||
docker run --rm --gpus all $IMAGE:$VERSION pytest | ||
fi |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
set -e | ||
export VERSION=1.0.0 | ||
|
||
IMAGE=ghcr.io/premai-io/chat-falcon-7b-instruct-gpu | ||
docker buildx build ${@:1} \ | ||
--file ./docker/gpu/Dockerfile \ | ||
--build-arg="MODEL_ID=tiiuae/falcon-7b-instruct" \ | ||
--tag $IMAGE:latest \ | ||
--tag $IMAGE:$VERSION \ | ||
. | ||
if test -z $TESTS_SKIP_GPU; then | ||
docker run --rm --gpus all $IMAGE:$VERSION pytest | ||
fi |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
set -e | ||
export VERSION=1.0.0 | ||
|
||
IMAGE=ghcr.io/premai-io/chat-gorilla-falcon-7b-gpu | ||
docker buildx build ${@:1} \ | ||
--file ./docker/gpu/Dockerfile \ | ||
--build-arg="MODEL_ID=gorilla-llm/gorilla-falcon-7b-hf-v0" \ | ||
--tag $IMAGE:latest \ | ||
--tag $IMAGE:$VERSION \ | ||
. | ||
if test -z $TESTS_SKIP_GPU; then | ||
docker run --rm --gpus all $IMAGE:$VERSION pytest | ||
fi | ||
|
||
IMAGE=ghcr.io/premai-io/chat-gorilla-mpt-7b-gpu | ||
docker buildx build ${@:1} \ | ||
--file ./docker/gpu/Dockerfile \ | ||
--build-arg="MODEL_ID=gorilla-llm/gorilla-mpt-7b-hf-v0" \ | ||
--tag $IMAGE:latest \ | ||
--tag $IMAGE:$VERSION \ | ||
. | ||
if test -z $TESTS_SKIP_GPU; then | ||
docker run --rm --gpus all $IMAGE:$VERSION pytest | ||
fi |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
set -e | ||
export VERSION=1.0.4 | ||
|
||
IMAGE=ghcr.io/premai-io/chat-gpt4all-lora-q4-cpu | ||
docker buildx build ${@:1} \ | ||
--file ./docker/cpu/Dockerfile \ | ||
--build-arg="MODEL_ID=gpt4all-lora-q4" \ | ||
--tag $IMAGE:latest \ | ||
--tag $IMAGE:$VERSION \ | ||
--platform ${BUILDX_PLATFORM:-linux/arm64,linux/amd64} \ | ||
. | ||
if test -z $TESTS_SKIP_CPU; then | ||
docker run --rm $IMAGE:$VERSION pytest | ||
fi | ||
|
||
IMAGE=ghcr.io/premai-io/chat-vicuna-7b-q4-cpu | ||
docker buildx build ${@:1} \ | ||
--file ./docker/cpu/Dockerfile \ | ||
--build-arg="MODEL_ID=vicuna-7b-q4" \ | ||
--tag $IMAGE:latest \ | ||
--tag $IMAGE:$VERSION \ | ||
--platform ${BUILDX_PLATFORM:-linux/arm64,linux/amd64} \ | ||
. | ||
if test -z $TESTS_SKIP_CPU; then | ||
docker run --rm $IMAGE:$VERSION pytest | ||
fi |
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/bash | ||
set -e | ||
export VERSION=1.0.0 | ||
|
||
IMAGE=ghcr.io/premai-io/chat-llama-2-7b-gpu | ||
docker buildx build ${@:1} \ | ||
--file ./docker/gpu/Dockerfile \ | ||
--build-arg="MODEL_ID=llama-2-7b-hf" \ | ||
--tag $IMAGE:latest \ | ||
--tag $IMAGE:$VERSION \ | ||
. | ||
if test -z $TESTS_SKIP_GPU; then | ||
docker run --rm --gpus all $IMAGE:$VERSION pytest | ||
fi | ||
|
||
IMAGE=ghcr.io/premai-io/chat-llama-2-7b-chat-gpu | ||
docker buildx build ${@:1} \ | ||
--file ./docker/gpu/Dockerfile \ | ||
--build-arg="MODEL_ID=llama-2-7b-chat-hf" \ | ||
--tag $IMAGE:latest \ | ||
--tag $IMAGE:$VERSION \ | ||
. | ||
if test -z $TESTS_SKIP_GPU; then | ||
docker run --rm --gpus all $IMAGE:$VERSION pytest | ||
fi | ||
|
||
IMAGE=ghcr.io/premai-io/chat-llama-2-13b-gpu | ||
docker buildx build ${@:1} \ | ||
--file ./docker/gpu/Dockerfile \ | ||
--build-arg="MODEL_ID=llama-2-13b-hf" \ | ||
--tag $IMAGE:latest \ | ||
--tag $IMAGE:$VERSION \ | ||
. | ||
if test -z $TESTS_SKIP_GPU; then | ||
docker run --rm --gpus all $IMAGE:$VERSION pytest | ||
fi | ||
|
||
IMAGE=ghcr.io/premai-io/chat-llama-2-13b-chat-gpu | ||
docker buildx build ${@:1} \ | ||
--file ./docker/gpu/Dockerfile \ | ||
--build-arg="MODEL_ID=llama-2-13b-chat-hf" \ | ||
--tag $IMAGE:latest \ | ||
--tag $IMAGE:$VERSION \ | ||
. | ||
if test -z $TESTS_SKIP_GPU; then | ||
docker run --rm --gpus all $IMAGE:$VERSION pytest | ||
fi |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.