Unzip Component Not Working

0

Recipe
{
"RecipeFormatVersion": "2020-01-25",
"ComponentName": "com.example.HelloWorld",
"ComponentVersion": "5.0.15",
"ComponentType": "aws.greengrass.generic",
"ComponentDescription": "My first AWS IoT Greengrass component.",
"ComponentPublisher": "WaterExpert",
"ComponentConfiguration": {
"DefaultConfiguration": {
"accessControl": {
"aws.greengrass.ipc.mqttproxy": {
"com.example.HelloWorld:pubsub:1": {
"policyDescription": "Allows access to publish to my/topic.",
"operations": [
"aws.greengrass#PublishToTopic",
"aws.greengrass#PublishToIoTCore",
"aws.greengrass#GreengrassCoreIPC"
],
"resources": [
"my/topic"
]
}
}
}
}
},
"Manifests": [
{
"Platform": {
"os": "linux"
},
"Name": "Linux",
"Lifecycle": {
"Run": "python3 {artifacts:path}/main.py"
},
"Artifacts": [
{
"Uri": "s3://braydenggctest/main2.zip",
"Digest": "re9Y7xzQgB8jbZtE0Y3Xg2sd0dZGl3Ydb048fPhDvH0=",
"Algorithm": "SHA-256",
"Unarchive": "ZIP",
"Permission": {
"Read": "OWNER",
"Execute": "NONE"
}
}
]
}
],
"Lifecycle": {}
}

I can manually unzip the file after deployment but the deployment fails to unzip it (trys to run main.py but file doesn't exist. I can manually unzip and then restart ggc and it'll read it)

brayden
preguntada hace 3 años452 visualizaciones
1 Respuesta
0
Respuesta aceptada

Hi,
In order to use archived artifacts in the lifecycle of a component within the recipe, you have to specify the unarchived path of the artifacts which is {artifacts:decompressedPath}. In your case, this will be as shown below where main2 is the name of the zip file and main.py is file inside it.

"Lifecycle": {
"Run": "python3 {artifacts:decompressedPath}/main2/main.py"
},

Thanks,
Saranya

AWS
Saranya
respondido hace 3 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas