Spaces:
Running
Running
Somrat Sorkar commited on
Commit Β·
644054d
1
Parent(s): 5365372
Remove legacy workspace-sync.sh, keep only Python sync
Browse files- Dockerfile +1 -2
- README.md +0 -1
- start.sh +1 -6
- 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
|
| 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 |
-
|
| 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|