Commit
·
abefa1d
1
Parent(s):
4a5dfa2
api changes
Browse files- Dockerfile +1 -1
- api/greedyoptim_api.py +1 -1
- api/run_greedyoptim_api.py +0 -42
- docker-compose.yml +0 -23
Dockerfile
CHANGED
|
@@ -24,4 +24,4 @@ HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|
| 24 |
CMD python -c "import requests; requests.get('http://localhost:7860/health')"
|
| 25 |
|
| 26 |
# Run the application
|
| 27 |
-
CMD ["uvicorn", "
|
|
|
|
| 24 |
CMD python -c "import requests; requests.get('http://localhost:7860/health')"
|
| 25 |
|
| 26 |
# Run the application
|
| 27 |
+
CMD ["uvicorn", "api.greedyoptim_api:app", "--host", "0.0.0.0", "--port", "7860"]
|
api/greedyoptim_api.py
CHANGED
|
@@ -571,4 +571,4 @@ async def validate_data(request: ScheduleOptimizationRequest):
|
|
| 571 |
|
| 572 |
if __name__ == "__main__":
|
| 573 |
import uvicorn
|
| 574 |
-
uvicorn.run(app, host="0.0.0.0", port=
|
|
|
|
| 571 |
|
| 572 |
if __name__ == "__main__":
|
| 573 |
import uvicorn
|
| 574 |
+
uvicorn.run(app, host="0.0.0.0", port=7860)
|
api/run_greedyoptim_api.py
DELETED
|
@@ -1,42 +0,0 @@
|
|
| 1 |
-
#!/usr/bin/env python3
|
| 2 |
-
"""
|
| 3 |
-
Startup script for GreedyOptim API
|
| 4 |
-
Run this to start the advanced optimization API service
|
| 5 |
-
"""
|
| 6 |
-
import sys
|
| 7 |
-
import os
|
| 8 |
-
|
| 9 |
-
# Add parent directory to path
|
| 10 |
-
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
| 11 |
-
|
| 12 |
-
if __name__ == "__main__":
|
| 13 |
-
import uvicorn
|
| 14 |
-
|
| 15 |
-
print("=" * 70)
|
| 16 |
-
print("GreedyOptim Scheduling API")
|
| 17 |
-
print("=" * 70)
|
| 18 |
-
print()
|
| 19 |
-
print("Starting FastAPI server on port 8001...")
|
| 20 |
-
print()
|
| 21 |
-
print("API Documentation: http://localhost:8001/docs")
|
| 22 |
-
print("Alternative Docs: http://localhost:8001/redoc")
|
| 23 |
-
print("Health Check: http://localhost:8001/health")
|
| 24 |
-
print("Available Methods: http://localhost:8001/methods")
|
| 25 |
-
print()
|
| 26 |
-
print("Main Endpoints:")
|
| 27 |
-
print(" POST /optimize - Optimize with custom data")
|
| 28 |
-
print(" POST /compare - Compare multiple methods")
|
| 29 |
-
print(" POST /generate-synthetic - Generate test data")
|
| 30 |
-
print(" POST /validate - Validate data structure")
|
| 31 |
-
print()
|
| 32 |
-
print("=" * 70)
|
| 33 |
-
print()
|
| 34 |
-
|
| 35 |
-
# Run the API
|
| 36 |
-
uvicorn.run(
|
| 37 |
-
"api.greedyoptim_api:app",
|
| 38 |
-
host="0.0.0.0",
|
| 39 |
-
port=8001,
|
| 40 |
-
reload=True,
|
| 41 |
-
log_level="info"
|
| 42 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
docker-compose.yml
DELETED
|
@@ -1,23 +0,0 @@
|
|
| 1 |
-
# Docker Compose for Metro Train Scheduling System
|
| 2 |
-
version: '3.8'
|
| 3 |
-
|
| 4 |
-
services:
|
| 5 |
-
api:
|
| 6 |
-
build: .
|
| 7 |
-
container_name: metro-scheduler-api
|
| 8 |
-
ports:
|
| 9 |
-
- "8000:8000"
|
| 10 |
-
environment:
|
| 11 |
-
- PYTHONUNBUFFERED=1
|
| 12 |
-
volumes:
|
| 13 |
-
- ./logs:/app/logs
|
| 14 |
-
restart: unless-stopped
|
| 15 |
-
healthcheck:
|
| 16 |
-
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
| 17 |
-
interval: 30s
|
| 18 |
-
timeout: 3s
|
| 19 |
-
retries: 3
|
| 20 |
-
start_period: 10s
|
| 21 |
-
|
| 22 |
-
volumes:
|
| 23 |
-
logs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|