Remove darwin-only restriction on ollama (#5284)

* Remove `darwin`-only restriction on `ollama`

Hopefully resolves https://github.com/pkgxdev/pkgx/issues/975

* add -buildmode on linux

* ollama needs certs to pull from model registry

* certs needed at runtime

* add pkill for linux

* test pgrep

* pkill needs -x for exact match

---------

Co-authored-by: Jacob Heider <jacob@pkgx.dev>
This commit is contained in:
Ryan S. Northrup (RyNo) 2024-02-19 16:41:19 -08:00 committed by GitHub
parent 4a8e84dbaf
commit 3223503d3e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,10 +1,13 @@
distributable: distributable:
url: git+https://github.com/jmorganca/ollama url: git+https://github.com/jmorganca/ollama
ref: v{{version}} ref: v{{version}}
versions: versions:
github: jmorganca/ollama github: jmorganca/ollama
platforms:
- darwin # Available for macOS Windows & Linux support coming soon. <= from https://ollama.ai/ dependencies:
curl.se/ca-certs: '*'
build: build:
dependencies: dependencies:
go.dev: ^1.21 go.dev: ^1.21
@ -16,20 +19,37 @@ build:
git submodule update git submodule update
if: '>=0.0.18' if: '>=0.0.18'
- go generate ./... - go generate ./...
- go build . - go build -ldflags="$GO_LDFLAGS" -o '{{prefix}}/bin/ollama' .
- mkdir -p {{prefix}}/bin env:
- install ollama {{prefix}}/bin/ linux:
GO_LDFLAGS:
# else segfaults
- -buildmode=pie
provides: provides:
- bin/ollama - bin/ollama
test: test:
qa-required: true qa-required: true
dependencies:
linux:
gitlab.com/procps-ng/procps: '*'
script: script:
# 0.0.19 complains about a missing blobs directory # 0.0.19 complains about a missing blobs directory
- run: mkdir -p ~/.ollama/models/blobs - run: mkdir -p ~/.ollama/models/blobs
if: =0.0.19 if: =0.0.19
- killall ollama || true # why is this killing the test, it seems like?
- run: pgrep -l ollama
if: linux
- $KILL ollama || true
- sleep 5
- ollama serve & - ollama serve &
- sleep 5 - sleep 5
- ollama create mario -f ./Modelfile - ollama create mario -f ./Modelfile
- ollama list | grep 'mario' - ollama list | grep 'mario'
- killall ollama || true - $KILL ollama || true
env:
darwin:
KILL: killall
linux:
KILL: pkill -x