Sanyam400 commited on
Commit
25bafb3
Β·
verified Β·
1 Parent(s): b81eddc

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -12
Dockerfile CHANGED
@@ -1,5 +1,5 @@
1
  # ============================================================
2
- # Hermes Agent β€” Self-contained HF Spaces deployment (Stable v7.2)
3
  # Single Dockerfile: Gateway + Dashboard + Chat WebUI + Router
4
  #
5
  # HOW TO DEPLOY:
@@ -12,8 +12,8 @@
12
  # OPENROUTER_API_KEY β†’ from openrouter.ai (recommended)
13
  # OR OPENAI_API_KEY / ANTHROPIC_API_KEY
14
  #
15
- # HF_TOKEN β†’ write token from hf.co/settings/tokens
16
- # HF_BUCKET β†’ Sanyam400/Hermes-storage
17
  #
18
  # API_SERVER_KEY β†’ random long secret string
19
  #
@@ -483,10 +483,8 @@ echo "β•‘ Hermes Agent β€” HF Spaces bootloader β•‘"
483
  echo "β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•"
484
 
485
  # ── 0. BROWSER FIX: Ensure /tmp agent-browser socket dir is writable ──────────
486
- # agent-browser creates Unix socket files under /tmp/agent-browser-* for IPC.
487
- # If /tmp is not writable by the hermes user these socket opens fail silently
488
- # and browser_navigate times out. We pre-create the dir with open permissions here.
489
- # NOTE: We do NOT use chmod 1777 /tmp as this triggers permission errors on HF Spaces.
490
  mkdir -m 777 -p /tmp/agent-browser-sockets
491
 
492
  # ── 1. BACKGROUND FRONTEND UPDATES ────────────────────────────
@@ -494,6 +492,8 @@ echo "[boot] πŸ”„ Checking for WebUI updates in background..."
494
  (cd /opt/hermes-webui && git pull >/dev/null 2>&1) &
495
 
496
  # ── 2. HIGH SPEED SELECTIVE EXCLUSION SYNC ────────────────────
 
 
497
  if [ -n "${HF_TOKEN:-}" ] && [ -n "${HF_BUCKET:-}" ]; then
498
  echo "[boot] πŸ“¦ Restoring complete old workspace datasets..."
499
  export HF_TOKEN="${HF_TOKEN}"
@@ -507,7 +507,7 @@ if [ -n "${HF_TOKEN:-}" ] && [ -n "${HF_BUCKET:-}" ]; then
507
  --exclude "**/*.db-wal" --exclude "**/*.db-shm" --exclude "**/*.db-journal" 2>/dev/null; then
508
  echo "[boot] βœ… Old databases, configs, & logs restored instantly"
509
  else
510
- echo "[boot] ⚠️ Bucket is empty or sync error - starting fresh."
511
  fi
512
  fi
513
 
@@ -525,7 +525,7 @@ if os.path.exists(db_dir):
525
  cursor = conn.cursor()
526
  cursor.execute("PRAGMA integrity_check;")
527
  res = cursor.fetchone()
528
- # FIX: Check res tuple value directly to ensure SQLite checking is fully operational
529
  if res and res == "ok":
530
  cursor.execute("PRAGMA journal_mode=WAL;")
531
  cursor.execute("PRAGMA synchronous=NORMAL;")
@@ -759,11 +759,10 @@ if [ -n "${HF_TOKEN:-}" ] && [ -n "${HF_BUCKET:-}" ]; then
759
  echo "[boot-clean] 🧼 Remote bucket optimized."
760
 
761
  while true; do
762
- # FIX: Changed background sleep timer to inherit $SYNC_INTERVAL (which defaults to 30 seconds)
763
  sleep "${SYNC_INTERVAL:-30}"
764
 
765
- # FIX: Retained critical --delete parameter to ensure that any local file deletions, updates, or creations
766
- # automatically synchronize and delete corresponding redundant files in your Hugging Face space bucket!
767
  hf sync "$HH" "hf://buckets/${HF_BUCKET}" \
768
  --delete \
769
  --exclude ".venv/**" --exclude "**/venv/**" --exclude "venv/**" \
 
1
  # ============================================================
2
+ # Hermes Agent β€” Self-contained HF Spaces deployment (Stable v7.4)
3
  # Single Dockerfile: Gateway + Dashboard + Chat WebUI + Router
4
  #
5
  # HOW TO DEPLOY:
 
12
  # OPENROUTER_API_KEY β†’ from openrouter.ai (recommended)
13
  # OR OPENAI_API_KEY / ANTHROPIC_API_KEY
14
  #
15
+ # HF_TOKEN β†’ write token from hf.co/settings/tokens (MUST BE WRITE ROLE)
16
+ # HF_BUCKET β†’ Sanyam400/Hermes-storage (your bucket repository)
17
  #
18
  # API_SERVER_KEY β†’ random long secret string
19
  #
 
483
  echo "β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•"
484
 
485
  # ── 0. BROWSER FIX: Ensure /tmp agent-browser socket dir is writable ──────────
486
+ # Creating a dedicated 777-permission directory allows socket initialization by non-root users.
487
+ # Note: We pre-create it directly with 777 permissions to avoid running chmod at runtime.
 
 
488
  mkdir -m 777 -p /tmp/agent-browser-sockets
489
 
490
  # ── 1. BACKGROUND FRONTEND UPDATES ────────────────────────────
 
492
  (cd /opt/hermes-webui && git pull >/dev/null 2>&1) &
493
 
494
  # ── 2. HIGH SPEED SELECTIVE EXCLUSION SYNC ────────────────────
495
+ # FIX: Direct bucket-only sync. Runs on standard buckets scheme without datasets fallbacks,
496
+ # guaranteeing quick boot speed and direct synchronization.
497
  if [ -n "${HF_TOKEN:-}" ] && [ -n "${HF_BUCKET:-}" ]; then
498
  echo "[boot] πŸ“¦ Restoring complete old workspace datasets..."
499
  export HF_TOKEN="${HF_TOKEN}"
 
507
  --exclude "**/*.db-wal" --exclude "**/*.db-shm" --exclude "**/*.db-journal" 2>/dev/null; then
508
  echo "[boot] βœ… Old databases, configs, & logs restored instantly"
509
  else
510
+ echo "[boot] ⚠️ Bucket empty or authentication failed β€” starting fresh."
511
  fi
512
  fi
513
 
 
525
  cursor = conn.cursor()
526
  cursor.execute("PRAGMA integrity_check;")
527
  res = cursor.fetchone()
528
+ # FIX: Check res tuple index directly to ensure SQLite checking evaluates cleanly
529
  if res and res == "ok":
530
  cursor.execute("PRAGMA journal_mode=WAL;")
531
  cursor.execute("PRAGMA synchronous=NORMAL;")
 
759
  echo "[boot-clean] 🧼 Remote bucket optimized."
760
 
761
  while true; do
 
762
  sleep "${SYNC_INTERVAL:-30}"
763
 
764
+ # FIX: Sync and backup exclusively through standard Hugging Face bucket endpoint (hf://buckets/...)
765
+ # as requested. Dynamic datasets code fallbacks are cleanly stripped out.
766
  hf sync "$HH" "hf://buckets/${HF_BUCKET}" \
767
  --delete \
768
  --exclude ".venv/**" --exclude "**/venv/**" --exclude "venv/**" \