Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ollama #8398

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -6604,6 +6604,18 @@
"datasourceTemplate": "github-releases",
"extractVersionTemplate": "^v(?<version>.+)$"
},
{
"customType": "regex",
"fileMatch": [
"^tools/ollama/manifest.yaml$"
],
"matchStrings": [
"version: \"?(?<currentValue>.*?)\"?\\n"
],
"depNameTemplate": "ollama/ollama",
"datasourceTemplate": "github-releases",
"extractVersionTemplate": "^v(?<version>.+)$"
},
{
"customType": "regex",
"fileMatch": [
Expand Down
174 changes: 174 additions & 0 deletions tools/ollama/Dockerfile.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
#syntax=docker/dockerfile:1.11.1@sha256:1f2be5a2aa052cbd9aedf893d17c63277c3d1c51b3fb0f3b029c6b34f658d057

#FROM ghcr.io/uniget-org/tools/make:latest AS make
#FROM ghcr.io/uniget-org/tools/go:latest AS go
#FROM ghcr.io/uniget-org/tools/rust:latest AS rust
#FROM ghcr.io/uniget-org/tools/python:latest AS python
#FROM ghcr.io/uniget-org/tools/shiv:latest AS shiv
#FROM ghcr.io/uniget-org/tools/nodejs:latest AS nodejs
#FROM ghcr.io/uniget-org/tools/npm:latest AS npm

FROM registry.gitlab.com/uniget-org/images/ubuntu:24.04 AS prepare
#FROM registry.gitlab.com/uniget-org/images/build-essential:24.04 AS prepare
COPY --from=ghcr.io/uniget-org/tools/uniget-build:latest \
/etc/profile.d/ \
/etc/profile.d/
SHELL [ "bash", "-clo", "errexit" ]
ARG name
ARG version

# tarball
RUN --mount=type=cache,target=/var/cache/uniget/download <<EOF
url="https://github.com/ollama/ollama/releases/download/v${version}/ollama-linux-${alt_arch}.tgz"
filename="$( basename "${url}" )"

check-github-release-asset "ollama/ollama" "v${version}" "${filename}"
curl --silent --show-error --location --fail --output "${uniget_cache_download}/${filename}" \
"${url}"

tar --file="${uniget_cache_download}/${filename}" --list
tar --file="${uniget_cache_download}/${filename}" --extract --gzip --directory="${prefix}" --no-same-owner
EOF

# executable
#RUN --mount=type=cache,target=/var/cache/uniget/download <<EOF
#echo "### Setting architecture string for ${TARGETPLATFORM}"
#case "${arch}" in
# x86_64)
# export arch_suffix="${arch}"
# ;;
# aarch64)
# export arch_suffix="${alt_arch}"
# ;;
# *)
# echo "ERROR: Unsupported architecture ${arch}."
# exit 1
# ;;
#esac
#echo " Using ${arch_suffix}"
#
#url=""
#filename="$( basename "${url}" )"
#
#check-download "${url}"
#check-github-release-asset "foo/bar" "v${version}" "${filename}"
#curl --silent --show-error --location --fail --output "${uniget_cache_download}/${filename}" \
# "${url}"
#
#install --mode=0755 \
# "${uniget_cache_download}/${filename}" \
# "${prefix}/bin/foo"
#EOF

# zip
#RUN --mount=type=cache,target=/var/cache/uniget/download <<EOF
#echo "### Setting architecture string for ${TARGETPLATFORM}"
#case "${arch}" in
# x86_64)
# export arch_suffix="${arch}"
# ;;
# aarch64)
# export arch_suffix="${alt_arch}"
# ;;
# *)
# echo "ERROR: Unsupported architecture ${arch}."
# exit 1
# ;;
#esac
#echo " Using ${arch_suffix}"
#
#url=""
#filename="$(basename "${url}")"
#
#check-download "${url}"
#check-github-release-asset "foo/bar" "v${version}" "${filename}"
#curl --silent --show-error --location --fail --output "${uniget_cache_download}/${filename}" \
# "${url}"
#
#unzip -q -o -d "${prefix}/bin" "${uniget_cache_download}/${filename}"
#EOF

# go
#RUN --mount=type=cache,target=/var/cache/apt <<EOF
#apt-get update
#apt-get -y install --no-install-recommends \
# foo
#EOF
#RUN --mount=type=cache,target=/var/cache/apk <<EOF
#apk add --update-cache \
# foo
#EOF
#COPY --link --from=go / /usr/local/
#COPY --link --from=make / /usr/local/
#WORKDIR /go/src/github.com/foo/bar
#ARG name
#ARG version
#RUN --mount=type=cache,target=/root/go/pkg/mod <<EOF
#check-clone "https://github.com/foo/bar" "v${version}"
#git clone -q --config advice.detachedHead=false --depth 1 --branch "v${version}" https://github.com/foo/bar .
#make
#cp foo "${prefix}/bin/"
#EOF

# rust
#COPY --link --from=rust / /usr/local/
#WORKDIR /tmp/github.com/foo/bar
#RUN <<EOF
#git clone -q --config advice.detachedHead=false --depth 1 --branch "${version}" https://github.com/foo/bar .
#export CARGO_HOME=/usr/local/cargo
#export RUSTUP_HOME=/usr/local/rustup
#export RUSTFLAGS='-C target-feature=+crt-static'
#cargo build --release --target "${arch}-unknown-linux-gnu"
#cp "target/${arch}-unknown-linux-gnu/release/foo" "${prefix}/bin/"
#EOF

# python
#COPY --link --from=python / /usr/local/
#COPY --link --from=shiv / /usr/local/
#RUN --mount=type=cache,target=/root/.cache/pip <<EOF
#shiv --output-file "${prefix}/bin/foo" --console-script foo "foo==${version}"
#EOF

# node
#COPY --link --from=nodejs / /usr/local/
#COPY --link --from=npm / /usr/local/
#WORKDIR /uniget_bootstrap/libexec/foo
#ARG name
#ARG version
#RUN <<EOF
#npm install \
# --omit=dev \
# "foo@${version}"
#ln --symbolic --relative --force "${prefix}/libexec/foo/node_modules/.bin/foo" "${prefix}/bin/"
#EOF

# c
#RUN --mount=type=cache,target=/var/cache/apt <<EOF
#apt-get update
#apt-get -y install --no-install-recommends \
# foo
#EOF
#RUN --mount=type=cache,target=/var/cache/apk <<EOF
#apk add --update-cache \
# foo
#EOF
#COPY --link --from=make / /usr/local/
#WORKDIR /tmp/foo
#RUN <<EOF
#git clone -q --config advice.detachedHead=false --depth 1 --branch "${version}" https://github.com/foo/bar .
#./configure --prefix="${prefix}"
#make LDFLAGS=-static
#make install
#EOF

# dummy for testing
#RUN <<EOF
#touch "${prefix}/foo"
#EOF

# completion
#RUN <<EOF
#"${prefix}/bin/foo" completion bash >"${prefix}/share/bash-completion/completions/foo"
#"${prefix}/bin/foo" completion fish >"${prefix}/share/fish/vendor_completions.d/foo.fish"
#"${prefix}/bin/foo" completion zsh >"${prefix}/share/zsh/vendor-completions/_foo"
#EOF
28 changes: 28 additions & 0 deletions tools/ollama/manifest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# yaml-language-server: $schema=https://tools.uniget.dev/schema.yaml
$schema: https://tools.uniget.dev/schema.yaml
name: ollama
license:
name: MIT License
link: https://github.com/ollama/ollama/blob/main/LICENSE
version: "0.4.1"
check: ${binary} --version | grep client | cut -d' ' -f5
platforms:
- linux/amd64
- linux/arm64
tags:
- category/development
- lang/go
- type/?
homepage: https://ollama.com/
repository: https://github.com/ollama/ollama
description: Get up and running with Llama 3.2, Mistral, Gemma 2, and other large language models
messages:
update: |
If you are planning to run the systemd unit:
- useradd -r -s /bin/false -U -m -d /usr/share/ollama ollama
- usermod -a -G ollama $(whoami)
renovate:
datasource: github-releases
package: ollama/ollama
extractVersion: ^v(?<version>.+)$
priority: low
14 changes: 14 additions & 0 deletions tools/ollama/ollama.service.go-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
Description=Ollama Service
After=network-online.target

[Service]
ExecStart={{ .Target }}/ollama serve
User=ollama
Group=ollama
Restart=always
RestartSec=3
Environment="PATH=$PATH"

[Install]
WantedBy=default.target
Loading