Somrat Sorkar commited on
Commit
644054d
Β·
1 Parent(s): 5365372

Remove legacy workspace-sync.sh, keep only Python sync

Browse files
Files changed (4) hide show
  1. Dockerfile +1 -2
  2. README.md +0 -1
  3. start.sh +1 -6
  4. workspace-sync.sh +0 -40
Dockerfile CHANGED
@@ -37,9 +37,8 @@ COPY --chown=1000:1000 dns-fix.js /opt/dns-fix.js
37
  COPY --chown=1000:1000 health-server.js /home/node/app/health-server.js
38
  COPY --chown=1000:1000 start.sh /home/node/app/start.sh
39
  COPY --chown=1000:1000 keep-alive.sh /home/node/app/keep-alive.sh
40
- COPY --chown=1000:1000 workspace-sync.sh /home/node/app/workspace-sync.sh
41
  COPY --chown=1000:1000 workspace-sync.py /home/node/app/workspace-sync.py
42
- RUN chmod +x /home/node/app/start.sh /home/node/app/keep-alive.sh /home/node/app/workspace-sync.sh
43
 
44
  USER node
45
 
 
37
  COPY --chown=1000:1000 health-server.js /home/node/app/health-server.js
38
  COPY --chown=1000:1000 start.sh /home/node/app/start.sh
39
  COPY --chown=1000:1000 keep-alive.sh /home/node/app/keep-alive.sh
 
40
  COPY --chown=1000:1000 workspace-sync.py /home/node/app/workspace-sync.py
41
+ RUN chmod +x /home/node/app/start.sh /home/node/app/keep-alive.sh
42
 
43
  USER node
44
 
README.md CHANGED
@@ -370,7 +370,6 @@ HuggingClaw/
370
  β”œβ”€β”€ start.sh # Config generator + validation + orchestrator
371
  β”œβ”€β”€ keep-alive.sh # Self-ping to prevent HF sleep
372
  β”œβ”€β”€ workspace-sync.py # Smart sync via huggingface_hub (with git fallback)
373
- β”œβ”€β”€ workspace-sync.sh # Legacy git-based sync (fallback)
374
  β”œβ”€β”€ health-server.js # Health endpoint (/health)
375
  β”œβ”€β”€ dns-fix.js # DNS override for HF network restrictions
376
  β”œβ”€β”€ .env.example # Complete configuration reference
 
370
  β”œβ”€β”€ start.sh # Config generator + validation + orchestrator
371
  β”œβ”€β”€ keep-alive.sh # Self-ping to prevent HF sleep
372
  β”œβ”€β”€ workspace-sync.py # Smart sync via huggingface_hub (with git fallback)
 
373
  β”œβ”€β”€ health-server.js # Health endpoint (/health)
374
  β”œβ”€β”€ dns-fix.js # DNS override for HF network restrictions
375
  β”œβ”€β”€ .env.example # Complete configuration reference
start.sh CHANGED
@@ -301,12 +301,7 @@ trap graceful_shutdown SIGTERM SIGINT
301
  node /home/node/app/health-server.js &
302
  /home/node/app/keep-alive.sh &
303
 
304
- # Use Python huggingface_hub sync if available, fallback to git-based sync
305
- if python3 -c "import huggingface_hub" 2>/dev/null; then
306
- python3 /home/node/app/workspace-sync.py &
307
- else
308
- /home/node/app/workspace-sync.sh &
309
- fi
310
 
311
  # ── Launch gateway ──
312
  echo "πŸš€ Launching OpenClaw gateway on port 7860..."
 
301
  node /home/node/app/health-server.js &
302
  /home/node/app/keep-alive.sh &
303
 
304
+ python3 /home/node/app/workspace-sync.py &
 
 
 
 
 
305
 
306
  # ── Launch gateway ──
307
  echo "πŸš€ Launching OpenClaw gateway on port 7860..."
workspace-sync.sh DELETED
@@ -1,40 +0,0 @@
1
- #!/bin/bash
2
- # Periodic workspace sync to HF Dataset
3
- # Commits and pushes workspace changes every SYNC_INTERVAL seconds
4
- # Runs as a background process alongside the gateway
5
-
6
- INTERVAL="${SYNC_INTERVAL:-600}" # Default: every 10 minutes
7
- WORKSPACE="/home/node/.openclaw/workspace"
8
-
9
- # Wait for workspace to be initialized
10
- sleep 30
11
-
12
- if [ ! -d "$WORKSPACE/.git" ]; then
13
- echo "πŸ“ Workspace sync: no git repo found, skipping."
14
- exit 0
15
- fi
16
-
17
- echo "πŸ”„ Workspace sync started: syncing every ${INTERVAL}s"
18
-
19
- while true; do
20
- sleep "$INTERVAL"
21
-
22
- cd "$WORKSPACE" || continue
23
-
24
- # Check if there are any changes
25
- git add -A 2>/dev/null
26
- if git diff --cached --quiet 2>/dev/null; then
27
- # No changes
28
- continue
29
- fi
30
-
31
- # Commit and push
32
- TIMESTAMP=$(date -u +%Y-%m-%dT%H:%M:%SZ)
33
- if git commit -m "Auto-sync ${TIMESTAMP}" 2>/dev/null; then
34
- if git push origin main 2>/dev/null; then
35
- echo "πŸ”„ Workspace sync: pushed changes (${TIMESTAMP})"
36
- else
37
- echo "πŸ”„ Workspace sync: commit ok, push failed (will retry)"
38
- fi
39
- fi
40
- done