tweaks to support running in docker
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import requests
|
||||
|
||||
class IaaSClient:
|
||||
def __init__(self, api_key, base_url="http://localhost:5000/api"):
|
||||
def __init__(self, api_key, base_url="http://172.17.0.1:5000/api"):
|
||||
self.base_url = base_url
|
||||
self.api_key = api_key
|
||||
|
||||
|
||||
+3
-3
@@ -14,11 +14,11 @@ from app.utils.standard_responses import api_response
|
||||
app: Flask = Flask(__name__) # same as before
|
||||
app.config.update(
|
||||
SQLALCHEMY_DATABASE_URI="mysql://root:password@172.17.0.1:3306/theapi",
|
||||
WEBSOCKET_SERVER_URL="http://127.0.0.1:6001/api/create_task",
|
||||
WEBSOCKET_SERVER_URL="http://172.17.0.1:6001/api/create_task",
|
||||
|
||||
# New – Celery settings (override via ENV)
|
||||
CELERY_BROKER_URL="redis://localhost:6379/0",
|
||||
CELERY_RESULT_BACKEND="redis://localhost:6379/1",
|
||||
CELERY_BROKER_URL="redis://172.17.0.1:6379/0",
|
||||
CELERY_RESULT_BACKEND="redis://172.17.0.1:6379/1",
|
||||
)
|
||||
pymysql.install_as_MySQLdb()
|
||||
|
||||
|
||||
+2
-1
@@ -36,4 +36,5 @@ celery.conf.beat_schedule.update(
|
||||
|
||||
# The export below keeps your old import paths valid:
|
||||
__all__ = ["celery"]
|
||||
import app.tasks.container_workload # noqa: E402,F401
|
||||
import app.tasks.container_workload
|
||||
import app.tasks.simple
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
source .venv/bin/activate
|
||||
cd worker
|
||||
python3 main.py
|
||||
@@ -10,7 +10,7 @@ from sqlalchemy.orm import sessionmaker, declarative_base
|
||||
import pymysql
|
||||
|
||||
# Redis configuration
|
||||
REDIS_HOST = "localhost"
|
||||
REDIS_HOST = "172.17.0.1"
|
||||
REDIS_PORT = 6379
|
||||
|
||||
# Database configuration
|
||||
|
||||
@@ -11,7 +11,7 @@ from websocket_server.shared_state import connected_workers, worker_lock
|
||||
logger = logging.getLogger("websocket_server")
|
||||
|
||||
# API server endpoint
|
||||
api_server_url = "http://127.0.0.1:5000/api"
|
||||
api_server_url = "http://172.17.0.1:5000/api"
|
||||
|
||||
# Tracks threads for each worker
|
||||
worker_threads = {}
|
||||
|
||||
Reference in New Issue
Block a user