-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Sertac Ozercan <[email protected]>
- Loading branch information
Showing
35 changed files
with
1,622 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "gomod" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
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,30 @@ | ||
name: lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- '**.md' | ||
pull_request: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- '**.md' | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.21" | ||
|
||
- name: lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: v1.55.2 |
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,42 @@ | ||
name: pre-release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 360 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: cleanup disk space | ||
run: | | ||
df -H | ||
docker system prune -f -a --volumes | ||
sudo rm -rf /usr/share/dotnet | ||
sudo rm -rf /opt/ghc | ||
sudo rm -rf "/usr/local/share/boost" | ||
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | ||
df -H | ||
- name: Login to ghcr | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: create buildx builder | ||
run: docker buildx create --use --name builder --bootstrap | ||
- uses: crazy-max/ghaction-github-runtime@v3 | ||
|
||
- name: Push aikit:dev to GHCR | ||
run: | | ||
docker buildx build -t ghcr.io/sozercan/aikit:dev --push . |
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,38 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 360 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Login to ghcr | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Get tag | ||
run: | | ||
echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | ||
- name: Push aikit:latest to GHCR | ||
run: | | ||
docker buildx build . -t ghcr.io/sozercan/aikit:${TAG} -t ghcr.io/sozercan/aikit:latest --push --cache-from=type=gha,scope=aikit --cache-to=type=gha,scope=aikit,mode=max | ||
# - name: release llama 2 image | ||
# run: | | ||
# docker buildx build -t ghcr.io/sozercan/llama2:7b -t ghcr.io/sozercan/llama2:7b-chat -t ghcr.io/sozercan/llama2:chat -t ghcr.io/sozercan/llama2:latest -f models/llama-2-chat-7b.yaml --push --cache-from=type=gha,scope=llama-2-7b-chat --cache-to=type=gha,scope=llama-2-7b-chat,mode=max |
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,54 @@ | ||
name: docker-test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- '**.md' | ||
pull_request: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- '**.md' | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 240 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: cleanup disk space | ||
run: | | ||
df -H | ||
docker system prune -f -a --volumes | ||
sudo rm -rf /usr/share/dotnet | ||
sudo rm -rf /opt/ghc | ||
sudo rm -rf "/usr/local/share/boost" | ||
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | ||
df -H | ||
- name: create buildx builder | ||
run: docker buildx create --use --name builder --bootstrap | ||
- uses: crazy-max/ghaction-github-runtime@v3 | ||
|
||
- name: build aikit | ||
run: docker buildx build . -t sozercan/aikit:test --load --cache-from=type=gha,scope=aikit --cache-to=type=gha,scope=aikit,mode=max | ||
|
||
- name: build test model | ||
run: docker buildx build . -t sozercan/testmodel:test -f test/aikitfile.yaml --load --cache-from=type=gha,scope=testmodel --cache-to=type=gha,scope=testmodel,mode=max | ||
|
||
- name: list images | ||
run: docker images | ||
|
||
- name: run test model | ||
run: docker run -d -p 8080:8080 sozercan/testmodel:test | ||
|
||
- name: install e2e dependencies | ||
run: make test-e2e-dependencies | ||
|
||
- name: run bats test | ||
run: make test-e2e |
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,60 @@ | ||
name: kubernetes-test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- '**.md' | ||
pull_request: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- '**.md' | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 240 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: cleanup disk space | ||
run: | | ||
df -H | ||
docker system prune -a -f | ||
sudo rm -rf /usr/share/dotnet | ||
sudo rm -rf /opt/ghc | ||
sudo rm -rf "/usr/local/share/boost" | ||
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | ||
df -H | ||
- name: create buildx builder | ||
run: docker buildx create --use --name builder --bootstrap | ||
- uses: crazy-max/ghaction-github-runtime@v3 | ||
|
||
- name: build aikit | ||
run: docker buildx build . -t sozercan/aikit:test --load --cache-from=type=gha,scope=aikit --cache-to=type=gha,scope=aikit,mode=max | ||
|
||
- name: build test model | ||
run: docker buildx build . -t sozercan/testmodel:test -f test/aikitfile.yaml --load --cache-from=type=gha,scope=testmodel --cache-to=type=gha,scope=testmodel,mode=max | ||
|
||
- name: install e2e dependencies | ||
run: make test-e2e-dependencies | ||
|
||
- name: create kind cluster | ||
run: kind create cluster --wait 5m | ||
|
||
- name: load test model image into kind cluster | ||
run: kind load docker-image sozercan/testmodel:test | ||
|
||
- name: deploy test model | ||
run: | | ||
kubectl create deployment test-model-deployment --image=sozercan/testmodel:test --replicas 1 | ||
kubectl expose deployment test-model-deployment --port=8080 --target-port=8008 --name=test-model-service | ||
kubectl port-forward service/test-model-service 8080:8080 & | ||
- name: run bats test | ||
run: make test-e2e |
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,33 @@ | ||
name: unit-test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- '**.md' | ||
pull_request: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- '**.md' | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.21" | ||
|
||
- name: go mod tidy | ||
run: | | ||
go mod tidy | ||
git diff --exit-code | ||
- name: test | ||
run: make test |
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,32 @@ | ||
name: update-models | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
jobs: | ||
update-models: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 360 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Login to GHCR | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Push llama 2 models to GHCR | ||
run: | | ||
docker buildx create --use --name builder --bootstrap | ||
docker buildx build . -t ghcr.io/sozercan/llama2:7b -f models/llama-2-7b-chat.yaml --push | ||
docker buildx build . -t ghcr.io/sozercan/llama2:13b -f models/llama-2-13b-chat.yaml --push | ||
docker buildx build . -t ghcr.io/sozercan/llama2:7b-cuda -f models/cuda/llama-2-7b-chat.yaml --push | ||
docker buildx build . -t ghcr.io/sozercan/llama2:13b-cuda -f models/cuda/llama-2-13b-chat.yaml --push |
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 |
---|---|---|
|
@@ -19,3 +19,6 @@ | |
|
||
# Go workspace file | ||
go.work | ||
|
||
bin | ||
coverage.txt |
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,40 @@ | ||
run: | ||
timeout: 5m | ||
|
||
linters-settings: | ||
# gocritic: | ||
# enabled-tags: | ||
# - performance | ||
lll: | ||
line-length: 200 | ||
|
||
misspell: | ||
locale: US | ||
staticcheck: | ||
go: "1.21" | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- errcheck | ||
- errorlint | ||
- exportloopref | ||
- forcetypeassert | ||
- gci | ||
- gocritic | ||
- goconst | ||
- godot | ||
- gofmt | ||
- gofumpt | ||
- goimports | ||
- gosec | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- misspell | ||
- revive | ||
- staticcheck | ||
- typecheck | ||
- unconvert | ||
- unused | ||
- whitespace |
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,8 @@ | ||
FROM golang:1.21-bullseye as builder | ||
COPY . /go/src/github.com/sozercan/aikit | ||
WORKDIR /go/src/github.com/sozercan/aikit | ||
RUN CGO_ENABLED=0 go build -o /aikit --ldflags '-extldflags "-static"' ./cmd/frontend | ||
|
||
FROM scratch | ||
COPY --from=builder /aikit /bin/aikit | ||
ENTRYPOINT ["/bin/aikit"] |
Oops, something went wrong.