sarveshpatel commited on
Commit
2c6652e
·
verified ·
1 Parent(s): 28c171b

Create scripts/start.sh

Browse files
Files changed (1) hide show
  1. scripts/start.sh +23 -0
scripts/start.sh ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ echo "Starting MCP Code Executor on Hugging Face Spaces..."
5
+ echo "Environment Type: ${ENV_TYPE:-venv-uv}"
6
+ echo "Code Storage Dir: ${CODE_STORAGE_DIR:-/app/code_storage}"
7
+ echo "Workers: ${WORKERS:-4}"
8
+ echo "Max Concurrent Executions: ${MAX_CONCURRENT_EXECUTIONS:-20}"
9
+
10
+ # Ensure code storage directory exists
11
+ mkdir -p "${CODE_STORAGE_DIR:-/app/code_storage}"
12
+
13
+ # Start uvicorn with optimal settings for HF Spaces
14
+ exec uvicorn app.main:app \
15
+ --host 0.0.0.0 \
16
+ --port 7860 \
17
+ --workers "${WORKERS:-4}" \
18
+ --loop uvloop \
19
+ --http httptools \
20
+ --limit-concurrency "${MAX_CONCURRENT_EXECUTIONS:-20}" \
21
+ --timeout-keep-alive 65 \
22
+ --access-log \
23
+ --log-level info