Fix website Ollama connectivity setup
This commit is contained in:
parent
ab68569dbe
commit
d5abeca4b1
|
|
@ -670,6 +670,13 @@ website image that points at it:
|
||||||
./lab.sh website-translation-model
|
./lab.sh website-translation-model
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Ollama must also listen on the Debian host LAN address so Kubernetes pods on
|
||||||
|
other nodes can reach `OLLAMA_HOST=http://192.168.100.68:11434`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./lab.sh website-ollama-listen
|
||||||
|
```
|
||||||
|
|
||||||
The CV page has two client-side presentation modes:
|
The CV page has two client-side presentation modes:
|
||||||
|
|
||||||
- `Elegant`: dark, minimal, terminal-inspired styling with a square profile
|
- `Elegant`: dark, minimal, terminal-inspired styling with a square profile
|
||||||
|
|
|
||||||
|
|
@ -296,7 +296,6 @@ $curlError = curl_error($curl);
|
||||||
$curlErrno = curl_errno($curl);
|
$curlErrno = curl_errno($curl);
|
||||||
$statusCode = (int) curl_getinfo($curl, CURLINFO_RESPONSE_CODE);
|
$statusCode = (int) curl_getinfo($curl, CURLINFO_RESPONSE_CODE);
|
||||||
$ollamaLatencyMs = elapsed_ms($ollamaStartedAt);
|
$ollamaLatencyMs = elapsed_ms($ollamaStartedAt);
|
||||||
curl_close($curl);
|
|
||||||
|
|
||||||
if ($rawResponse === false || $statusCode < 200 || $statusCode >= 300) {
|
if ($rawResponse === false || $statusCode < 200 || $statusCode >= 300) {
|
||||||
$ollamaTimeoutCount = $curlErrno === CURLE_OPERATION_TIMEDOUT ? 1 : 0;
|
$ollamaTimeoutCount = $curlErrno === CURLE_OPERATION_TIMEDOUT ? 1 : 0;
|
||||||
|
|
|
||||||
30
lab.sh
30
lab.sh
|
|
@ -2928,6 +2928,31 @@ website_translation_model() {
|
||||||
echo "Ollama model ${model_name} is ready."
|
echo "Ollama model ${model_name} is ready."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
website_ollama_listen() {
|
||||||
|
local bind_address="${WEBSITE_OLLAMA_BIND_ADDRESS:-0.0.0.0:11434}"
|
||||||
|
local dropin_dir="/etc/systemd/system/ollama.service.d"
|
||||||
|
local dropin_file="${dropin_dir}/homelab-listen.conf"
|
||||||
|
|
||||||
|
require_debian_server "website-ollama-listen"
|
||||||
|
|
||||||
|
if ! systemctl cat ollama.service >/dev/null 2>&1; then
|
||||||
|
echo "ollama.service was not found on this Debian server." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Configuring ollama.service to listen on ${bind_address}..."
|
||||||
|
sudo mkdir -p "${dropin_dir}"
|
||||||
|
printf '[Service]\nEnvironment="OLLAMA_HOST=%s"\n' "${bind_address}" |
|
||||||
|
sudo tee "${dropin_file}" >/dev/null
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
sudo systemctl restart ollama.service
|
||||||
|
sudo systemctl is-active --quiet ollama.service
|
||||||
|
|
||||||
|
echo "Ollama service is active. Verifying http://${bind_address%:*}:11434/api/tags..."
|
||||||
|
curl -fsS "http://127.0.0.1:11434/api/tags" >/dev/null
|
||||||
|
echo "Ollama API is reachable on the Debian host."
|
||||||
|
}
|
||||||
|
|
||||||
apps() {
|
apps() {
|
||||||
local buildx_builder_ready=false
|
local buildx_builder_ready=false
|
||||||
local demos_image_built=false
|
local demos_image_built=false
|
||||||
|
|
@ -3287,6 +3312,9 @@ case "${1:-}" in
|
||||||
website-translation-model)
|
website-translation-model)
|
||||||
website_translation_model
|
website_translation_model
|
||||||
;;
|
;;
|
||||||
|
website-ollama-listen)
|
||||||
|
website_ollama_listen
|
||||||
|
;;
|
||||||
deploy-gitea)
|
deploy-gitea)
|
||||||
deploy_gitea
|
deploy_gitea
|
||||||
;;
|
;;
|
||||||
|
|
@ -3315,7 +3343,7 @@ case "${1:-}" in
|
||||||
nuke
|
nuke
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Usage: $0 {up|rebuild-cluster|apps|website-translation-model|deploy-gitea|bootstrap-gitea-repo|backup-gitea|drill-gitea-restore|install-gitea-runner|move-prometheus-stack-workers|doctor-versions|openwrt|nuke}"
|
echo "Usage: $0 {up|rebuild-cluster|apps|website-translation-model|website-ollama-listen|deploy-gitea|bootstrap-gitea-repo|backup-gitea|drill-gitea-restore|install-gitea-runner|move-prometheus-stack-workers|doctor-versions|openwrt|nuke}"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue