Skip to content

Commit

Permalink
Set addresses in respective env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
BjoernAtBosch committed Mar 19, 2024
1 parent 6666b52 commit 1989742
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
6 changes: 3 additions & 3 deletions runtime.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
},
{
"key": "env",
"value": "VEHICLEDATABROKER_DAPR_APP_ID=vehicledatabroker"
"value": "BROKER_ADDR=localhost:55555"
},
{
"key": "env",
Expand Down Expand Up @@ -131,7 +131,7 @@
},
{
"key": "env",
"value": "VEHICLEDATABROKER_DAPR_APP_ID=vehicledatabroker"
"value": "VDB_ADDRESS=127.0.0.1:55555"
},
{
"key": "env",
Expand Down Expand Up @@ -185,7 +185,7 @@
},
{
"key": "env",
"value": "VEHICLEDATABROKER_DAPR_APP_ID=vehicledatabroker"
"value": "VDB_ADDRESS=127.0.0.1:55555"
},
{
"key": "mount",
Expand Down
2 changes: 1 addition & 1 deletion runtime_kanto/src/runtime/deployment/mockservice.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"config": {
"env": [
"VEHICLEDATABROKER_DAPR_APP_ID=vehicledatabroker"
"VDB_ADDRESS=127.0.0.1:55555"
]
}
}
3 changes: 0 additions & 3 deletions runtime_kanto/src/runtime/deployment/mosquitto.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
}
},
"config": {
"env": [
"KUKSA_DATA_BROKER_PORT=55555"
],
"cmd": [
"mosquitto",
"-c",
Expand Down
7 changes: 7 additions & 0 deletions runtime_local/src/run-vehicle-app.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from typing import Optional

from local_lib import MiddlewareType, get_dapr_sidecar_args, get_middleware_type
from velocitas_lib.services import get_service_port


def get_dapr_app_id(service_id: str) -> str:
Expand All @@ -34,6 +35,12 @@ def run_app(
if get_middleware_type() == MiddlewareType.NATIVE:
envs = dict()
envs["SDV_MIDDLEWARE_TYPE"] = "native"
vdb_port = get_service_port("vehicledatabroker")
vdb_address = "grpc://127.0.0.1"
envs["SDV_VEHICLEDATABROKER_ADDRESS"] = f"{vdb_address}:{vdb_port}"
mqtt_port = get_service_port("mqtt-broker")
mqtt_address = "mqtt://127.0.0.1"
envs["SDV_MQTT_ADDRESS"] = f"{mqtt_address}:{mqtt_port}"
subprocess.check_call(program_args, env=envs)
elif get_middleware_type() == MiddlewareType.DAPR:
if not app_id:
Expand Down

0 comments on commit 1989742

Please sign in to comment.