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
질문됨 3년 전452회 조회
1개 답변
0
수락된 답변

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
답변함 3년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠