ysharma HF Staff commited on
Commit
7d52e41
Β·
verified Β·
1 Parent(s): 78efe23

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +50 -18
README.md CHANGED
@@ -11,16 +11,42 @@ license: mit
11
  short_description: Keep MCP-birthday hackathon spaces availble
12
  ---
13
 
14
- # πŸ”„ Space Keeper
 
 
 
 
 
 
 
 
 
 
 
15
 
16
  Keeps HuggingFace Spaces alive during hackathon evaluation by pinging them on a schedule.
17
 
18
- ## What it does
 
 
 
 
 
 
19
 
20
- - Automatically pings all Spaces in a specified organization every N hours
21
- - Prevents Spaces from sleeping due to inactivity
22
- - Logs all runs with success/failure status
23
- - Provides a manual "Run Now" button for immediate pings
 
 
 
 
 
 
 
 
 
24
 
25
  ## Configuration
26
 
@@ -28,19 +54,25 @@ Set these environment variables in your Space settings:
28
 
29
  | Variable | Default | Description |
30
  |----------|---------|-------------|
31
- | `ORG_NAME` | `mcp-hackathon` | The HuggingFace organization to monitor |
32
- | `PING_INTERVAL_HOURS` | `6` | How often to ping (in hours) |
33
- | `REQUEST_TIMEOUT` | `30` | Timeout for each ping request (in seconds) |
 
 
34
 
35
- ## Usage
36
 
37
- 1. Create a new Space with this code
38
- 2. Set the `ORG_NAME` environment variable to your hackathon org
39
- 3. The Space will automatically ping all Spaces in that org every 6 hours
40
- 4. Check the logs in the UI to verify everything is working
 
 
41
 
42
- ## Notes
43
 
44
- - For ZeroGPU Spaces, you may want to reduce `PING_INTERVAL_HOURS` to 3 or 4
45
- - The Space stores logs in `run_logs.json` (kept for last 100 runs)
46
- - Logs persist as long as the Space is running
 
 
 
11
  short_description: Keep MCP-birthday hackathon spaces availble
12
  ---
13
 
14
+ ---
15
+ title: Space Keeper
16
+ emoji: πŸ”„
17
+ colorFrom: blue
18
+ colorTo: green
19
+ sdk: gradio
20
+ sdk_version: 4.44.0
21
+ app_file: app.py
22
+ pinned: false
23
+ ---
24
+
25
+ # πŸ”„ Space Keeper v2
26
 
27
  Keeps HuggingFace Spaces alive during hackathon evaluation by pinging them on a schedule.
28
 
29
+ ## Features
30
+
31
+ - **Live Progress** β€” See real-time updates as Spaces are being pinged
32
+ - **Parallel Pinging** β€” Pings 10 Spaces simultaneously for speed
33
+ - **Run History** β€” View logs of all past runs with success/failure counts
34
+ - **Auto-Scheduler** β€” Automatically runs every 12 hours (configurable)
35
+ - **Statistics** β€” Track total pings, success rates, and uptime
36
 
37
+ ## How It Works
38
+
39
+ 1. **Manual Run:** Click "πŸš€ Run Now" to immediately ping all Spaces
40
+ 2. **Scheduled Run:** A background thread automatically runs every N hours
41
+ 3. **What happens:** For each Space, we send an HTTP GET to wake it up
42
+
43
+ ### Important: Scheduler Limitations
44
+
45
+ The scheduler runs as a background thread. **If this Space sleeps, the scheduler stops.**
46
+
47
+ To keep the scheduler running reliably:
48
+ - Visit this Space at least once every 48 hours, OR
49
+ - Set this Space to "Running" mode in settings (costs money)
50
 
51
  ## Configuration
52
 
 
54
 
55
  | Variable | Default | Description |
56
  |----------|---------|-------------|
57
+ | `ORG_NAME` | `MCP-1st-Birthday` | HuggingFace organization to monitor |
58
+ | `PING_INTERVAL_HOURS` | `12` | Hours between automatic runs |
59
+ | `PARALLEL_REQUESTS` | `10` | Spaces to ping simultaneously |
60
+ | `REQUEST_TIMEOUT` | `30` | Seconds before a ping times out |
61
+ | `HF_TOKEN` | *(optional)* | Only needed for private Spaces |
62
 
63
+ ## Files
64
 
65
+ ```
66
+ space-keeper-v2/
67
+ β”œβ”€β”€ app.py # Main application
68
+ β”œβ”€β”€ requirements.txt # Python dependencies
69
+ └── README.md # This file (also contains HF Space metadata)
70
+ ```
71
 
72
+ ## Usage
73
 
74
+ 1. Create a new Space at https://huggingface.co/new-space (SDK: Gradio)
75
+ 2. Upload all 3 files
76
+ 3. Optionally set `ORG_NAME` environment variable
77
+ 4. Click "πŸš€ Run Now" to test
78
+ 5. Keep the Space awake for automatic scheduling