Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions usecases_examples/PowerGrid/Dockerfile.api
Original file line number Diff line number Diff line change
@@ -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"]
2 changes: 1 addition & 1 deletion usecases_examples/PowerGrid/Dockerfile.app
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1

FROM python:3.9.1
FROM python:3.9-slim-bullseye
EXPOSE 5000

RUN mkdir /code
Expand Down
8 changes: 4 additions & 4 deletions usecases_examples/PowerGrid/PowerGrid_poc_simulator_consol.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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]

Expand Down
9 changes: 6 additions & 3 deletions usecases_examples/PowerGrid/config/API_POWERGRID_CAB.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
1 change: 0 additions & 1 deletion usecases_examples/PowerGrid/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.5"
services:
app:
build:
Expand Down
3 changes: 2 additions & 1 deletion usecases_examples/PowerGrid/requirements-api.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Flask==2.3.2
Flask==2.3.2
flask-cors