summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-08-20 07:42:04 +0000
committerCoprDistGit <infra@openeuler.org>2024-08-20 07:42:04 +0000
commit6b2b251b622a27311cdf2e2b3eccc8f8e6543357 (patch)
tree4bf6f2e0000c7f7066318913b334478030e01f16
parent8f63606371f06afa714e60b331adb3c013a9f8c6 (diff)
automatic import of ollama
-rw-r--r--.gitignore3
-rw-r--r--ollama-ui.service14
-rw-r--r--ollama.service1
-rw-r--r--ollama.spec32
-rw-r--r--sources5
5 files changed, 48 insertions, 7 deletions
diff --git a/.gitignore b/.gitignore
index 4c027f6..02416e8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,6 @@
/vendor.tar.gz
/b3440.tar.gz
/v0.3.0.tar.gz
+/b3536.tar.gz
+/main.tar.gz
+/v0.3.6.tar.gz
diff --git a/ollama-ui.service b/ollama-ui.service
new file mode 100644
index 0000000..a0c692b
--- /dev/null
+++ b/ollama-ui.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Ollama UI Service
+After=network-online.target
+PartOf=ollama.service
+
+[Service]
+ExecStart=/usr/bin/python3 -m http.server --bind 127.0.0.1 8000 -d /usr/share/ollama/ollama-ui
+User=ollama
+Group=ollama
+Restart=always
+RestartSec=3
+
+[Install]
+WantedBy=default.target
diff --git a/ollama.service b/ollama.service
index 5ddc9b1..ecbf34f 100644
--- a/ollama.service
+++ b/ollama.service
@@ -1,6 +1,7 @@
[Unit]
Description=Ollama Service
After=network-online.target
+Wants=ollama-ui.service
[Service]
ExecStart=/usr/bin/ollama serve
diff --git a/ollama.spec b/ollama.spec
index f343d5c..99920f9 100644
--- a/ollama.spec
+++ b/ollama.spec
@@ -1,22 +1,25 @@
%global debug_package %{nil}
Name: ollama
-Version: 0.3.0
+Version: 0.3.6
Release: 1%{?dist}
Summary: Get up and running with Llama 3, Mistral, Gemma 2, and other large language models.
License: MIT
URL: https://ollama.com
Source0: https://github.com/ollama/ollama/archive/refs/tags/v%{version}.tar.gz
# ollma references a specific commit of llama.cpp as a submodule through git.
-Source1: https://github.com/ggerganov/llama.cpp/archive/refs/tags/b3440.tar.gz
+Source1: https://github.com/ggerganov/llama.cpp/archive/refs/tags/b3536.tar.gz
Source2: vendor.tar.gz
-Source3: ollama.service
+Source3: %{name}.service
+Source4: %{name}-ui.service
+Source5: https://github.com/ollama-ui/ollama-ui/archive/refs/heads/main.tar.gz
BuildRequires: cmake
BuildRequires: golang
BuildRequires: gcc-c++
BuildRequires: git
+Requires: python3
%description
Ollama is a relatively new but powerful framework designed for
@@ -47,6 +50,8 @@ git config user.name "tmp"
git add .
git commit -a -s -m 'init'
cd ../../
+tar -xzf %{SOURCE5}
+mv ollama-ui-main ollama-ui
%build
@@ -75,9 +80,11 @@ go build .
%install
-mkdir -p %{buildroot}%{_bindir}
-install -m 0755 %{name} %{buildroot}%{_bindir}/%{name}
+install -D -m 0755 %{name} %{buildroot}%{_bindir}/%{name}
install -D -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}/%{name}.service
+install -D -m 0644 %{SOURCE4} %{buildroot}%{_unitdir}/%{name}-ui.service
+mkdir -p %{buildroot}%{_datadir}/%{name}/
+cp -r %{name}-ui/ %{buildroot}%{_datadir}/%{name}/
%post
@@ -101,14 +108,20 @@ echo "Adding current user to ollama group..."
echo "Creating ollama systemd service..."
%systemd_post %{name}.service
+%systemd_post %{name}-ui.service
+
+chown ollama /usr/share/ollama
%preun
%systemd_preun %{name}.service
+%systemd_preun %{name}-ui.service
%postun
%systemd_postun %{name}.service
+%systemd_postun %{name}-ui.service
+
echo "Deleting ollama user..."
userdel ollama
echo "Deleting ollama group..."
@@ -120,9 +133,18 @@ groupdel ollama
%doc README.md
%{_bindir}/%{name}
%{_unitdir}/%{name}.service
+%{_unitdir}/%{name}-ui.service
+%{_datadir}/%{name}/%{name}-ui
%changelog
+* Tue Aug 20 2024 Xenochou <xenochou@qq.com> - 0.3.6-1
+- Update ollama to 0.3.6
+- Add ollama-ui
+
+* Sat Jul 27 2024 Xenochou <xenochou@qq.com> - 0.3.4-1
+- Update ollama to 0.3.4
+
* Sat Jul 27 2024 Xenochou <xenochou@qq.com> - 0.3.0-1
- Update ollama to 0.3.0
diff --git a/sources b/sources
index 9a8d37e..e0922cb 100644
--- a/sources
+++ b/sources
@@ -1,3 +1,4 @@
-35870a52a735fdf30a63e11081a3a806 b3440.tar.gz
-818e0ff098c908fb49e2d5ae85646f99 v0.3.0.tar.gz
+d59c9f6bf4d0a0544e02121ce0f2935a b3536.tar.gz
+8692501b888fcbac2c687f94adc78cba main.tar.gz
+68e8c07ce5fd06810244b8105207693b v0.3.6.tar.gz
8c4cb7e94d9b72819625422317fa6f9b vendor.tar.gz