Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BAIP-260/update docker compose #40

Merged
merged 3 commits into from
Jul 16, 2024
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
58 changes: 42 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,34 @@ It's intended to simplify development for [Fleet] and The Autonomy developers.

The system can be used by docker compose stored at the git root of this repository.

There are multiple containers
There are multiple containers:

- VerneMQ MQTT broker (bringauto/vernemq)
- Virtual Vehicle Utility - Mission module client implementation (it connects to Module Gateway and simulates a Mission
module's autonomy device)
- Virtual Vehicle - Mission module client implementation (it connects to Module Gateway and simulates a Mission module's autonomy device)
- Virtual PLC - IO module client
- Module Gateway - cpp implementation of Module Gateway with Mission, IO and example module support
- External server - server implementation with Mission, IO and example module support
- HTTP API Server - tool for communication with final endpoint, used by mission module
- Integration layer - a bridge between the HTTP API and the Fleet Management API
- Fleet Management API - an API that handles creating orders for cars and displaying their state
- Virtual Fleet Management - application simulating Fleet Management. It creates orders for cars.
- PostgreSQL database - storage of the HTTP API api keys and the messages sent via the API
- PostgreSQL database - storage of the HTTP API keys and the messages sent via the API
- Mission Module Display Tool - a simple web server to display the positions of vehicles on a map

## Container Repositories

Below are the links to the repositories of the containers. Most of the containers are public on GitHub, but some are private.

- [VerneMQ docker repository](https://github.com/bringauto/vernemq-docker)
- [VerneMQ repository](https://github.com/bringauto/vernemq)
- [Virtual Vehicle repository](https://github.com/bringauto/virtual-vehicle)
- [Virtual PLC repository](https://gitlab.bringauto.com/bring-auto/hardware/firmware/virtual-plc-arduino-opta)
- [Module Gateway repository](https://github.com/bringauto/module-gateway)
- [External Server repository](https://github.com/bringauto/external-server)
- [HTTP API repository](https://github.com/bringauto/fleet-protocol-http-api)
- [Fleet Management API repository](https://github.com/bringauto/fleet-management-http-client-go)
- [Virtual Fleet Management repository](https://github.com/bringauto/virtual-fleet-management)
- [Mission Module Display Tool repository](https://github.com/bringauto/mission-module-display-tool)

## Fleet Protocol

Expand Down Expand Up @@ -46,18 +61,29 @@ To use Fleet Protocol v1, use the latest v1 release on [GitHub](https://github.c

Docker compose file has multiple profiles so the developer can disable/enable parts of the system he needs

- all - start all containers including MQTT, virtual vehicle, daemon, and virtual fleet
- without-module-gateway - do not start Module Gateway
- without-external-server - do not start External Server
- without-devices - do not start internal clients
- without-fleet-management - do not start Virtual Fleet Management
- core - start only internal clients and Module Gateway
- virtual-vehicle-utility - start only Virtual Vehicle Utility
- virtual-plc - start only Virtual PLC
- mqtt - start only MQTT vernemq broker
- module-gateway - start only Module Gateway
- http-api - start fleet protocol HTTP API server and the related PostgreSQL database
- for-virtual-fleet - start fleet protocol HTTP API server, the related PostgreSQL database, fleet management integration layer, virtual fleet management, fleet management HTTP API server and mission module display tool
### Docker compose profiles

#### Profiles that start logical groups of containers

- **all** - start all containers
- **for-virtual-fleet** - start the fleet protocol HTTP API server, the related PostgreSQL database, the fleet management integration layer, virtual fleet management, the fleet management HTTP API server and the mission module display tool
- **core** - start only internal clients and Module Gateway
- **http-api** - start fleet protocol HTTP API server and the related PostgreSQL database

#### Profiles that start all containers except the ones specified

- **without-module-gateway** - do not start Module Gateway
- **without-external-server** - do not start External Server
- **without-devices** - do not start internal clients
- **without-fleet-management** - do not start Virtual Fleet Management

#### Profiles that start only one container

- **virtual-vehicle** - start only the Virtual Vehicle
- **virtual-plc** - start only the Virtual PLC
- **mqtt** - start only the MQTT vernemq broker
- **module-gateway** - start only the Module Gateway
- **external-server** - start only the External Server

Now you can run `docker compose --profile <profile> up` where `profile` is the name of the profile above.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@
"stops": [
{
"name": "Svatopluka Čecha A"
},
{
"name": "Těšínská"
}
],
"route": "Moravské náměstí 2"
},
{
"delay_seconds": 80,
"delay_seconds": 220,
"name": "mission2",
"stops": [
{
Expand All @@ -32,7 +35,7 @@
"route": "Roundabout long"
},
{
"delay_seconds": 240,
"delay_seconds": 260,
"name": "mission3",
"stops": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@
"stops": [
{
"name": "Svatopluka Čecha A"
},
{
"name": "Těšínská"
}
],
"route": "Moravské náměstí 2"
},
{
"delay_seconds": 10,
"delay_seconds": 220,
"name": "mission2",
"stops": [
{
Expand All @@ -32,7 +35,7 @@
"route": "Roundabout long"
},
{
"delay_seconds": 20,
"delay_seconds": 260,
"name": "mission3",
"stops": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@
"starting_station": "Těšínská",
"missions": [
{
"delay_seconds": 10,
"delay_seconds": 0,
"name": "mission1",
"stops": [
{
"name": "Svatopluka Čecha A"
},
{
"name": "Těšínská"
}
],
"route": "Moravské náměstí 2"
},
{
"delay_seconds": 30,
"delay_seconds": 220,
"name": "mission2",
"stops": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@
"starting_station": "Těšínská",
"missions": [
{
"delay_seconds": 10,
"delay_seconds": 0,
"name": "mission1",
"stops": [
{
"name": "Svatopluka Čecha A"
},
{
"name": "Těšínská"
}
],
"route": "Moravské náměstí 2"
},
{
"delay_seconds": 20,
"delay_seconds": 260,
"name": "mission3",
"stops": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"starting_station": "Těšínská",
"missions": [
{
"delay_seconds": 20,
"delay_seconds": 0,
"name": "mission2",
"stops": [
{
Expand All @@ -22,7 +22,7 @@
"route": "Roundabout long"
},
{
"delay_seconds": 10,
"delay_seconds": 260,
"name": "mission3",
"stops": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
"starting_station": "Těšínská",
"missions": [
{
"delay_seconds": 10,
"delay_seconds": 0,
"name": "mission1",
"stops": [
{
"name": "Svatopluka Čecha A"
},
{
"name": "Těšínská"
}
],
"route": "Moravské náměstí 2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"starting_station": "Těšínská",
"missions": [
{
"delay_seconds": 10,
"delay_seconds": 0,
"name": "mission3",
"stops": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"starting_station": "Těšínská",
"missions": [
{
"delay_seconds": 10,
"delay_seconds": 0,
"name": "mission2",
"stops": [
{
Expand Down
2 changes: 1 addition & 1 deletion configuration/virtual-vehicle-utility/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"simulation-settings": {
"speed-override": true,
"speed-override-mps": 5,
"wait-at-stop-s": 30
"wait-at-stop-s": 10
}
},
"fleet-settings": {
Expand Down
20 changes: 10 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version: '3'
services:
virtual-vehicle-utility:
image: bringauto/virtual-vehicle-utility:v3.1.4
profiles: ["all", "without-module-gateway", "without-external-server", "core", "virtual-vehicle-utility", "without-fleet-management"]
virtual-vehicle:
image: bringauto/virtual-vehicle:v3.1.6
profiles: ["all", "without-module-gateway", "without-external-server", "core", "virtual-vehicle", "without-fleet-management"]
volumes:
- ./docker_volumes/virtual-vehicle-utility:/virtual-vehicle-utility/log
- ./configuration/virtual-vehicle-utility:/virtual-vehicle-utility/config
Expand Down Expand Up @@ -54,7 +54,7 @@ services:

external-server:
image: bringauto/external-server:v1.1.9
profiles: ["all", "without-devices", "without-module-gateway", "without-fleet-management"]
profiles: ["all", "without-devices", "without-module-gateway", "without-fleet-management", "external_server"]
volumes:
- ./docker_volumes/external-server:/home/bringauto/log
- ./configuration/external-server:/home/bringauto/config/
Expand All @@ -67,7 +67,7 @@ services:

http-api:
image: bringauto/fleet-protocol-http-api:v2.4.2
profiles: ["all", "without-devices", "without-module-gateway", "http-api", "without-fleet-management", "for-virtual-fleet"]
profiles: ["all", "without-devices", "without-module-gateway", "without-external-server", "http-api", "without-fleet-management", "for-virtual-fleet"]
ports:
- 8080:8080
restart: "no"
Expand All @@ -85,7 +85,7 @@ services:

integration-layer:
image: bringauto/fleet-management-integration-layer:v2.0.2
profiles: ["all", "without-devices", "without-module-gateway", "without-fleet-management", "for-virtual-fleet"]
profiles: ["all", "without-devices", "without-module-gateway", "without-external-server", "without-fleet-management", "for-virtual-fleet"]
restart: "no"
networks:
- bring-emulator
Expand All @@ -97,7 +97,7 @@ services:

management-api:
image: bringauto/fleet-management-http-api:v3.1.6
profiles: ["all", "without-devices", "without-module-gateway", "management-api", "without-fleet-management", "for-virtual-fleet"]
profiles: ["all", "without-devices", "without-module-gateway", "without-external-server", "management-api", "without-fleet-management", "for-virtual-fleet"]
ports:
- 8081:8081
restart: "no"
Expand All @@ -115,7 +115,7 @@ services:

virtual-fleet-management:
image: bringauto/virtual-fleet-management:v3.0.1
profiles: ["all", "without-devices", "without-module-gateway", "for-virtual-fleet"]
profiles: ["all", "without-devices", "without-module-gateway", "without-external-server", "for-virtual-fleet"]
restart: "no"
depends_on:
management-api:
Expand All @@ -133,7 +133,7 @@ services:

postgresql-database:
image: postgres:16
profiles: ["all", "without-devices", "without-module-gateway", "http-api", "management-api", "without-fleet-management", "for-virtual-fleet"]
profiles: ["all", "without-devices", "without-module-gateway", "without-external-server", "http-api", "management-api", "without-fleet-management", "for-virtual-fleet"]
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: 1234
Expand All @@ -149,7 +149,7 @@ services:

mission_module_display_tool:
image: bringauto/mission-module-display-tool:v1.0.0
profiles: ["all", "without-devices", "without-module-gateway", "without-fleet-management", "for-virtual-fleet"]
profiles: ["all", "without-devices", "without-module-gateway", "without-external-server", "without-fleet-management", "for-virtual-fleet", ]
restart: "no"
ports:
- 5000:5000
Expand Down