Spaces:
Runtime error
Runtime error
Delete DEPLOYMENT.md
Browse files- DEPLOYMENT.md +0 -121
DEPLOYMENT.md
DELETED
|
@@ -1,121 +0,0 @@
|
|
| 1 |
-
# Hugging Face Space Deployment Guide
|
| 2 |
-
|
| 3 |
-
## Quick Deployment Steps
|
| 4 |
-
|
| 5 |
-
### 1. Create a New Space
|
| 6 |
-
|
| 7 |
-
1. Visit https://huggingface.co/spaces
|
| 8 |
-
2. Click **"Create new Space"**
|
| 9 |
-
3. Configure:
|
| 10 |
-
- **Name**: Choose a unique name (e.g., `sec-financial-mcp`)
|
| 11 |
-
- **License**: MIT
|
| 12 |
-
- **SDK**: **Docker** ⚠️ Important!
|
| 13 |
-
- **Visibility**: Public or Private
|
| 14 |
-
|
| 15 |
-
### 2. Clone and Upload
|
| 16 |
-
|
| 17 |
-
```bash
|
| 18 |
-
# Clone your Space
|
| 19 |
-
git clone https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE_NAME
|
| 20 |
-
cd YOUR_SPACE_NAME
|
| 21 |
-
|
| 22 |
-
# Copy all project files
|
| 23 |
-
cp /path/to/EasyReportDateMCP/* .
|
| 24 |
-
|
| 25 |
-
# Commit and push
|
| 26 |
-
git add .
|
| 27 |
-
git commit -m "Initial deployment: SEC Financial MCP Server"
|
| 28 |
-
git push
|
| 29 |
-
```
|
| 30 |
-
|
| 31 |
-
### 3. Required Files
|
| 32 |
-
|
| 33 |
-
Make sure these files are in your Space repository:
|
| 34 |
-
|
| 35 |
-
```
|
| 36 |
-
✓ Dockerfile # Docker configuration
|
| 37 |
-
✓ mcp_server.py # FastAPI application
|
| 38 |
-
✓ edgar_client.py # EDGAR client
|
| 39 |
-
✓ requirements.txt # Dependencies
|
| 40 |
-
✓ README.md # Space description
|
| 41 |
-
✓ .gitignore # Git ignore rules
|
| 42 |
-
```
|
| 43 |
-
|
| 44 |
-
### 4. Wait for Build
|
| 45 |
-
|
| 46 |
-
Hugging Face will automatically build your Space (takes 3-5 minutes).
|
| 47 |
-
|
| 48 |
-
Monitor the build in the **"Logs"** tab.
|
| 49 |
-
|
| 50 |
-
### 5. Access Your API
|
| 51 |
-
|
| 52 |
-
Once deployed, your API will be available at:
|
| 53 |
-
|
| 54 |
-
```
|
| 55 |
-
https://YOUR_USERNAME-YOUR_SPACE_NAME.hf.space
|
| 56 |
-
```
|
| 57 |
-
|
| 58 |
-
**Interactive Documentation**:
|
| 59 |
-
- Swagger UI: `https://YOUR_USERNAME-YOUR_SPACE_NAME.hf.space/docs`
|
| 60 |
-
- ReDoc: `https://YOUR_USERNAME-YOUR_SPACE_NAME.hf.space/redoc`
|
| 61 |
-
|
| 62 |
-
## Testing Your Deployment
|
| 63 |
-
|
| 64 |
-
### Health Check
|
| 65 |
-
|
| 66 |
-
```bash
|
| 67 |
-
curl https://YOUR_USERNAME-YOUR_SPACE_NAME.hf.space/health
|
| 68 |
-
```
|
| 69 |
-
|
| 70 |
-
### Search Company
|
| 71 |
-
|
| 72 |
-
```bash
|
| 73 |
-
curl -X POST "https://YOUR_USERNAME-YOUR_SPACE_NAME.hf.space/api/search_company" \
|
| 74 |
-
-H "Content-Type: application/json" \
|
| 75 |
-
-d '{"company_name": "NVIDIA"}'
|
| 76 |
-
```
|
| 77 |
-
|
| 78 |
-
### Python Test
|
| 79 |
-
|
| 80 |
-
```python
|
| 81 |
-
import requests
|
| 82 |
-
|
| 83 |
-
BASE_URL = "https://YOUR_USERNAME-YOUR_SPACE_NAME.hf.space"
|
| 84 |
-
|
| 85 |
-
# Search company
|
| 86 |
-
response = requests.post(
|
| 87 |
-
f"{BASE_URL}/api/search_company",
|
| 88 |
-
json={"company_name": "NVIDIA"}
|
| 89 |
-
)
|
| 90 |
-
print(response.json())
|
| 91 |
-
```
|
| 92 |
-
|
| 93 |
-
## Troubleshooting
|
| 94 |
-
|
| 95 |
-
### Build Fails
|
| 96 |
-
- Check the **Logs** tab for errors
|
| 97 |
-
- Verify all files are present
|
| 98 |
-
- Ensure `Dockerfile` is correct
|
| 99 |
-
|
| 100 |
-
### Server Not Responding
|
| 101 |
-
- Check if build completed successfully
|
| 102 |
-
- Verify port 7860 is exposed in Dockerfile
|
| 103 |
-
- Check application logs in Logs tab
|
| 104 |
-
|
| 105 |
-
### API Errors
|
| 106 |
-
- Test with Swagger UI at `/docs`
|
| 107 |
-
- Check request JSON format
|
| 108 |
-
- Review error messages in response
|
| 109 |
-
|
| 110 |
-
## Notes
|
| 111 |
-
|
| 112 |
-
- Free Spaces sleep after 48 hours of inactivity
|
| 113 |
-
- Port 7860 is standard for Hugging Face Spaces
|
| 114 |
-
- Docker SDK is required for this deployment
|
| 115 |
-
- All API endpoints use POST method except `/health`
|
| 116 |
-
|
| 117 |
-
## Support
|
| 118 |
-
|
| 119 |
-
- Documentation: See `API_USAGE.md`
|
| 120 |
-
- Interactive Testing: Visit `/docs` after deployment
|
| 121 |
-
- Hugging Face Docs: https://huggingface.co/docs/hub/spaces
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|