2 Answers
- Newest
- Most votes
- Most comments
1
Hello,
Please follow the documented docker options to correctly use IPC: https://docs.aws.amazon.com/greengrass/v2/developerguide/run-docker-container.html#docker-container-ipc
Cheers,
Michael
0
Thank you very much for such a prompt response Michael, following the link that you provided actually worked!
Here's an updated version from the docker component configuration:
{
"RecipeFormatVersion": "2020-01-25",
"ComponentName": "${component_name}",
"ComponentVersion": "${component_version}",
"ComponentDescription": "A component that runs a Docker container from S3.",
"ComponentPublisher": "Ed",
"ComponentDependencies": {
"aws.greengrass.DockerApplicationManager": {
"VersionRequirement": "~2.0.0"
},
"aws.greengrass.TokenExchangeService": {
"VersionRequirement": "~2.0.0"
}
},
"ComponentConfiguration": {
"DefaultConfiguration": {
"topic": "thesis/docker",
"message": "Hello, World!",
"qos": "1",
"accessControl": {
"aws.greengrass.ipc.pubsub": {
"dockercontainer:pubsub:1": {
"policyDescription": "Allows access to publish to Pub and Sub topics.",
"operations": [
"aws.greengrass#SubscribeToTopic"
],
"resources": [
"thesis/docker"
]
}
}
}
}
},
"Manifests": [
{
"Platform": {
"os": "all"
},
"Lifecycle": {
"run": "docker run -v {kernel:rootPath}/ipc.socket:{kernel:rootPath}/ipc.socket -v /home/pi/mastergit/audio_files/100:/app/files -e SVCUID -e AWS_GG_NUCLEUS_DOMAIN_SOCKET_FILEPATH_FOR_COMPONENT -e MQTT_TOPIC=\"{configuration:/topic}\" -e MQTT_MESSAGE=\"{configuration:/message}\" -e MQTT_QOS=\"{configuration:/qos}\" --rm 109139691401.dkr.ecr.eu-central-1.amazonaws.com/signal-process:shark"
},
"Artifacts": [
{
"URI": "docker:109139691401.dkr.ecr.eu-central-1.amazonaws.com/signal-process:shark"
}
]
}
]
}
There are couple of things that need to be point from the documentation in the link provided, however.
- There is a mismatch in the access control. The AWS IoT Core MQTT is specified as granting access, however the PubSub is the one that is enabled.
"accessControl": {
"aws.greengrass.ipc.mqttproxy": {
"com.example.python.docker.PublishToIoTCore:pubsub:1": {
- For me, it worked to include the kernel rootPath
{kernel:rootPath}/ipc.socket:{kernel:rootPath}/ipc.socket
. Otherwise I would be getting issues related toRuntimeError: 44 (AWS_ERROR_FILE_INVALID_PATH): Invalid file path.
Hope it is useful, and thank you very much again for the help
Ed
answered 6 months ago
Relevant content
- Accepted Answerasked 4 years ago
- Accepted Answerasked 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago