Hi Antara,
From what I see in your container descriptor, you set the environment variables as so:
"env": [
"SDV_MQTT_ADDRESS=mqtt://mosquitto:1883",
"SDV_VEHICLEDATABROKER_ADDRESS=grpc://databroker:55555",
"SDV_MIDDLEWARE_TYPE=native",
"RUST_LOG=info",
"vehicle_data_broker=info"
]
However, "mosquitto" and "databroker" don't mean anything to the kanto container manager
and that is why you are probably getting RPC (connection) errors.
If you want to use mosquitto and databroker to refer to the MQTT broker (native) on
Leda and the databroker container, you would need to add some extra host entries:
"extra_hosts": [
"mosquitto:host_ip",
"databroker:container_databroker-host"
]
Now, host_ip and container_databroker-host are special variables in Kanto manifests
which resolve to the Host ip and the ip of the container with the name databroker in the virtual bridge network respectively. Adding the above-mentioned extra host entries now map "mosquitto" and "databroker" to those IPs and this will allow your mock service
to connect to both services (if everything else is ok).
P.S.2:
If you do the extra hosts re-mapping the way I suggested, you shouldn't need in host
networking mode. If you still decide to run in host-networking mode, then you would need to map both "mosquitto" and "databroker" to 127.0.0.1.
P.S.3:
In docker, on the default docker0 bridge network you don't have a DNS server that allows
container-name based communication and I assume that's why you can't get it to work without host networking.
Overall, I suggest going with the approach I described in the beginning of this email
and if you need further help, don't hesitate to write back.
Best regards,
Vasil
From: leda-dev <leda-dev-bounces@xxxxxxxxxxx> on behalf of Antara Dey via leda-dev <leda-dev@xxxxxxxxxxx>
Sent: Wednesday, 8 November 2023 16:24
To: leda-dev@xxxxxxxxxxx <leda-dev@xxxxxxxxxxx>
Cc: Antara Dey <Antara.Dey@xxxxxxxxxxxxxxxxxx>
Subject: [leda-dev] Launching KUKSA:mock_service in Leda
Hello Leda community,
I am trying to launch the mock_service from KUKSA as Kanto container in Leda image.
Steps:
1. Import
mock_service from KUKSA repository into Velocitas template.
2. Modify vehicle signals for vehicle application and test it.
3. Create docker image, and push to private repository.
4. Pull docker image and run in Velocitas environment. ->
Runs as expected.
5. Use Kanto-CM container manifest to
launch in Leda v.M2 image.
6. Restart Kanto-CM.
The creation of the mock_service container is successful.
But, it throws the following
errors
in logs and
does not run as expected.
.
As suggested by Velocitas team, I have referred the Velocitas Kanto manifest file for mock_service from
mockservice.json.
Please find attached JSON file of the mock_service which I use in Leda image.
Note: I observe the same error in Velocitas in the following scenarios:
1)
Container launched without Local-Runtime Up.
2)
*docker run* without flag --net=host.
Kindly
provide insights into this issue.
|