jishushell 0.4.17 → 0.4.24-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Dockerfile.hermes-slim +193 -0
- package/apps/hermes-container.yaml +35 -0
- package/apps/ollama-binary.yaml +164 -0
- package/apps/ollama-cpu-container.yaml +37 -0
- package/apps/ollama-with-hollama-binary.yaml +159 -0
- package/apps/openclaw-binary.yaml +69 -0
- package/apps/openclaw-container.yaml +37 -0
- package/apps/openclaw-with-ollama-container.yaml +42 -0
- package/apps/openclaw-with-searxng-container.yaml +136 -0
- package/apps/openwebui-container.yaml +53 -0
- package/apps/playwright-container.yaml +120 -0
- package/apps/searxng-container.yaml +115 -0
- package/dist/auth.d.ts +1 -0
- package/dist/auth.js +15 -14
- package/dist/auth.js.map +1 -1
- package/dist/cli/app.d.ts +1 -0
- package/dist/cli/app.js +770 -52
- package/dist/cli/app.js.map +1 -1
- package/dist/cli/backup.d.ts +3 -0
- package/dist/cli/backup.js +434 -0
- package/dist/cli/backup.js.map +1 -0
- package/dist/cli/doctor.d.ts +1 -0
- package/dist/cli/doctor.js +61 -35
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/job.d.ts +1 -0
- package/dist/cli/job.js +37 -99
- package/dist/cli/job.js.map +1 -1
- package/dist/cli/llm.d.ts +1 -0
- package/dist/cli/llm.js +20 -14
- package/dist/cli/llm.js.map +1 -1
- package/dist/cli/managed-list.d.ts +30 -0
- package/dist/cli/managed-list.js +129 -0
- package/dist/cli/managed-list.js.map +1 -0
- package/dist/cli/panel.d.ts +4 -3
- package/dist/cli/panel.js +94 -24
- package/dist/cli/panel.js.map +1 -1
- package/dist/cli/version.d.ts +1 -0
- package/dist/cli/version.js +12 -0
- package/dist/cli/version.js.map +1 -0
- package/dist/cli.js +47 -516
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +68 -0
- package/dist/config.js +266 -12
- package/dist/config.js.map +1 -1
- package/dist/control.d.ts +10 -6
- package/dist/control.js +87 -6
- package/dist/control.js.map +1 -1
- package/dist/install.d.ts +16 -0
- package/dist/install.js +75 -26
- package/dist/install.js.map +1 -1
- package/dist/routes/agent-apps.d.ts +15 -0
- package/dist/routes/agent-apps.js +78 -0
- package/dist/routes/agent-apps.js.map +1 -0
- package/dist/routes/apps.js +186 -7
- package/dist/routes/apps.js.map +1 -1
- package/dist/routes/backup.js +3 -3
- package/dist/routes/backup.js.map +1 -1
- package/dist/routes/instances.d.ts +6 -0
- package/dist/routes/instances.js +862 -879
- package/dist/routes/instances.js.map +1 -1
- package/dist/routes/llm.js +9 -8
- package/dist/routes/llm.js.map +1 -1
- package/dist/routes/runtime.d.ts +15 -0
- package/dist/routes/runtime.js +69 -0
- package/dist/routes/runtime.js.map +1 -0
- package/dist/routes/setup.js +103 -8
- package/dist/routes/setup.js.map +1 -1
- package/dist/routes/system.js +25 -3
- package/dist/routes/system.js.map +1 -1
- package/dist/server.js +71 -7
- package/dist/server.js.map +1 -1
- package/dist/services/agent-apps/catalog.d.ts +30 -0
- package/dist/services/agent-apps/catalog.js +60 -0
- package/dist/services/agent-apps/catalog.js.map +1 -0
- package/dist/services/agent-apps/index.d.ts +36 -0
- package/dist/services/agent-apps/index.js +171 -0
- package/dist/services/agent-apps/index.js.map +1 -0
- package/dist/services/agent-apps/installers/adapter-probes.d.ts +49 -0
- package/dist/services/agent-apps/installers/adapter-probes.js +223 -0
- package/dist/services/agent-apps/installers/adapter-probes.js.map +1 -0
- package/dist/services/agent-apps/installers/adapter.d.ts +30 -0
- package/dist/services/agent-apps/installers/adapter.js +171 -0
- package/dist/services/agent-apps/installers/adapter.js.map +1 -0
- package/dist/services/agent-apps/installers/registry-probe.d.ts +38 -0
- package/dist/services/agent-apps/installers/registry-probe.js +183 -0
- package/dist/services/agent-apps/installers/registry-probe.js.map +1 -0
- package/dist/services/agent-apps/installers/shell-script.d.ts +47 -0
- package/dist/services/agent-apps/installers/shell-script.js +471 -0
- package/dist/services/agent-apps/installers/shell-script.js.map +1 -0
- package/dist/services/agent-apps/types.d.ts +125 -0
- package/dist/services/agent-apps/types.js +17 -0
- package/dist/services/agent-apps/types.js.map +1 -0
- package/dist/services/{app-compiler.d.ts → app/app-compiler.d.ts} +3 -3
- package/dist/services/{app-compiler.js → app/app-compiler.js} +10 -7
- package/dist/services/app/app-compiler.js.map +1 -0
- package/dist/services/app/app-manager.d.ts +142 -0
- package/dist/services/app/app-manager.js +2148 -0
- package/dist/services/app/app-manager.js.map +1 -0
- package/dist/services/app/custom-manager.d.ts +27 -0
- package/dist/services/app/custom-manager.js +285 -0
- package/dist/services/app/custom-manager.js.map +1 -0
- package/dist/services/app/hermes-agent-manager.d.ts +20 -0
- package/dist/services/app/hermes-agent-manager.js +289 -0
- package/dist/services/app/hermes-agent-manager.js.map +1 -0
- package/dist/services/app/id-normalizer.d.ts +27 -0
- package/dist/services/app/id-normalizer.js +77 -0
- package/dist/services/app/id-normalizer.js.map +1 -0
- package/dist/services/app/ollama-manager.d.ts +18 -0
- package/dist/services/app/ollama-manager.js +207 -0
- package/dist/services/app/ollama-manager.js.map +1 -0
- package/dist/services/app/openclaw-manager.d.ts +63 -0
- package/dist/services/app/openclaw-manager.js +1178 -0
- package/dist/services/app/openclaw-manager.js.map +1 -0
- package/dist/services/app/paths.d.ts +47 -0
- package/dist/services/app/paths.js +68 -0
- package/dist/services/app/paths.js.map +1 -0
- package/dist/services/app/registry.d.ts +17 -0
- package/dist/services/app/registry.js +31 -0
- package/dist/services/app/registry.js.map +1 -0
- package/dist/services/app/remote-spec.d.ts +14 -0
- package/dist/services/app/remote-spec.js +58 -0
- package/dist/services/app/remote-spec.js.map +1 -0
- package/dist/services/app/terminal-session-manager.d.ts +27 -0
- package/dist/services/app/terminal-session-manager.js +157 -0
- package/dist/services/app/terminal-session-manager.js.map +1 -0
- package/dist/services/app/types.d.ts +72 -0
- package/dist/services/app/types.js +16 -0
- package/dist/services/app/types.js.map +1 -0
- package/dist/services/backup-manager.js +60 -22
- package/dist/services/backup-manager.js.map +1 -1
- package/dist/services/instance-manager.d.ts +82 -39
- package/dist/services/instance-manager.js +575 -1142
- package/dist/services/instance-manager.js.map +1 -1
- package/dist/services/llm-proxy/circuit-breaker.js +10 -2
- package/dist/services/llm-proxy/circuit-breaker.js.map +1 -1
- package/dist/services/llm-proxy/index.d.ts +14 -1
- package/dist/services/llm-proxy/index.js +51 -6
- package/dist/services/llm-proxy/index.js.map +1 -1
- package/dist/services/nomad-manager.d.ts +260 -3
- package/dist/services/nomad-manager.js +2866 -449
- package/dist/services/nomad-manager.js.map +1 -1
- package/dist/services/panel-manager.d.ts +10 -0
- package/dist/services/panel-manager.js +97 -0
- package/dist/services/panel-manager.js.map +1 -1
- package/dist/services/plugin-installer.js +28 -2
- package/dist/services/plugin-installer.js.map +1 -1
- package/dist/services/process-manager.js +22 -0
- package/dist/services/process-manager.js.map +1 -1
- package/dist/services/runtime/adapters/custom.d.ts +20 -0
- package/dist/services/runtime/adapters/custom.js +90 -0
- package/dist/services/runtime/adapters/custom.js.map +1 -0
- package/dist/services/runtime/adapters/hermes.d.ts +174 -0
- package/dist/services/runtime/adapters/hermes.js +1316 -0
- package/dist/services/runtime/adapters/hermes.js.map +1 -0
- package/dist/services/runtime/adapters/openclaw-routes.d.ts +17 -0
- package/dist/services/runtime/adapters/openclaw-routes.js +946 -0
- package/dist/services/runtime/adapters/openclaw-routes.js.map +1 -0
- package/dist/services/runtime/adapters/openclaw.d.ts +188 -0
- package/dist/services/runtime/adapters/openclaw.js +2195 -0
- package/dist/services/runtime/adapters/openclaw.js.map +1 -0
- package/dist/services/runtime/errors.d.ts +28 -0
- package/dist/services/runtime/errors.js +31 -0
- package/dist/services/runtime/errors.js.map +1 -0
- package/dist/services/runtime/index.d.ts +34 -0
- package/dist/services/runtime/index.js +51 -0
- package/dist/services/runtime/index.js.map +1 -0
- package/dist/services/runtime/instance.d.ts +24 -0
- package/dist/services/runtime/instance.js +143 -0
- package/dist/services/runtime/instance.js.map +1 -0
- package/dist/services/runtime/migrations.d.ts +15 -0
- package/dist/services/runtime/migrations.js +25 -0
- package/dist/services/runtime/migrations.js.map +1 -0
- package/dist/services/runtime/registry.d.ts +13 -0
- package/dist/services/runtime/registry.js +32 -0
- package/dist/services/runtime/registry.js.map +1 -0
- package/dist/services/runtime/types.d.ts +545 -0
- package/dist/services/runtime/types.js +14 -0
- package/dist/services/runtime/types.js.map +1 -0
- package/dist/services/setup-manager.d.ts +70 -29
- package/dist/services/setup-manager.js +278 -597
- package/dist/services/setup-manager.js.map +1 -1
- package/dist/services/task-registry.d.ts +44 -0
- package/dist/services/task-registry.js +74 -0
- package/dist/services/task-registry.js.map +1 -0
- package/dist/services/telemetry/heartbeat.d.ts +6 -6
- package/dist/services/telemetry/heartbeat.js +29 -30
- package/dist/services/telemetry/heartbeat.js.map +1 -1
- package/dist/types.d.ts +164 -2
- package/dist/utils/docker-host.d.ts +15 -0
- package/dist/utils/docker-host.js +64 -0
- package/dist/utils/docker-host.js.map +1 -0
- package/install/jishu-install.sh +25 -2
- package/package.json +14 -4
- package/public/assets/Dashboard-rh9qpYRR.js +1 -0
- package/public/assets/HermesChatPanel-D6JI6lLY.js +1 -0
- package/public/assets/HermesConfigForm-DcbSemaj.js +4 -0
- package/public/assets/InitPassword-CFTKsED4.js +1 -0
- package/public/assets/InstanceDetail-BhNIKA6Z.js +91 -0
- package/public/assets/{Login-D1Bt-Lyk.js → Login-KB9qrtM0.js} +1 -1
- package/public/assets/NewInstance-CxkO8Hlq.js +1 -0
- package/public/assets/Settings-BVWJvOkU.js +1 -0
- package/public/assets/Setup-X-lzuaUT.js +1 -0
- package/public/assets/WeixinLoginPanel-gca0QTic.js +9 -0
- package/public/assets/index-C8B0cFJM.js +19 -0
- package/public/assets/index-CPhVFEsx.css +1 -0
- package/public/assets/input-paste-CrNVAyOy.js +1 -0
- package/public/assets/registry-fVUSujib.js +2 -0
- package/public/assets/{usePolling-CK0DfI4h.js → usePolling-Do5Erqm_.js} +1 -1
- package/public/assets/vendor-i18n-ucpM0OR0.js +9 -0
- package/public/assets/{vendor-react-B1-3Yrt-.js → vendor-react-Bk1hRGiY.js} +1 -1
- package/public/favicon.png +0 -0
- package/public/index.html +9 -4
- package/public/logos/hermes.png +0 -0
- package/public/logos/ollama.png +0 -0
- package/public/logos/openclaw.svg +60 -0
- package/scripts/build-hermes-image.sh +21 -0
- package/scripts/build-local.sh +54 -0
- package/scripts/check-adapter-isolation.ts +293 -0
- package/scripts/fixtures/instances/hermes-sample/instance.json +37 -0
- package/scripts/fixtures/instances/legacy-openclaw-sample/instance.json +7 -0
- package/scripts/smoke/hermes-bootstrap.sh +195 -0
- package/templates/hermes-entrypoint.sh +154 -0
- package/dist/cli/openclaw.d.ts +0 -12
- package/dist/cli/openclaw.js +0 -156
- package/dist/cli/openclaw.js.map +0 -1
- package/dist/services/app-compiler.js.map +0 -1
- package/dist/services/app-manager.d.ts +0 -17
- package/dist/services/app-manager.js +0 -168
- package/dist/services/app-manager.js.map +0 -1
- package/dist/services/job-manager.d.ts +0 -22
- package/dist/services/job-manager.js +0 -102
- package/dist/services/job-manager.js.map +0 -1
- package/public/assets/Dashboard-CQsp1Mr9.js +0 -1
- package/public/assets/InitPassword-BEC8SE4A.js +0 -1
- package/public/assets/InstanceDetail-B5wTgNEg.js +0 -17
- package/public/assets/NewInstance-GQzm3K9D.js +0 -1
- package/public/assets/Settings-ByjGlqhP.js +0 -1
- package/public/assets/Setup-cMF21Y-8.js +0 -1
- package/public/assets/index-B6qQP4mH.css +0 -1
- package/public/assets/index-BuTQtuNy.js +0 -16
- package/public/assets/vendor-i18n-CfW0RvgE.js +0 -9
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
# syntax=docker/dockerfile:1.7
|
|
2
|
+
|
|
3
|
+
ARG BASE_IMAGE=node:22-bookworm-slim
|
|
4
|
+
|
|
5
|
+
FROM ${BASE_IMAGE} AS builder
|
|
6
|
+
|
|
7
|
+
ARG HERMES_REPO=https://github.com/NousResearch/hermes-agent.git
|
|
8
|
+
ARG HERMES_REF=main
|
|
9
|
+
|
|
10
|
+
ENV DEBIAN_FRONTEND=noninteractive \
|
|
11
|
+
PIP_DISABLE_PIP_VERSION_CHECK=1 \
|
|
12
|
+
PYTHONDONTWRITEBYTECODE=1 \
|
|
13
|
+
UV_LINK_MODE=copy
|
|
14
|
+
|
|
15
|
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
16
|
+
bash \
|
|
17
|
+
build-essential \
|
|
18
|
+
ca-certificates \
|
|
19
|
+
curl \
|
|
20
|
+
ffmpeg \
|
|
21
|
+
git \
|
|
22
|
+
pkg-config \
|
|
23
|
+
python3 \
|
|
24
|
+
python3-dev \
|
|
25
|
+
python3-venv \
|
|
26
|
+
ripgrep && \
|
|
27
|
+
rm -rf /var/lib/apt/lists/*
|
|
28
|
+
|
|
29
|
+
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
30
|
+
|
|
31
|
+
ENV PATH=/root/.local/bin:${PATH}
|
|
32
|
+
|
|
33
|
+
WORKDIR /opt
|
|
34
|
+
RUN git clone --recurse-submodules "${HERMES_REPO}" hermes && \
|
|
35
|
+
cd /opt/hermes && \
|
|
36
|
+
git checkout "${HERMES_REF}" && \
|
|
37
|
+
git submodule update --init --recursive
|
|
38
|
+
|
|
39
|
+
#
|
|
40
|
+
# Skip the `tinker-atropos` submodule install. It brings in the RL
|
|
41
|
+
# training stack (transformers, datasets, wandb, gymnasium, polars,
|
|
42
|
+
# pyarrow, safetensors, …) — ~300 MB of deps used only by
|
|
43
|
+
# `tools/rl_training_tool.py` and `environments/*.py`, both of which
|
|
44
|
+
# are lazy-imported and only exercised during model training runs.
|
|
45
|
+
# JishuShell targets inference on edge devices (Pi / RK3588 / CIX), no
|
|
46
|
+
# RL training happens here, so we match the upstream
|
|
47
|
+
# `nousresearch/hermes-agent` image's choice to omit it.
|
|
48
|
+
#
|
|
49
|
+
WORKDIR /opt/hermes
|
|
50
|
+
RUN uv venv .venv --python 3.11 && \
|
|
51
|
+
uv pip install --python .venv/bin/python -e ".[all]"
|
|
52
|
+
|
|
53
|
+
#
|
|
54
|
+
# Small extras the upstream image bundles but `[all]` doesn't pull.
|
|
55
|
+
# Both are tiny (~0.3 MB each) so we match the upstream image rather
|
|
56
|
+
# than leave users `pip install`-ing them by hand.
|
|
57
|
+
# - apscheduler: cron-style scheduler used by the agent's job tools
|
|
58
|
+
# - qrcode + pypng: QR image generation using pure-Python PNG
|
|
59
|
+
# backend (avoids dragging Pillow in)
|
|
60
|
+
#
|
|
61
|
+
RUN uv pip install --python .venv/bin/python apscheduler qrcode pypng
|
|
62
|
+
|
|
63
|
+
#
|
|
64
|
+
# Three things happen here:
|
|
65
|
+
#
|
|
66
|
+
# 1. `npm install --omit=dev` vendors agent-browser + its transitive
|
|
67
|
+
# deps (playwright-core, better-sqlite3, impit, zod, lodash, …)
|
|
68
|
+
# into /opt/hermes/node_modules (~171 MB). This is what
|
|
69
|
+
# `hermes's browser_tool.py` resolves when it runs `npx
|
|
70
|
+
# agent-browser` — without pre-installing we'd pay a ~15 s npm
|
|
71
|
+
# download on the first browser_navigate call of every fresh
|
|
72
|
+
# container.
|
|
73
|
+
#
|
|
74
|
+
# 2. `playwright install chromium --only-shell` drops the headless
|
|
75
|
+
# Chromium renderer (~330 MB) under $PLAYWRIGHT_BROWSERS_PATH.
|
|
76
|
+
# agent-browser auto-discovers it via that env var, so we don't
|
|
77
|
+
# need an apt `chromium` in the final image — just the shared
|
|
78
|
+
# libs headless_shell links against (installed in the final
|
|
79
|
+
# stage). `--package=playwright` borrows the Playwright CLI
|
|
80
|
+
# without persisting its own node_modules.
|
|
81
|
+
#
|
|
82
|
+
# 3. The native web UI (`hermes web`, served on port 9119) is built
|
|
83
|
+
# and its build-time node_modules removed; only the ~8 MB dist
|
|
84
|
+
# bundle ships.
|
|
85
|
+
#
|
|
86
|
+
ENV PLAYWRIGHT_BROWSERS_PATH=/opt/hermes/.playwright
|
|
87
|
+
RUN if [ -f package.json ]; then \
|
|
88
|
+
npm install --omit=dev --prefer-offline --no-audit --no-fund ; \
|
|
89
|
+
fi && \
|
|
90
|
+
npx --yes --package=playwright playwright install chromium --only-shell && \
|
|
91
|
+
if [ -f web/package.json ]; then \
|
|
92
|
+
(cd web && npm install --prefer-offline --no-audit --no-fund && npm run build) && \
|
|
93
|
+
rm -rf web/node_modules ; \
|
|
94
|
+
fi && \
|
|
95
|
+
npm cache clean --force
|
|
96
|
+
|
|
97
|
+
RUN rm -rf /root/.cache /tmp/* .git .github website tests .pytest_cache .mypy_cache .ruff_cache && \
|
|
98
|
+
find /opt/hermes -type d -name "__pycache__" -prune -exec rm -rf {} + && \
|
|
99
|
+
find /opt/hermes -type f \( -name "*.pyc" -o -name "*.pyo" \) -delete
|
|
100
|
+
|
|
101
|
+
FROM ${BASE_IMAGE}
|
|
102
|
+
|
|
103
|
+
ENV DEBIAN_FRONTEND=noninteractive \
|
|
104
|
+
HERMES_HOME=/opt/data \
|
|
105
|
+
PATH=/opt/hermes/.venv/bin:${PATH} \
|
|
106
|
+
PIP_DISABLE_PIP_VERSION_CHECK=1 \
|
|
107
|
+
PLAYWRIGHT_BROWSERS_PATH=/opt/hermes/.playwright \
|
|
108
|
+
PYTHONDONTWRITEBYTECODE=1
|
|
109
|
+
|
|
110
|
+
#
|
|
111
|
+
# The headless Chromium binary itself rides in from the builder stage
|
|
112
|
+
# (see PLAYWRIGHT_BROWSERS_PATH above). What the final stage adds is:
|
|
113
|
+
#
|
|
114
|
+
# • Chromium runtime libs: the 17 .so dependencies headless_shell
|
|
115
|
+
# dynamically links against. Same set that
|
|
116
|
+
# `playwright install --with-deps chromium` would pull in on
|
|
117
|
+
# Debian 12 — explicit here so the diff is auditable.
|
|
118
|
+
# • curl: `hermes auth login` device-code OAuth flow + ad-hoc HTTP.
|
|
119
|
+
# • poppler-utils: pdftotext / pdfinfo back Hermes's PDF readers.
|
|
120
|
+
#
|
|
121
|
+
# Note: capability-specific Python packages (python-pptx, weasyprint,
|
|
122
|
+
# pillow, xlsxwriter, qrcode, dingtalk SDK, …) are NOT baked in —
|
|
123
|
+
# users `pip install --user` them on demand via the `terminal` tool.
|
|
124
|
+
# Same for `whatsapp-bridge`, which our panel's channel plugins don't
|
|
125
|
+
# rely on.
|
|
126
|
+
#
|
|
127
|
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
128
|
+
bash \
|
|
129
|
+
ca-certificates \
|
|
130
|
+
curl \
|
|
131
|
+
ffmpeg \
|
|
132
|
+
fonts-liberation \
|
|
133
|
+
git \
|
|
134
|
+
gosu \
|
|
135
|
+
libasound2 \
|
|
136
|
+
libatk1.0-0 \
|
|
137
|
+
libatk-bridge2.0-0 \
|
|
138
|
+
libatspi2.0-0 \
|
|
139
|
+
libcairo2 \
|
|
140
|
+
libcups2 \
|
|
141
|
+
libdbus-1-3 \
|
|
142
|
+
libdrm2 \
|
|
143
|
+
libgbm1 \
|
|
144
|
+
libnspr4 \
|
|
145
|
+
libnss3 \
|
|
146
|
+
libpango-1.0-0 \
|
|
147
|
+
libx11-6 \
|
|
148
|
+
libxcb1 \
|
|
149
|
+
libxcomposite1 \
|
|
150
|
+
libxdamage1 \
|
|
151
|
+
libxext6 \
|
|
152
|
+
libxfixes3 \
|
|
153
|
+
libxkbcommon0 \
|
|
154
|
+
libxrandr2 \
|
|
155
|
+
poppler-utils \
|
|
156
|
+
procps \
|
|
157
|
+
python3 \
|
|
158
|
+
python3-venv \
|
|
159
|
+
ripgrep && \
|
|
160
|
+
ln -sf /usr/bin/python3 /usr/local/bin/python && \
|
|
161
|
+
rm -rf /var/lib/apt/lists/*
|
|
162
|
+
|
|
163
|
+
RUN usermod -l hermes -d /home/hermes -m node && \
|
|
164
|
+
groupmod -n hermes node
|
|
165
|
+
|
|
166
|
+
COPY --chown=hermes:hermes --from=builder /opt/hermes /opt/hermes
|
|
167
|
+
|
|
168
|
+
WORKDIR /opt/hermes
|
|
169
|
+
|
|
170
|
+
RUN mkdir -p /opt/data && \
|
|
171
|
+
chown -R hermes:hermes /opt/data /home/hermes
|
|
172
|
+
|
|
173
|
+
# Bake the jishushell orchestration shim into the image. The panel used
|
|
174
|
+
# to bind-mount this from ~/.jishushell/runtimes/hermes/ but that coupled
|
|
175
|
+
# instance startup to a host file outside the instance dir. Baking it in
|
|
176
|
+
# keeps all runtime-critical assets inside the image, and the LABEL below
|
|
177
|
+
# lets the panel detect whether a pulled image actually has it.
|
|
178
|
+
COPY templates/hermes-entrypoint.sh /usr/local/bin/jishushell-hermes-entry.sh
|
|
179
|
+
RUN chmod 0755 /usr/local/bin/jishushell-hermes-entry.sh
|
|
180
|
+
|
|
181
|
+
# Advertise the protocol contract this image satisfies. The panel reads
|
|
182
|
+
# this label via `docker inspect` before launching an instance; a panel
|
|
183
|
+
# that only knows protocol version N refuses to start an image that
|
|
184
|
+
# declares N+1, which is how we gate rolling upgrades without silent
|
|
185
|
+
# behavioral drift.
|
|
186
|
+
LABEL runtime.protocol.version="1"
|
|
187
|
+
|
|
188
|
+
# Zombie reaping is handled by Nomad's `init: true` flag (docker-init
|
|
189
|
+
# becomes PID 1 regardless of this image's entrypoint — see the hermes
|
|
190
|
+
# adapter's docker Config). We deliberately leave ENTRYPOINT unset so
|
|
191
|
+
# anyone running this image directly with `docker run --init` gets the
|
|
192
|
+
# same guarantee without surprise.
|
|
193
|
+
CMD ["hermes", "--help"]
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
id: hermes-container
|
|
2
|
+
name: Hermes Agent
|
|
3
|
+
version: "1.0.0"
|
|
4
|
+
jishushell:
|
|
5
|
+
min_version: "0.4.24"
|
|
6
|
+
agentType: hermes
|
|
7
|
+
description: "Hermes Agent 容器运行时,使用 apps 目录作为统一安装根"
|
|
8
|
+
singleInstance: false
|
|
9
|
+
|
|
10
|
+
tasks:
|
|
11
|
+
- name: gateway
|
|
12
|
+
role: service
|
|
13
|
+
runtime: container
|
|
14
|
+
image: "ghcr.io/x-aijishu/hermes-runtime:latest"
|
|
15
|
+
command: "/bin/bash"
|
|
16
|
+
args: ["/usr/local/bin/jishushell-hermes-entry.sh", "gateway", "run"]
|
|
17
|
+
env:
|
|
18
|
+
API_SERVER_ENABLED: "true"
|
|
19
|
+
API_SERVER_HOST: "0.0.0.0"
|
|
20
|
+
API_SERVER_PORT: "8642"
|
|
21
|
+
resources:
|
|
22
|
+
cpu: "1000m"
|
|
23
|
+
memory: "1024Mi"
|
|
24
|
+
ports:
|
|
25
|
+
- name: gateway
|
|
26
|
+
port: 8642
|
|
27
|
+
visibility: external
|
|
28
|
+
health:
|
|
29
|
+
http:
|
|
30
|
+
path: /health
|
|
31
|
+
port: 8642
|
|
32
|
+
interval: "15s"
|
|
33
|
+
timeout: "5s"
|
|
34
|
+
retries: 3
|
|
35
|
+
start_period: "30s"
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
id: ollama-binary
|
|
2
|
+
name: Ollama
|
|
3
|
+
version: "1.0.0"
|
|
4
|
+
jishushell:
|
|
5
|
+
min_version: "0.4.24"
|
|
6
|
+
description: "通过官方脚本,安装并运行Ollama"
|
|
7
|
+
singleInstance: true
|
|
8
|
+
|
|
9
|
+
tasks:
|
|
10
|
+
- name: gateway
|
|
11
|
+
role: service
|
|
12
|
+
runtime: process
|
|
13
|
+
command: /usr/local/bin/ollama
|
|
14
|
+
args: ["serve"]
|
|
15
|
+
env:
|
|
16
|
+
OLLAMA_HOST: "0.0.0.0:11434"
|
|
17
|
+
resources:
|
|
18
|
+
cpu: "2000m"
|
|
19
|
+
memory: "4096Mi"
|
|
20
|
+
ports:
|
|
21
|
+
- name: gateway
|
|
22
|
+
port: 11434
|
|
23
|
+
visibility: external
|
|
24
|
+
health:
|
|
25
|
+
http:
|
|
26
|
+
path: /api/version
|
|
27
|
+
port: 11434
|
|
28
|
+
interval: "15s"
|
|
29
|
+
timeout: "5s"
|
|
30
|
+
retries: 3
|
|
31
|
+
start_period: "30s"
|
|
32
|
+
|
|
33
|
+
provides:
|
|
34
|
+
- capability: "ollama-terminal"
|
|
35
|
+
protocol: "terminal"
|
|
36
|
+
description: "Ollama快速终端,可直接执行 ollama 命令"
|
|
37
|
+
terminal:
|
|
38
|
+
command: ["ollama"]
|
|
39
|
+
task: "gateway"
|
|
40
|
+
prompt: "ollama"
|
|
41
|
+
welcome: "输入 list / ps / pull / run 等命令开始;终端会自动补齐前缀 ollama。"
|
|
42
|
+
commands:
|
|
43
|
+
recommend:
|
|
44
|
+
- "pull qwen3.5:0.8b"
|
|
45
|
+
- "pull qwen3.6:35b"
|
|
46
|
+
- "pull gemma4:26b"
|
|
47
|
+
- "pull gemma4:e4b"
|
|
48
|
+
- "pull gemma4:e2b"
|
|
49
|
+
others:
|
|
50
|
+
- cmd: "show"
|
|
51
|
+
description: "Show information for a model"
|
|
52
|
+
- cmd: "stop"
|
|
53
|
+
description: "Stop a running model"
|
|
54
|
+
- cmd: "pull"
|
|
55
|
+
description: "Pull a model from a registry"
|
|
56
|
+
- cmd: "list"
|
|
57
|
+
description: "List models"
|
|
58
|
+
- cmd: "ps"
|
|
59
|
+
description: "List running models"
|
|
60
|
+
- cmd: "rm"
|
|
61
|
+
description: "Remove a model"
|
|
62
|
+
- cmd: "help"
|
|
63
|
+
description: "Help about any command"
|
|
64
|
+
- capability: "ollama-api"
|
|
65
|
+
port: 11434
|
|
66
|
+
description: "Ollama HTTP API,兼容 OpenAI /v1/chat/completions 端点"
|
|
67
|
+
|
|
68
|
+
lifecycle:
|
|
69
|
+
pre_install:
|
|
70
|
+
- run: >-
|
|
71
|
+
if ! command -v ollama >/dev/null 2>&1; then
|
|
72
|
+
echo "未检测到 ollama 命令,将通过官方脚本安装 Ollama..." >&2;
|
|
73
|
+
else
|
|
74
|
+
echo "检测到系统中已安装 ollama,跳过安装步骤,直接使用系统版本。" >&2;
|
|
75
|
+
fi;
|
|
76
|
+
install:
|
|
77
|
+
- run: >-
|
|
78
|
+
install_marker="$HOME/.jishushell/apps/${app_id}/.ollama-install-needed";
|
|
79
|
+
owner_marker="$HOME/.jishushell/apps/${app_id}/.ollama-installed-by-jishushell";
|
|
80
|
+
rm -f "$install_marker";
|
|
81
|
+
if command -v ollama >/dev/null 2>&1; then
|
|
82
|
+
if [ -f "$owner_marker" ]; then
|
|
83
|
+
echo "检测到由 JishuShell 安装的 ollama,复用现有二进制。" >&2;
|
|
84
|
+
else
|
|
85
|
+
echo "检测到系统中已安装 ollama,跳过二进制安装。" >&2;
|
|
86
|
+
fi;
|
|
87
|
+
else
|
|
88
|
+
echo "未检测到 ollama,开始安装..." >&2;
|
|
89
|
+
rm -f "$owner_marker";
|
|
90
|
+
: > "$install_marker";
|
|
91
|
+
fi
|
|
92
|
+
- run: >-
|
|
93
|
+
install_marker="$HOME/.jishushell/apps/${app_id}/.ollama-install-needed";
|
|
94
|
+
owner_marker="$HOME/.jishushell/apps/${app_id}/.ollama-installed-by-jishushell";
|
|
95
|
+
for BINDIR in /usr/local/bin /usr/bin /bin; do
|
|
96
|
+
echo "$PATH" | grep -q "$BINDIR" && break || continue;
|
|
97
|
+
done;
|
|
98
|
+
OLLAMA_INSTALL_DIR="$(dirname "${BINDIR:-/usr/local/bin}")";
|
|
99
|
+
if [ -d "$OLLAMA_INSTALL_DIR/lib/ollama" ]; then
|
|
100
|
+
old_dir="$OLLAMA_INSTALL_DIR/lib/ollama.jishushell-old-$(date +%s)";
|
|
101
|
+
echo "检测到旧版 Ollama 目录,先移动到 $old_dir 以避免长时间卡在清理步骤..." >&2;
|
|
102
|
+
mv "$OLLAMA_INSTALL_DIR/lib/ollama" "$old_dir";
|
|
103
|
+
( rm -rf "$old_dir" >/dev/null 2>&1 || true ) &
|
|
104
|
+
fi;
|
|
105
|
+
curl -fsSL https://ollama.com/install.sh | sh;
|
|
106
|
+
rm -f "$install_marker";
|
|
107
|
+
: > "$owner_marker"
|
|
108
|
+
sudo: true
|
|
109
|
+
ifFileExists: "~/.jishushell/apps/${app_id}/.ollama-install-needed"
|
|
110
|
+
timeout_ms: 900000
|
|
111
|
+
successIfCommandExists: "ollama"
|
|
112
|
+
- run: >-
|
|
113
|
+
install_marker="$HOME/.jishushell/apps/${app_id}/.ollama-install-needed";
|
|
114
|
+
owner_marker="$HOME/.jishushell/apps/${app_id}/.ollama-installed-by-jishushell";
|
|
115
|
+
if [ -f "$install_marker" ] && command -v ollama >/dev/null 2>&1; then
|
|
116
|
+
echo "检测到 ollama 已可用,补记为由 JishuShell 安装。" >&2;
|
|
117
|
+
rm -f "$install_marker";
|
|
118
|
+
: > "$owner_marker";
|
|
119
|
+
fi
|
|
120
|
+
ifFileExists: "~/.jishushell/apps/${app_id}/.ollama-install-needed"
|
|
121
|
+
- run: >-
|
|
122
|
+
service_active_marker="$HOME/.jishushell/apps/${app_id}/.ollama-service-active";
|
|
123
|
+
rm -f "$service_active_marker";
|
|
124
|
+
case "$(uname -s)" in
|
|
125
|
+
Linux)
|
|
126
|
+
if command -v systemctl >/dev/null 2>&1 && systemctl list-unit-files ollama.service >/dev/null 2>&1; then
|
|
127
|
+
if systemctl is-active --quiet ollama.service 2>/dev/null; then
|
|
128
|
+
echo "检测到正在运行的 ollama.service,尝试停止并禁用,后续交由 Nomad 管理..." >&2;
|
|
129
|
+
: > "$service_active_marker";
|
|
130
|
+
else
|
|
131
|
+
echo "检测到未运行的 ollama.service,保留当前 systemd 配置不变。" >&2;
|
|
132
|
+
fi;
|
|
133
|
+
else
|
|
134
|
+
echo "Linux 环境未检测到 ollama.service,跳过 systemd 清理。" >&2;
|
|
135
|
+
fi
|
|
136
|
+
;;
|
|
137
|
+
Darwin)
|
|
138
|
+
echo "macOS 环境尝试关闭 Ollama 自启与正在运行的进程..." >&2;
|
|
139
|
+
if command -v launchctl >/dev/null 2>&1; then
|
|
140
|
+
launchctl bootout "gui/$(id -u)"/com.ollama.ollama 2>/dev/null || true;
|
|
141
|
+
launchctl disable "gui/$(id -u)/com.ollama.ollama" 2>/dev/null || true;
|
|
142
|
+
fi;
|
|
143
|
+
osascript -e 'tell application "Ollama" to quit' >/dev/null 2>&1 || true;
|
|
144
|
+
pkill -TERM -x ollama 2>/dev/null || true;
|
|
145
|
+
pkill -TERM -x Ollama 2>/dev/null || true
|
|
146
|
+
;;
|
|
147
|
+
*)
|
|
148
|
+
echo "当前平台不支持自动清理 Ollama 自启,跳过。" >&2
|
|
149
|
+
;;
|
|
150
|
+
esac
|
|
151
|
+
- run: >-
|
|
152
|
+
systemctl disable --now ollama;
|
|
153
|
+
rm -f "$HOME/.jishushell/apps/${app_id}/.ollama-service-active"
|
|
154
|
+
sudo: true
|
|
155
|
+
ifFileExists: "~/.jishushell/apps/${app_id}/.ollama-service-active"
|
|
156
|
+
|
|
157
|
+
uninstall:
|
|
158
|
+
- run: >-
|
|
159
|
+
rm -f /usr/local/bin/ollama /usr/bin/ollama /bin/ollama;
|
|
160
|
+
rm -rf /usr/local/lib/ollama /usr/lib/ollama /usr/share/ollama 2>/dev/null || true;
|
|
161
|
+
rm -f "$HOME/.jishushell/apps/${app_id}/.ollama-installed-by-jishushell"
|
|
162
|
+
sudo: true
|
|
163
|
+
ifFileExists: "~/.jishushell/apps/${app_id}/.ollama-installed-by-jishushell"
|
|
164
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
id: ollama-cpu-docker
|
|
2
|
+
name: Ollama CPU(Docker)
|
|
3
|
+
version: "1.0.0"
|
|
4
|
+
jishushell:
|
|
5
|
+
min_version: "0.4.24"
|
|
6
|
+
description: "使用 alpine/ollama 镜像运行的纯 CPU 版 Ollama"
|
|
7
|
+
singleInstance: true
|
|
8
|
+
|
|
9
|
+
tasks:
|
|
10
|
+
- name: gateway
|
|
11
|
+
role: service
|
|
12
|
+
runtime: container
|
|
13
|
+
image: "alpine/ollama:latest"
|
|
14
|
+
env:
|
|
15
|
+
OLLAMA_HOST: "0.0.0.0:11434"
|
|
16
|
+
volumes:
|
|
17
|
+
- source: "~/.ollama"
|
|
18
|
+
target: "/root/.ollama"
|
|
19
|
+
resources:
|
|
20
|
+
cpu: "2000m"
|
|
21
|
+
memory: "4096Mi"
|
|
22
|
+
ports:
|
|
23
|
+
- name: gateway
|
|
24
|
+
port: 11434
|
|
25
|
+
health:
|
|
26
|
+
http:
|
|
27
|
+
path: /api/version
|
|
28
|
+
port: 11434
|
|
29
|
+
interval: "15s"
|
|
30
|
+
timeout: "5s"
|
|
31
|
+
retries: 3
|
|
32
|
+
start_period: "30s"
|
|
33
|
+
|
|
34
|
+
provides:
|
|
35
|
+
- capability: "ollama-api"
|
|
36
|
+
port: 11434
|
|
37
|
+
description: "Ollama HTTP API,兼容 OpenAI /v1/chat/completions 端点"
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
id: ollama-with-hollama-binary
|
|
2
|
+
name: Ollama
|
|
3
|
+
version: "1.0.0"
|
|
4
|
+
jishushell:
|
|
5
|
+
min_version: "0.4.24"
|
|
6
|
+
description: "通过官方脚本安装并运行 Ollama,同时提供 Hollama Web UI。"
|
|
7
|
+
singleInstance: true
|
|
8
|
+
|
|
9
|
+
tasks:
|
|
10
|
+
- name: gateway
|
|
11
|
+
role: service
|
|
12
|
+
runtime: process
|
|
13
|
+
command: /usr/local/bin/ollama
|
|
14
|
+
args: ["serve"]
|
|
15
|
+
env:
|
|
16
|
+
OLLAMA_HOST: "0.0.0.0:11434"
|
|
17
|
+
resources:
|
|
18
|
+
cpu: "2000m"
|
|
19
|
+
memory: "4096Mi"
|
|
20
|
+
ports:
|
|
21
|
+
- name: gateway
|
|
22
|
+
port: 11434
|
|
23
|
+
visibility: external
|
|
24
|
+
health:
|
|
25
|
+
http:
|
|
26
|
+
path: /api/version
|
|
27
|
+
port: 11434
|
|
28
|
+
interval: "15s"
|
|
29
|
+
timeout: "5s"
|
|
30
|
+
retries: 3
|
|
31
|
+
start_period: "30s"
|
|
32
|
+
|
|
33
|
+
- name: hollama
|
|
34
|
+
role: sidecar
|
|
35
|
+
runtime: container
|
|
36
|
+
image: "ghcr.io/fmaclen/hollama:latest"
|
|
37
|
+
resources:
|
|
38
|
+
cpu: "500m"
|
|
39
|
+
memory: "512Mi"
|
|
40
|
+
ports:
|
|
41
|
+
- name: webui
|
|
42
|
+
port: 4173
|
|
43
|
+
visibility: external
|
|
44
|
+
health:
|
|
45
|
+
http:
|
|
46
|
+
path: /
|
|
47
|
+
port: 4173
|
|
48
|
+
interval: "15s"
|
|
49
|
+
timeout: "5s"
|
|
50
|
+
retries: 6
|
|
51
|
+
start_period: "30s"
|
|
52
|
+
|
|
53
|
+
provides:
|
|
54
|
+
- capability: "hollama-web"
|
|
55
|
+
port: 4173
|
|
56
|
+
protocol: "http"
|
|
57
|
+
description: "Hollama Web 界面"
|
|
58
|
+
- capability: "ollama-api"
|
|
59
|
+
port: 11434
|
|
60
|
+
protocol: "http"
|
|
61
|
+
description: "Ollama HTTP API,兼容 OpenAI /v1/chat/completions 端点"
|
|
62
|
+
|
|
63
|
+
lifecycle:
|
|
64
|
+
pre_install:
|
|
65
|
+
- run: >-
|
|
66
|
+
if ! command -v ollama >/dev/null 2>&1; then
|
|
67
|
+
echo "未检测到 ollama 命令,将通过官方脚本安装 Ollama..." >&2;
|
|
68
|
+
else
|
|
69
|
+
echo "检测到系统中已安装 ollama,跳过安装步骤,直接使用系统版本。" >&2;
|
|
70
|
+
fi;
|
|
71
|
+
install:
|
|
72
|
+
- downloadImage: "ghcr.io/fmaclen/hollama:latest"
|
|
73
|
+
- run: >-
|
|
74
|
+
install_marker="$HOME/.jishushell/apps/${app_id}/.ollama-install-needed";
|
|
75
|
+
owner_marker="$HOME/.jishushell/apps/${app_id}/.ollama-installed-by-jishushell";
|
|
76
|
+
rm -f "$install_marker";
|
|
77
|
+
if command -v ollama >/dev/null 2>&1; then
|
|
78
|
+
if [ -f "$owner_marker" ]; then
|
|
79
|
+
echo "检测到由 JishuShell 安装的 ollama,复用现有二进制。" >&2;
|
|
80
|
+
else
|
|
81
|
+
echo "检测到系统中已安装 ollama,跳过二进制安装。" >&2;
|
|
82
|
+
fi;
|
|
83
|
+
else
|
|
84
|
+
echo "未检测到 ollama,开始安装..." >&2;
|
|
85
|
+
rm -f "$owner_marker";
|
|
86
|
+
: > "$install_marker";
|
|
87
|
+
fi
|
|
88
|
+
- run: >-
|
|
89
|
+
install_marker="$HOME/.jishushell/apps/${app_id}/.ollama-install-needed";
|
|
90
|
+
owner_marker="$HOME/.jishushell/apps/${app_id}/.ollama-installed-by-jishushell";
|
|
91
|
+
for BINDIR in /usr/local/bin /usr/bin /bin; do
|
|
92
|
+
echo "$PATH" | grep -q "$BINDIR" && break || continue;
|
|
93
|
+
done;
|
|
94
|
+
OLLAMA_INSTALL_DIR="$(dirname "${BINDIR:-/usr/local/bin}")";
|
|
95
|
+
if [ -d "$OLLAMA_INSTALL_DIR/lib/ollama" ]; then
|
|
96
|
+
old_dir="$OLLAMA_INSTALL_DIR/lib/ollama.jishushell-old-$(date +%s)";
|
|
97
|
+
echo "检测到旧版 Ollama 目录,先移动到 $old_dir 以避免长时间卡在清理步骤..." >&2;
|
|
98
|
+
mv "$OLLAMA_INSTALL_DIR/lib/ollama" "$old_dir";
|
|
99
|
+
( rm -rf "$old_dir" >/dev/null 2>&1 || true ) &
|
|
100
|
+
fi;
|
|
101
|
+
curl -fsSL https://ollama.com/install.sh | sh;
|
|
102
|
+
rm -f "$install_marker";
|
|
103
|
+
: > "$owner_marker"
|
|
104
|
+
sudo: true
|
|
105
|
+
ifFileExists: "~/.jishushell/apps/${app_id}/.ollama-install-needed"
|
|
106
|
+
timeout_ms: 900000
|
|
107
|
+
successIfCommandExists: "ollama"
|
|
108
|
+
- run: >-
|
|
109
|
+
install_marker="$HOME/.jishushell/apps/${app_id}/.ollama-install-needed";
|
|
110
|
+
owner_marker="$HOME/.jishushell/apps/${app_id}/.ollama-installed-by-jishushell";
|
|
111
|
+
if [ -f "$install_marker" ] && command -v ollama >/dev/null 2>&1; then
|
|
112
|
+
echo "检测到 ollama 已可用,补记为由 JishuShell 安装。" >&2;
|
|
113
|
+
rm -f "$install_marker";
|
|
114
|
+
: > "$owner_marker";
|
|
115
|
+
fi
|
|
116
|
+
ifFileExists: "~/.jishushell/apps/${app_id}/.ollama-install-needed"
|
|
117
|
+
- run: >-
|
|
118
|
+
service_active_marker="$HOME/.jishushell/apps/${app_id}/.ollama-service-active";
|
|
119
|
+
rm -f "$service_active_marker";
|
|
120
|
+
case "$(uname -s)" in
|
|
121
|
+
Linux)
|
|
122
|
+
if command -v systemctl >/dev/null 2>&1 && systemctl list-unit-files ollama.service >/dev/null 2>&1; then
|
|
123
|
+
if systemctl is-active --quiet ollama.service 2>/dev/null; then
|
|
124
|
+
echo "检测到正在运行的 ollama.service,尝试停止并禁用,后续交由 Nomad 管理..." >&2;
|
|
125
|
+
: > "$service_active_marker";
|
|
126
|
+
else
|
|
127
|
+
echo "检测到未运行的 ollama.service,保留当前 systemd 配置不变。" >&2;
|
|
128
|
+
fi;
|
|
129
|
+
else
|
|
130
|
+
echo "Linux 环境未检测到 ollama.service,跳过 systemd 清理。" >&2;
|
|
131
|
+
fi
|
|
132
|
+
;;
|
|
133
|
+
Darwin)
|
|
134
|
+
echo "macOS 环境尝试关闭 Ollama 自启与正在运行的进程..." >&2;
|
|
135
|
+
if command -v launchctl >/dev/null 2>&1; then
|
|
136
|
+
launchctl bootout "gui/$(id -u)"/com.ollama.ollama 2>/dev/null || true;
|
|
137
|
+
launchctl disable "gui/$(id -u)/com.ollama.ollama" 2>/dev/null || true;
|
|
138
|
+
fi;
|
|
139
|
+
osascript -e 'tell application "Ollama" to quit' >/dev/null 2>&1 || true;
|
|
140
|
+
pkill -TERM -x ollama 2>/dev/null || true;
|
|
141
|
+
pkill -TERM -x Ollama 2>/dev/null || true
|
|
142
|
+
;;
|
|
143
|
+
*)
|
|
144
|
+
echo "当前平台不支持自动清理 Ollama 自启,跳过。" >&2
|
|
145
|
+
;;
|
|
146
|
+
esac
|
|
147
|
+
- run: >-
|
|
148
|
+
systemctl disable --now ollama;
|
|
149
|
+
rm -f "$HOME/.jishushell/apps/${app_id}/.ollama-service-active"
|
|
150
|
+
sudo: true
|
|
151
|
+
ifFileExists: "~/.jishushell/apps/${app_id}/.ollama-service-active"
|
|
152
|
+
|
|
153
|
+
uninstall:
|
|
154
|
+
- run: >-
|
|
155
|
+
rm -f /usr/local/bin/ollama /usr/bin/ollama /bin/ollama;
|
|
156
|
+
rm -rf /usr/local/lib/ollama /usr/lib/ollama /usr/share/ollama 2>/dev/null || true;
|
|
157
|
+
rm -f "$HOME/.jishushell/apps/${app_id}/.ollama-installed-by-jishushell"
|
|
158
|
+
sudo: true
|
|
159
|
+
ifFileExists: "~/.jishushell/apps/${app_id}/.ollama-installed-by-jishushell"
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
id: openclaw-binary
|
|
2
|
+
name: OpenClaw Binary
|
|
3
|
+
version: "1.0.0"
|
|
4
|
+
jishushell:
|
|
5
|
+
min_version: "0.4.24"
|
|
6
|
+
agentType: openclaw
|
|
7
|
+
description: "将 OpenClaw 安装到应用目录内的 npm prefix,并以 process runtime 运行网关"
|
|
8
|
+
singleInstance: false
|
|
9
|
+
|
|
10
|
+
tasks:
|
|
11
|
+
- name: gateway
|
|
12
|
+
role: service
|
|
13
|
+
runtime: process
|
|
14
|
+
command: ~/.jishushell/apps/${app_id}/bin/openclaw
|
|
15
|
+
args: ["gateway", "run", "--port", "18789", "--allow-unconfigured"]
|
|
16
|
+
env:
|
|
17
|
+
NODE_ENV: production
|
|
18
|
+
resources:
|
|
19
|
+
cpu: "1000m"
|
|
20
|
+
memory: "2024Mi"
|
|
21
|
+
ports:
|
|
22
|
+
- name: http
|
|
23
|
+
port: 18789
|
|
24
|
+
visibility: external
|
|
25
|
+
health:
|
|
26
|
+
http:
|
|
27
|
+
path: /health
|
|
28
|
+
port: 18789
|
|
29
|
+
interval: "15s"
|
|
30
|
+
timeout: "5s"
|
|
31
|
+
retries: 3
|
|
32
|
+
start_period: "30s"
|
|
33
|
+
|
|
34
|
+
provides:
|
|
35
|
+
- capability: "openclaw-dashboard"
|
|
36
|
+
port: 18789
|
|
37
|
+
description: "OpenClaw Dashboard"
|
|
38
|
+
|
|
39
|
+
lifecycle:
|
|
40
|
+
install:
|
|
41
|
+
- mkdir: "~/.jishushell/apps/${app_id}/runtime"
|
|
42
|
+
- mkdir: "~/.jishushell/apps/${app_id}/bin"
|
|
43
|
+
- mkdir: "~/.jishushell/apps/${app_id}/openclaw-home"
|
|
44
|
+
- run: >-
|
|
45
|
+
runtime_dir="$HOME/.jishushell/apps/${app_id}/runtime";
|
|
46
|
+
pkg_entry="$runtime_dir/lib/node_modules/openclaw/openclaw.mjs";
|
|
47
|
+
if [ -f "$pkg_entry" ]; then
|
|
48
|
+
echo "检测到应用目录中已安装 OpenClaw,跳过 npm 安装。" >&2;
|
|
49
|
+
else
|
|
50
|
+
npm install -g --prefix "$runtime_dir" openclaw@latest;
|
|
51
|
+
fi
|
|
52
|
+
timeout_ms: 900000
|
|
53
|
+
- run: >-
|
|
54
|
+
runtime_dir="$HOME/.jishushell/apps/${app_id}/runtime";
|
|
55
|
+
wrapper_dir="$HOME/.jishushell/apps/${app_id}/bin";
|
|
56
|
+
openclaw_home="$HOME/.jishushell/apps/${app_id}/openclaw-home";
|
|
57
|
+
pkg_entry="$runtime_dir/lib/node_modules/openclaw/openclaw.mjs";
|
|
58
|
+
wrapper="$wrapper_dir/openclaw";
|
|
59
|
+
node_bin="$(command -v node)";
|
|
60
|
+
if [ -z "$node_bin" ]; then
|
|
61
|
+
echo "未检测到 node,可执行 OpenClaw wrapper 创建失败。" >&2;
|
|
62
|
+
exit 1;
|
|
63
|
+
fi;
|
|
64
|
+
if [ ! -f "$pkg_entry" ]; then
|
|
65
|
+
echo "未找到 OpenClaw 入口文件: $pkg_entry" >&2;
|
|
66
|
+
exit 1;
|
|
67
|
+
fi;
|
|
68
|
+
printf '%s\n' '#!/bin/sh' "export OPENCLAW_HOME=\"$openclaw_home\"" "export HOME=\"$openclaw_home\"" "exec \"$node_bin\" \"$pkg_entry\" \"\$@\"" > "$wrapper";
|
|
69
|
+
chmod +x "$wrapper"
|