diff --git a/frontend/src/entities/PowerGrid/CAB/Assistant.vue b/frontend/src/entities/PowerGrid/CAB/Assistant.vue index 0d382923..37ac05fc 100644 --- a/frontend/src/entities/PowerGrid/CAB/Assistant.vue +++ b/frontend/src/entities/PowerGrid/CAB/Assistant.vue @@ -21,7 +21,7 @@ @@ -38,7 +38,7 @@ v-for="(recommendation, index) of recommendations" :key="recommendation.title" :class="{ active: selected?.title === recommendation.title }"> - P{{ index }} + R{{ index }} diff --git a/frontend/src/entities/PowerGrid/locales/en.json b/frontend/src/entities/PowerGrid/locales/en.json index 43a25940..e11cecd4 100644 --- a/frontend/src/entities/PowerGrid/locales/en.json +++ b/frontend/src/entities/PowerGrid/locales/en.json @@ -17,5 +17,5 @@ "PowerGrid.kpis.redispatching_volume": "Redispatch volume", "PowerGrid.kpis.renewable_energy_share": "Proportion of renewable", "PowerGrid.kpis.total_consumption": "Total consumption", - "PowerGrid.kpis.type": "Type of parade" + "PowerGrid.kpis.type_of_the_reco": "Type of recommendation" } diff --git a/usecases_examples/PowerGrid/Dockerfile.api b/usecases_examples/PowerGrid/Dockerfile.api index 917e9109..260479d6 100644 --- a/usecases_examples/PowerGrid/Dockerfile.api +++ b/usecases_examples/PowerGrid/Dockerfile.api @@ -1,13 +1,24 @@ # syntax=docker/dockerfile:1 -FROM python:3.9.1 -EXPOSE 5000 +FROM python:3.9-slim-bullseye + + +RUN apt-get update && apt-get install -y --no-install-recommends \ + ffmpeg libsm6 libxext6 \ + && rm -rf /var/lib/apt/lists/* + RUN mkdir /code COPY . /code/ WORKDIR /code -RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y -RUN pip3 install -r requirements-app.txt +# Install only API deps +COPY requirements-api.txt /code/requirements-api.txt +RUN pip install --no-cache-dir -r requirements-api.txt +# Copy the rest +COPY . /code +EXPOSE 5000 + +# Use absolute path to avoid surprises if WORKDIR ever changes +CMD ["python3", "/code/RecommendationAPI.py"] -CMD ["python3", "RecommendationAPI.py"] diff --git a/usecases_examples/PowerGrid/Dockerfile.app b/usecases_examples/PowerGrid/Dockerfile.app index 4386693b..782ea872 100644 --- a/usecases_examples/PowerGrid/Dockerfile.app +++ b/usecases_examples/PowerGrid/Dockerfile.app @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 -FROM python:3.9.1 +FROM python:3.9-slim-bullseye EXPOSE 5000 RUN mkdir /code diff --git a/usecases_examples/PowerGrid/PowerGrid_poc_simulator_consol.py b/usecases_examples/PowerGrid/PowerGrid_poc_simulator_consol.py index 7c6d36d9..a323a016 100644 --- a/usecases_examples/PowerGrid/PowerGrid_poc_simulator_consol.py +++ b/usecases_examples/PowerGrid/PowerGrid_poc_simulator_consol.py @@ -267,7 +267,7 @@ def __init__(self): """Initialize the Communicate class for handling InteractiveAI API communication.""" logging.info("COMMUNICATIONS' SETUP FOR THIS SESSION : \n") try: - self.outputsConfig = toml.load("API_POWERGRID_CAB.toml") + self.outputsConfig = toml.load("config/API_POWERGRID_CAB.toml") if self.outputsConfig['Outputs']['activate'] == 'yes': self.CAB_API_on = True else: @@ -581,8 +581,8 @@ def send_event_online(self, payload_dict = {} payload_dict = { "criticality": "ROUTINE", - "title": f"Ligne {line_name} déconnectée", - "description": f"La ligne {line_name} est déconnectée", + "title": f"Line {line_name} disconnected", + "description": f"Line {line_name} is disconnected", "start_date": f"{context_date}", "end_date": f"{context_date + timedelta(minutes=float(5))}", "data": { @@ -961,7 +961,7 @@ def run_simulator(): try: # Load simulation configuration - config = toml.load("CONFIG.toml") + config = toml.load("config/CONFIG.toml") forecasts_horizons = [5, 10, 15, 20, 25, 30] diff --git a/usecases_examples/PowerGrid/config/API_POWERGRID_CAB.toml b/usecases_examples/PowerGrid/config/API_POWERGRID_CAB.toml index 7fb73969..2277b5c5 100644 --- a/usecases_examples/PowerGrid/config/API_POWERGRID_CAB.toml +++ b/usecases_examples/PowerGrid/config/API_POWERGRID_CAB.toml @@ -2,9 +2,12 @@ titre = "API PowerGrid - InteractiveAI" [Connexion] login_port = "auth/token" -cab_server_url_1 = "http://frontend.cab-dev.irtsystemx.org/" +cab_server_url_1 = "http://192.168.210.100:3200/" cab_server_url_2 = "http://192.168.211.95:3200/" -cab_server_url_3 = "http://192.168.208.57:3200/" +cab_server_url_3 = "http://192.168.209.192:3200/" +cab_server_url_4 = "http://192.168.209.192:3200/" +cab_server_url_5 = "http://192.168.209.192:3200/" +cab_server_url_6 = "http://192.168.208.118:3200/" [Outputs] activate = "yes" @@ -17,4 +20,4 @@ context_port = "cabcontext/api/v1/contexts" tempo = 30 [Inputs.Act] -url = "http://192.168.209.166:5100/api/v1/recommendations" +url = "http://192.168.210.160:5100/api/v1/recommendations" diff --git a/usecases_examples/PowerGrid/docker-compose.yml b/usecases_examples/PowerGrid/docker-compose.yml index 2608c16a..e9b0ea20 100644 --- a/usecases_examples/PowerGrid/docker-compose.yml +++ b/usecases_examples/PowerGrid/docker-compose.yml @@ -1,4 +1,3 @@ -version: "3.5" services: app: build: diff --git a/usecases_examples/PowerGrid/requirements-api.txt b/usecases_examples/PowerGrid/requirements-api.txt index 7883f5be..ecb42322 100644 --- a/usecases_examples/PowerGrid/requirements-api.txt +++ b/usecases_examples/PowerGrid/requirements-api.txt @@ -1 +1,2 @@ -Flask==2.3.2 \ No newline at end of file +Flask==2.3.2 +flask-cors \ No newline at end of file