Skip to content

Commit b2c247e

Browse files
authored
Merge pull request #16 from AI4REALNET/fix/usecase-build-fixes
Fix/usecase build fixes
2 parents a05bae3 + d38a8f1 commit b2c247e

File tree

8 files changed

+32
-18
lines changed

8 files changed

+32
-18
lines changed

frontend/src/entities/PowerGrid/CAB/Assistant.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<template #default="{ recommendation, index }">
2222
<div class="flex">
2323
<main>
24-
<h2>P{{ index }}: {{ recommendation.title }}</h2>
24+
<h2>R{{ index }}: {{ recommendation.title }}</h2>
2525
</main>
2626
</div>
2727
</template>
@@ -38,7 +38,7 @@
3838
v-for="(recommendation, index) of recommendations"
3939
:key="recommendation.title"
4040
:class="{ active: selected?.title === recommendation.title }">
41-
P{{ index }}
41+
R{{ index }}
4242
</th>
4343
</tr>
4444
</thead>

frontend/src/entities/PowerGrid/locales/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
"PowerGrid.kpis.redispatching_volume": "Redispatch volume",
1818
"PowerGrid.kpis.renewable_energy_share": "Proportion of renewable",
1919
"PowerGrid.kpis.total_consumption": "Total consumption",
20-
"PowerGrid.kpis.type": "Type of parade"
20+
"PowerGrid.kpis.type_of_the_reco": "Type of recommendation"
2121
}

usecases_examples/PowerGrid/Dockerfile.api

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
# syntax=docker/dockerfile:1
22

3-
FROM python:3.9.1
4-
EXPOSE 5000
3+
FROM python:3.9-slim-bullseye
4+
5+
6+
RUN apt-get update && apt-get install -y --no-install-recommends \
7+
ffmpeg libsm6 libxext6 \
8+
&& rm -rf /var/lib/apt/lists/*
9+
510

611
RUN mkdir /code
712
COPY . /code/
813
WORKDIR /code
914

10-
RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y
11-
RUN pip3 install -r requirements-app.txt
15+
# Install only API deps
16+
COPY requirements-api.txt /code/requirements-api.txt
17+
RUN pip install --no-cache-dir -r requirements-api.txt
18+
# Copy the rest
19+
COPY . /code
20+
EXPOSE 5000
21+
22+
# Use absolute path to avoid surprises if WORKDIR ever changes
23+
CMD ["python3", "/code/RecommendationAPI.py"]
1224

13-
CMD ["python3", "RecommendationAPI.py"]

usecases_examples/PowerGrid/Dockerfile.app

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# syntax=docker/dockerfile:1
22

3-
FROM python:3.9.1
3+
FROM python:3.9-slim-bullseye
44
EXPOSE 5000
55

66
RUN mkdir /code

usecases_examples/PowerGrid/PowerGrid_poc_simulator_consol.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ def __init__(self):
267267
"""Initialize the Communicate class for handling InteractiveAI API communication."""
268268
logging.info("COMMUNICATIONS' SETUP FOR THIS SESSION : \n")
269269
try:
270-
self.outputsConfig = toml.load("API_POWERGRID_CAB.toml")
270+
self.outputsConfig = toml.load("config/API_POWERGRID_CAB.toml")
271271
if self.outputsConfig['Outputs']['activate'] == 'yes':
272272
self.CAB_API_on = True
273273
else:
@@ -581,8 +581,8 @@ def send_event_online(self,
581581
payload_dict = {}
582582
payload_dict = {
583583
"criticality": "ROUTINE",
584-
"title": f"Ligne {line_name} déconnectée",
585-
"description": f"La ligne {line_name} est déconnectée",
584+
"title": f"Line {line_name} disconnected",
585+
"description": f"Line {line_name} is disconnected",
586586
"start_date": f"{context_date}",
587587
"end_date": f"{context_date + timedelta(minutes=float(5))}",
588588
"data": {
@@ -961,7 +961,7 @@ def run_simulator():
961961

962962
try:
963963
# Load simulation configuration
964-
config = toml.load("CONFIG.toml")
964+
config = toml.load("config/CONFIG.toml")
965965

966966
forecasts_horizons = [5, 10, 15, 20, 25, 30]
967967

usecases_examples/PowerGrid/config/API_POWERGRID_CAB.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@ titre = "API PowerGrid - InteractiveAI"
22

33
[Connexion]
44
login_port = "auth/token"
5-
cab_server_url_1 = "http://frontend.cab-dev.irtsystemx.org/"
5+
cab_server_url_1 = "http://192.168.210.100:3200/"
66
cab_server_url_2 = "http://192.168.211.95:3200/"
7-
cab_server_url_3 = "http://192.168.208.57:3200/"
7+
cab_server_url_3 = "http://192.168.209.192:3200/"
8+
cab_server_url_4 = "http://192.168.209.192:3200/"
9+
cab_server_url_5 = "http://192.168.209.192:3200/"
10+
cab_server_url_6 = "http://192.168.208.118:3200/"
811

912
[Outputs]
1013
activate = "yes"
@@ -17,4 +20,4 @@ context_port = "cabcontext/api/v1/contexts"
1720
tempo = 30
1821

1922
[Inputs.Act]
20-
url = "http://192.168.209.166:5100/api/v1/recommendations"
23+
url = "http://192.168.210.160:5100/api/v1/recommendations"

usecases_examples/PowerGrid/docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
version: "3.5"
21
services:
32
app:
43
build:
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
Flask==2.3.2
1+
Flask==2.3.2
2+
flask-cors

0 commit comments

Comments
 (0)