Skip to content

Commit

Permalink
feat: introduce ollama (#1495)
Browse files Browse the repository at this point in the history
  • Loading branch information
zreigz authored Oct 23, 2024
1 parent b9db447 commit 4487f63
Show file tree
Hide file tree
Showing 21 changed files with 1,456 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/publish-ollama.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Ollama
on:
push:
tags:
- 'v*.*.*'
jobs:
publish:
name: Build and push ollama container
runs-on: ubuntu-latest
strategy:
matrix:
models:
- model: 'llama3'
- model: 'llama3.1'
permissions:
contents: 'read'
id-token: 'write'
packages: 'write'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
ghcr.io/pluralsh/ollama
# generate Docker tags based on the following events/attributes
tags: |
type=semver,pattern={{version}},suffix=-${{ matrix.models.model }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: "."
file: "./dockerfiles/ollama/base.Dockerfile"
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
build-args: |
OLLAMA_BASE_MODEL=${{ matrix.models.model }}
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.PHONY: help

OLLAMA_BASE_MODEL ?= llama3
GCP_PROJECT ?= pluralsh
APP_NAME ?= console
APP_VSN ?= `git describe`
Expand All @@ -21,6 +22,24 @@ find-versions:
aws eks describe-addon-versions | jq -r ".addons[] | .addonVersions[] | .compatibilities[] | .clusterVersion" | sort | uniq > k8s-versions/eks.json
az aks get-versions --location eastus --output json > k8s-versions/aks.json


update-ollama-helm-chart: ## update ollama Helm chart
helm repo add ollama-helm https://otwld.github.io/ollama-helm/
helm repo update
rm -rf charts/ollama
helm pull ollama-helm/ollama --untar --untardir charts

docker-build-ollama: ## build ollama image
docker build \
--build-arg=OLLAMA_BASE_MODEL=$(OLLAMA_BASE_MODEL) \
-t ollama:$(OLLAMA_BASE_MODEL) \
-t gcr.io/$(GCP_PROJECT)/ollama:$(OLLAMA_BASE_MODEL) \
-f dockerfiles/ollama/base.Dockerfile \
.

docker-push-ollama: ## push ollama image
docker push gcr.io/$(GCP_PROJECT)/ollama:$(OLLAMA_BASE_MODEL)

download-deprecations:
curl -L https://raw.githubusercontent.com/FairwindsOps/pluto/refs/heads/master/versions.yaml --output static/versions.yml

Expand Down
30 changes: 30 additions & 0 deletions charts/ollama/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
.drone.yml
*.tmproj
.vscode/

#others
.github
kind-config.yml
ci/

25 changes: 25 additions & 0 deletions charts/ollama/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
annotations:
artifacthub.io/category: ai-machine-learning
artifacthub.io/changes: |
- kind: changed
description: upgrade app version to 0.3.14
apiVersion: v2
appVersion: 0.3.14
description: Get up and running with large language models locally.
home: https://ollama.ai/
icon: https://ollama.ai/public/ollama.png
keywords:
- ai
- llm
- llama
- mistral
kubeVersion: ^1.16.0-0
maintainers:
- email: [email protected]
name: OTWLD
name: ollama
sources:
- https://github.com/ollama/ollama
- https://github.com/otwld/ollama-helm
type: application
version: 0.63.0
21 changes: 21 additions & 0 deletions charts/ollama/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 OTWLD

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit 4487f63

Please sign in to comment.