Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
Signed-off-by: Sertac Ozercan <[email protected]>
  • Loading branch information
sozercan committed Dec 1, 2023
1 parent 58a700f commit 73075fc
Show file tree
Hide file tree
Showing 40 changed files with 1,746 additions and 1 deletion.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Bug Report
description: Report a bug in AIKit
title: "[BUG] <title>"
labels:
- "bug"
body:
- type: markdown
attributes:
value: |
Please search to see if an issue already exists for your bug before continuing.
> If you need to report a security issue please see https://github.com/sozercan/aikit/security/policy instead.
- type: textarea
attributes:
label: Expected Behavior
description: Briefly describe what you expect to happen.
- type: textarea
attributes:
label: Actual Behavior
description: Briefly describe what is actually happening.
- type: textarea
attributes:
label: Steps To Reproduce
description: Detailed steps to reproduce the behavior.
placeholder: |
1. In ...
2. With this config...
3. Run '...'
4. See error...
- type: checkboxes
id: idea
attributes:
label: "Are you willing to submit PRs to contribute to this bug fix?"
options:
- label: Yes, I am willing to implement it.
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out a bug report!
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Request
description: Request a new feature or propose an enhancement to AIKit
title: "[REQ] <title>"
labels:
- "enhancement"
body:
- type: markdown
attributes:
value: |
Please search to see if an issue already exists for your request before continuing.
- type: dropdown
attributes:
label: What kind of request is this?
multiple: false
options:
- New feature
- Improvement of existing experience
- Other
- type: textarea
attributes:
label: What is your request or suggestion?
placeholder: |
e.g. I would like AIKit to add this <feature> so that I can use it in my <scenario>.
e.g. When using AIKit the <current behavior> has this <limitation> and it would be better if it has this <improvement>.
- type: checkboxes
id: idea
attributes:
label: "Are you willing to submit PRs to contribute to this feature request?"
options:
- label: Yes, I am willing to implement it.
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out a request!
6 changes: 6 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
**What this PR does / why we need it**:

**Which issue(s) this PR fixes** *(optional, using `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when the PR gets merged)*:
Fixes #

**Special notes for your reviewer**:
10 changes: 10 additions & 0 deletions .github/dependabot.yaml
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"
13 changes: 13 additions & 0 deletions .github/semantic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
titleOnly: true
types:
- build
- chore
- ci
- docs
- feat
- fix
- perf
- refactor
- revert
- style
- test
30 changes: 30 additions & 0 deletions .github/workflows/lint.yaml
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
42 changes: 42 additions & 0 deletions .github/workflows/pre-release.yaml
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 .
38 changes: 38 additions & 0 deletions .github/workflows/release.yaml
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
54 changes: 54 additions & 0 deletions .github/workflows/test-docker.yaml
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
60 changes: 60 additions & 0 deletions .github/workflows/test-kubernetes.yaml
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
33 changes: 33 additions & 0 deletions .github/workflows/unit-test.yaml
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
Loading

0 comments on commit 73075fc

Please sign in to comment.