-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrender.yaml
More file actions
57 lines (52 loc) · 1.97 KB
/
render.yaml
File metadata and controls
57 lines (52 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
services:
# Backend service - Using Python runtime for full build and start command support
- type: web
name: backdoor-ai-backend
env: python
buildCommand: |
# Install backend dependencies
pip install -r backend/requirements.txt
echo "===== BUILD STAGE (Free Tier) ====="
# Create only the essential model directory for memory efficiency
mkdir -p /tmp/model
# Enable remote model server mode
export USE_REMOTE_MODEL_SERVER=true
export REMOTE_MODEL_SERVER_URL=${REMOTE_MODEL_SERVER_URL}
export REMOTE_MODEL_SERVER_API_KEY=${REMOTE_MODEL_SERVER_API_KEY}
echo "===== BUILD COMPLETE ====="
startCommand: |
echo "===== STARTING APPLICATION (Free Tier) ====="
# Ensure model path is set correctly
export MODEL_DATA_PATH=/tmp/model
echo "MODEL_DATA_PATH set to $MODEL_DATA_PATH"
# Enable remote model server for offloading model to external service
export USE_REMOTE_MODEL_SERVER=true
echo "Remote model server enabled for offloading model to external service"
# Start the application
cd backend
python -m uvicorn app.main:app --host 0.0.0.0 --port $PORT
plan: free
envVars:
- key: ENVIRONMENT
value: production
- key: LOG_LEVEL
value: info
# Use /tmp/model for Free Tier compatibility
- key: MODEL_DATA_PATH
value: /tmp/model
# Flag to indicate we're running on Render
- key: RUNNING_ON_RENDER
value: "true"
# Enable memory-saving mode to avoid redundant model copies
- key: MINIMIZE_MEMORY_USAGE
value: "true"
# Enable remote model server for offloading model to external service
- key: USE_REMOTE_MODEL_SERVER
value: "true"
# Remote model server URL
- key: REMOTE_MODEL_SERVER_URL
sync: false
# Remote model server API key
- key: REMOTE_MODEL_SERVER_API_KEY
sync: false
healthCheckPath: /