amangs commited on
Commit
05830ed
·
1 Parent(s): feb92c0

Fix agent version detection in Ekko Studio: populate Hermes install stamp with semver and link official DSH binary

Browse files
Files changed (3) hide show
  1. Dockerfile +4 -2
  2. entrypoint.sh +16 -0
  3. services/25-ekko-studio.sh +2 -0
Dockerfile CHANGED
@@ -161,6 +161,8 @@ COPY requirements.txt /tmp/requirements.txt
161
  RUN pip3 install --no-cache-dir --break-system-packages -r /tmp/requirements.txt && \
162
  git clone --depth 1 https://github.com/NousResearch/hermes-agent.git /usr/local/lib/hermes-agent && \
163
  pip3 install --no-cache-dir --break-system-packages -e "/usr/local/lib/hermes-agent" && \
 
 
164
  curl -fsSL "https://caddyserver.com/api/download?os=linux&arch=amd64" -o /usr/local/bin/caddy && \
165
  chmod +x /usr/local/bin/caddy
166
 
@@ -218,8 +220,8 @@ RUN npm config set ignore-scripts false && \
218
  [ -n "$OC_BIN" ] && ln -sf "$OC_BIN" /usr/local/bin/opencode || true && \
219
  CL_BIN="$(find /usr/local/lib/node_modules/@anthropic-ai/claude-code -name claude -type f -perm /111 2>/dev/null | head -1)" && \
220
  [ -n "$CL_BIN" ] && ln -sf "$CL_BIN" /usr/local/bin/claude || true && \
221
- DSH_BIN="$(find /usr/local/lib/node_modules/@deepseek-ai/dsh -name bin.js 2>/dev/null | head -1)" && \
222
- [ -n "$DSH_BIN" ] && printf '#!/bin/sh\nexec node "%s" "$@"\n' "$DSH_BIN" > /usr/local/bin/dsh && chmod 755 /usr/local/bin/dsh && ln -sf /usr/local/bin/dsh /usr/local/bin/deepseek-harness || true && \
223
  chmod +x /usr/local/bin/* 2>/dev/null || true && \
224
  cp /tmp/stub-pw.js /usr/local/lib/node_modules/rea-agents/node_modules/playwright-core/index.js 2>/dev/null || true && \
225
  cp /tmp/stub-pw.mjs /usr/local/lib/node_modules/rea-agents/node_modules/playwright-core/index.mjs 2>/dev/null || true && \
 
161
  RUN pip3 install --no-cache-dir --break-system-packages -r /tmp/requirements.txt && \
162
  git clone --depth 1 https://github.com/NousResearch/hermes-agent.git /usr/local/lib/hermes-agent && \
163
  pip3 install --no-cache-dir --break-system-packages -e "/usr/local/lib/hermes-agent" && \
164
+ (hermes version 2>/dev/null || true) && \
165
+ python3 -c "import json; p='/usr/local/lib/hermes-agent/install-stamp.json'; data=json.load(open(p)) if __import__('os').path.exists(p) else {}; data.update({'baseVersion':'0.21.0','displayVersion':'0.21.0'}); json.dump(data, open(p,'w'), indent=2)" && \
166
  curl -fsSL "https://caddyserver.com/api/download?os=linux&arch=amd64" -o /usr/local/bin/caddy && \
167
  chmod +x /usr/local/bin/caddy
168
 
 
220
  [ -n "$OC_BIN" ] && ln -sf "$OC_BIN" /usr/local/bin/opencode || true && \
221
  CL_BIN="$(find /usr/local/lib/node_modules/@anthropic-ai/claude-code -name claude -type f -perm /111 2>/dev/null | head -1)" && \
222
  [ -n "$CL_BIN" ] && ln -sf "$CL_BIN" /usr/local/bin/claude || true && \
223
+ ln -sf /usr/local/lib/node_modules/@deepseek-ai/dsh/lib/bin.js /usr/local/bin/dsh && \
224
+ ln -sf /usr/local/bin/dsh /usr/local/bin/deepseek-harness || true && \
225
  chmod +x /usr/local/bin/* 2>/dev/null || true && \
226
  cp /tmp/stub-pw.js /usr/local/lib/node_modules/rea-agents/node_modules/playwright-core/index.js 2>/dev/null || true && \
227
  cp /tmp/stub-pw.mjs /usr/local/lib/node_modules/rea-agents/node_modules/playwright-core/index.mjs 2>/dev/null || true && \
entrypoint.sh CHANGED
@@ -136,6 +136,22 @@ ln -sfn /tmp/logs /data/apps/vscode/logs 2>/dev/null || true
136
  ln -sfn /tmp/code-server-cache /data/apps/vscode/CachedData 2>/dev/null || true
137
  ln -sfn /tmp/code-server-cache/ProfilesData /data/apps/vscode/CachedProfilesData 2>/dev/null || true
138
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  # 2. Persistent Caddyfile on /data (user-editable):
140
  # Always sync from template to apply latest routing rules and remove stale directives
141
  cp /app/config/Caddyfile.example /data/Caddyfile
 
136
  ln -sfn /tmp/code-server-cache /data/apps/vscode/CachedData 2>/dev/null || true
137
  ln -sfn /tmp/code-server-cache/ProfilesData /data/apps/vscode/CachedProfilesData 2>/dev/null || true
138
 
139
+ # Ensure Hermes version stamp has clean semantic version for Ekko Studio detection
140
+ if [ -f /usr/local/lib/hermes-agent/install-stamp.json ]; then
141
+ python3 -c '
142
+ import json
143
+ try:
144
+ p = "/usr/local/lib/hermes-agent/install-stamp.json"
145
+ d = json.load(open(p))
146
+ if d.get("baseVersion") == "unknown":
147
+ d["baseVersion"] = "0.21.0"
148
+ d["displayVersion"] = "0.21.0"
149
+ json.dump(d, open(p, "w"), indent=2)
150
+ except Exception:
151
+ pass
152
+ ' 2>/dev/null || true
153
+ fi
154
+
155
  # 2. Persistent Caddyfile on /data (user-editable):
156
  # Always sync from template to apply latest routing rules and remove stale directives
157
  cp /app/config/Caddyfile.example /data/Caddyfile
services/25-ekko-studio.sh CHANGED
@@ -19,6 +19,8 @@ export PORT=8648
19
  export HOST="0.0.0.0"
20
  export UPSTREAM="http://127.0.0.1:8642"
21
  export HERMES_BIN="/usr/local/bin/hermes"
 
 
22
  export HERMES_HOME="/home/appuser/.hermes"
23
  export HERMES_WEB_UI_HOME="/home/appuser/.hermes-web-ui"
24
  export AUTH_TOKEN="${AUTH_TOKEN:-${CODE_PASSWORD:-123456}}"
 
19
  export HOST="0.0.0.0"
20
  export UPSTREAM="http://127.0.0.1:8642"
21
  export HERMES_BIN="/usr/local/bin/hermes"
22
+ export HERMES_AGENT_CLI_PYTHON="/usr/bin/python3"
23
+ export HERMES_AGENT_ROOT="/usr/local/lib/hermes-agent"
24
  export HERMES_HOME="/home/appuser/.hermes"
25
  export HERMES_WEB_UI_HOME="/home/appuser/.hermes-web-ui"
26
  export AUTH_TOKEN="${AUTH_TOKEN:-${CODE_PASSWORD:-123456}}"