Skip to content
Draft
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* text=auto
*.sh text eol=lf
*.conf text eol=lf
*.bash text eol=lf
*.yml text eol=lf
33 changes: 18 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ The platform uses the project **OperatorFabric** for notification management.
### Prerequisites

- [Git (version 2.40.1)](https://git-scm.com/)
- [Docker (version 24.0.2)](https://www.docker.com/)
- [Docker Compose (version 1.25.0 or later)](https://www.docker.com/)
- [Docker Engine (version 27)](https://www.docker.com/)
- [Docker Compose V2](https://www.docker.com/)


### Setting Up the Environment
Expand All @@ -63,7 +63,7 @@ Below are the steps to start all services. For other methods, please consult the

### Running All Services (Dev Mode)

1. Set-up environement variables
1. **Set-up environement variables**


`VITE_POWERGRID_SIMU`, `VITE_RAILWAY_SIMU` , `VITE_ATM_SIMU` are the simulators' endpoints.
Expand All @@ -79,31 +79,34 @@ export VITE_ATM_SIMU=http://[Service url]:[Service port]
> **_NOTE:_** For this step, you should already have a running simulator. If not, you can use the simulator we provided as an example. For this, please follow the tutorial provided in InteractiveAI/usecases_examples/PowerGrid/ then set the VITE_POWERGRID_SIMU variable to http://YOUR_SERVER_ADDRESS:5100/
>
>
2. Run InteractiveAI assistant
2. **Run InteractiveAI assistant**
```sh
cd config/dev/cab-standalone
./docker-compose.sh
```
> **_NOTE:_** You will see the word cab (Cockpit Assistant Bidirectionnel) on most files in the project. Note that it was the initial project name of InteractiveAI. Might be updated later.

3. Setting up Keycloak `Frontend URL`
* **Access Keycloak Interface**:
3. **Setting up Keycloak `Frontend URL`**
* Access Keycloak Interface:
- Ensure that your Keycloak instance is running and accessible.
- Open a web browser and navigate to the Keycloak admin console, typically available at `http://localhost:89/auth/admin`.
* **Login to Keycloak Admin Console**:
* Login to Keycloak Admin Console:
- Log in to the Keycloak admin console using your administrator credentials (`admin:admin` by default)
* **Navigate to Client Settings**:
* Configure frontendUrl:
- On the Keycloak admin console, locate and click on the "Realm Settings" section.
- In the Frontend URL setting, add the URL of your Assistant Platform frontend as a valid redirect URI. This URL is typically where your frontend application is hosted. For example, if your frontend is hosted locally for development purposes, you might add `http://localhost:3200/*`.
- After adding the frontend URL, save the changes to update the client settings.
* Configure Valid Redirect URIs:
- On the Keycloak admin console, locate and click on the "Clients" section.
- Select the client representing your Assistant Platform application.
* **Configure FrontendUrl**:
- Within the client settings, look for the "Valid Redirect URIs" or similar configuration field.
- Add the URL of your Assistant Platform frontend as a valid redirect URI. This URL is typically where your frontend application is hosted. For example, if your frontend is hosted locally for development purposes, you might add `http://localhost:3200/*`.
- Ensure that the frontend URL you specify matches the actual URL where your frontend application is accessible.
* **Save Changes**:
- After adding the frontend URL, save the changes to update the client settings.
- Add the URL of your Assistant Platform frontend, it should match the one used in the frontendUrl setting.
- After adding the Valid Redirect URIs, save the changes to update the client settings.


4. **Load resources**

4. Load resources
**WARINING:** You need to restart the frontend after updating the URL on keycloak do it before loading the resources.
**WARNING:** You need to restart the frontend after updating the URL on keycloak do it before loading the resources.
```sh
docker restart frontend
```
Expand Down
Empty file modified backend/capitalization-service/entrypoint.sh
100755 → 100644
Empty file.
Empty file modified backend/context-service/entrypoint.sh
100755 → 100644
Empty file.
Empty file modified backend/event-service/entrypoint.sh
100755 → 100644
Empty file.
Empty file modified backend/historic-service/entrypoint.sh
100755 → 100644
Empty file.
Empty file modified backend/recommendation-service/entrypoint.sh
100755 → 100644
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file modified backend/recommendation-service/start_service.bash
100755 → 100644
Empty file.
5 changes: 3 additions & 2 deletions config/dev/cab-keycloak/export/dev-realm.json
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@
"enabled": true,
"clientAuthenticatorType": "client-secret",
"secret": "opfab-keycloak-secret",
"redirectUris": ["http://localhost:3200/*", "http://localhost:4200/*", "http://localhost:2002/*"],
"redirectUris": ["http://localhost:3200/*", "http://localhost:4200/*", "http://localhost:2002/*", "http://127.0.0.1:3200/*"],
"webOrigins": [],
"notBefore": 0,
"bearerOnly": false,
Expand Down Expand Up @@ -1875,7 +1875,8 @@
"bruteForceProtected": "false",
"_browser_header.contentSecurityPolicy": "",
"waitIncrementSeconds": "60",
"offlineSessionMaxLifespanEnabled": "false"
"offlineSessionMaxLifespanEnabled": "false",
"frontendUrl": "http://127.0.0.1:3200/*"
},
"keycloakVersion": "6.0.1",
"userManagedAccessAllowed": false
Expand Down
Empty file modified config/dev/cab-keycloak/export/dev-users-0.json
100755 → 100644
Empty file.
Empty file modified config/dev/cab-standalone/config_host_ip.bash
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion config/dev/cab-standalone/docker-compose.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ fi
echo "HOST_IP=${HOST_IP}" >> .env

cat .env
docker-compose up -d
docker compose up -d
2 changes: 1 addition & 1 deletion config/dev/cab-standalone/nginx-cors-permissive.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# docker-compose DNS used to resolved keycloak services
# docker compose DNS used to resolved keycloak services
resolver 127.0.0.11 ipv6=off;
server {
listen 80;
Expand Down
2 changes: 1 addition & 1 deletion config/dev/cab-standalone/nginx-kubernetes.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# docker-compose DNS used to resolved users service
# docker compose DNS used to resolved users service
# resolver 127.0.0.11 ipv6=off;

# Log format to have msec in time + request processing time
Expand Down
2 changes: 1 addition & 1 deletion config/dev/cab-standalone/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# docker-compose DNS used to resolved users service
# docker compose DNS used to resolved users service
resolver 127.0.0.11 ipv6=off;

# Log format to have msec in time + request processing time
Expand Down
2 changes: 1 addition & 1 deletion config/dev/cab-standalone/stopOpfab.sh
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

docker-compose down -v
docker compose down -v
2 changes: 1 addition & 1 deletion config/dev/recommendation-service/docker-compose.bash
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ fi

echo "HOST_IP=${HOST_IP}" > .env

docker-compose -f "docker-compose-recommendation-service.yml" up --build
docker compose -f "docker-compose-recommendation-service.yml" up --build
2 changes: 1 addition & 1 deletion config/dev/recommendation-service/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# docker-compose DNS used to resolved keycloak services
# docker compose DNS used to resolved keycloak services
resolver 127.0.0.11 ipv6=off;
server {
listen 80;
Expand Down
35 changes: 34 additions & 1 deletion docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,39 @@

Are you having issues with setting up your environment? Here are some tips that might help.

## Ports already in use

InteractiveAI uses about twenty ports on server. If a port needed for InteractiveAI is already in use, InteractiveAI will fail (with messages in logs but the can be missed).
The script `resources/checkPorts.sh` tests the availability of each port specified in `config/dev/cab-standalone/docker-compose.yml` and write a diagnosis on console.

It it succeeds:
```
brettevi@PCAlien:~/Projets/InteractiveAI$ ./resources/checkPorts.sh
Ports used for InteractiveAI: 89 3200 5000 5100 5200 5400 5433 5434 5436 5437 5438 5500 12002 12100 12102 12103 12104 27017
All is fine: all ports used by InteractiveAI are available
```

If it fails:
```
brettevi@PCAlien:~/Projets/InteractiveAI$ ./resources/checkPorts.sh
Ports used for InteractiveAI: 89 3200 5000 5100 5200 5400 5433 5434 5436 5437 5438 5500 12002 12100 12102 12103 12104 27017
docker: Error response from daemon: driver failed programming external connectivity on endpoint stoic_williams (b69f8285b2ec63145267ad7ea04969cf58dc423528729c7c3f07b5d5c3ccc342): Bind for 0.0.0.0:89 failed: port is already allocated.
...
docker: Error response from daemon: driver failed programming external connectivity on endpoint zen_feistel (f3047f6ae4ebf5e78dc034137d24a832e2ff60490424ba8ba4ae2531d2222142): Bind for 0.0.0.0:12104 failed: port is already allocated.
docker: Error response from daemon: driver failed programming external connectivity on endpoint keen_swanson (82f2ac17d11057767379dc0f492b5a9b8fd7620fb562e8107e9ce1453e548052): Bind for 0.0.0.0:27017 failed: port is already allocated.
Check your counfiguration: 18 port(s) used by InteractiveAI are already used
InteractiveAI can't run on this platform with this /home/brettevi/Projets/InteractiveAI/config/dev/cab-standalone/docker-compose.yml ports configuration
```

This command may also be used with a specific docker-compose.yml file. For example, to test Powergrid simulator ports availability, one can use:
```
brettevi@PCAlien:~/Projets/InteractiveAI$ ./resources/checkPorts.sh usecases_examples/PowerGrid/docker-compose.yml
Ports used for InteractiveAI: 5150
docker: Error response from daemon: driver failed programming external connectivity on endpoint funny_rhodes (6291f43617a7798a833fdeee05c32c75c2d0bf765eac5dc3b8fe08b7255e57a1): Bind for 0.0.0.0:5150 failed: port is already allocated.
Check your counfiguration: 1 port(s) used by InteractiveAI are already used
InteractiveAI can't run on this platform with this usecases_examples/PowerGrid/docker-compose.yml ports configuration
```

## EoL Sequence Configuration errors.

Some users may encounter issues if their system is automatically converting end of line sequence from LF to CRLF.
Expand All @@ -18,6 +51,6 @@ The .env should contain:
HOST_IP=<IP_Address>
```

If the IP_Address is not your network IP address, please set it manually and run the system using native docker-compose commands.
If the IP_Address is not your network IP address, please set it manually and run the system using native docker compose commands.

> **_NOTE:_** You are welcome to contribute with any issue that you encounter during setup.
1 change: 0 additions & 1 deletion frontend/.dockerignore

This file was deleted.

1 change: 1 addition & 0 deletions frontend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.gitignore
Empty file modified frontend/.husky/commit-msg
100755 → 100644
Empty file.
Empty file modified frontend/.husky/pre-commit
100755 → 100644
Empty file.
Empty file modified frontend/.husky/pre-push
100755 → 100644
Empty file.
Empty file modified frontend/start-webui.sh
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion resources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pip install -r requirements-app.txt
3. For the Docker environment, use the provided docker-compose.yml and Dockerfile.
```
cd PowerGrid
docker-compose up -d --build
docker compose up -d --build
```

# 2 Run the simulator
Expand Down
Empty file modified resources/bundles/deleteAllBundles.sh
100755 → 100644
Empty file.
Empty file modified resources/bundles/deleteBundle.sh
100755 → 100644
Empty file.
Loading