Skip to content

Commit

Permalink
add img build
Browse files Browse the repository at this point in the history
  • Loading branch information
ChuckHend committed Apr 18, 2024
1 parent 5c14fc3 commit 4c4cc6b
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 3 deletions.
96 changes: 96 additions & 0 deletions .github/workflows/build-ollama-serve.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Build and deploy ollama server

on:
push:
branches:
- main
paths:
- ".github/workflows/build-ollama-serve.yml"
- "ollama-serve/**"

pull_request:
branches:
- main
paths:
- ".github/workflows/build-ollama-serve.yml"
- "ollama-serve/**"

permissions:
id-token: write
contents: read

defaults:
run:
shell: bash
working-directory: ./ollama-serve/

jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11.1
uses: actions/setup-python@v5
with:
python-version: 3.11.1
- name: Setup
run: make setup
- name: Init Model Cache
run: make download.models
- name: Lints
run: make check
- name: Tests
run: make test
build_and_push:
name: Build and push images
needs: tests
runs-on:
- self-hosted
- dind
- large-8x8
outputs:
short_sha: ${{ steps.versions.outputs.SHORT_SHA }}
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Set version strings
id: versions
run: |
echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Quay
uses: docker/login-action@v2
with:
registry: quay.io/tembo
username: ${{ secrets.QUAY_USER_TEMBO }}
password: ${{ secrets.QUAY_PASSWORD_TEMBO }}

- name: Build and push -- Commit
# push a build for every commit
uses: docker/build-push-action@v5
with:
file: ./ollama-serve/Dockerfile
context: .
platforms: linux/amd64, linux/arm64
push: true
tags: |
quay.io/tembo/ollama-serve:${{ steps.versions.outputs.SHORT_SHA }}
- name: Build and push -- Latest
# only push latest off main
if: github.ref == 'refs/heads/main'
uses: docker/build-push-action@v5
with:
file: ./ollama-serve/Dockerfile
context: .
platforms: linux/amd64, linux/arm64
push: true
tags: |
quay.io/tembo/ollama-serve:latest
2 changes: 1 addition & 1 deletion .github/workflows/build-vector-serve.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and deploy server
name: Build and deploy embedding server

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ services:
- 3000:3000
ollama-serve:
build:
context: ./ollama-serve
context: .
dockerfile: Dockerfile
ports:
- 3001:3001
Expand Down
2 changes: 1 addition & 1 deletion ollama-serve/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM ollama/ollama:0.1.32

ARG MODEL=wizardlm2:7b
COPY pull-model.sh .
COPY ./ollama-serve/pull-model.sh .
RUN chmod +x ./pull-model.sh
RUN echo cat
RUN ./pull-model.sh ${MODEL}

0 comments on commit 4c4cc6b

Please sign in to comment.