I've got multiple files that I want to publish to my python greengrass component.
Currently I have the following in my receipe :
"Manifests": \[
{
"Name": "Linux",
"Platform": {
"os": "linux"
},
"Lifecycle": {
"Run": {
"Script": "python3 -u {artifacts:path}/main.py ",
"RequiresPrivilege": "false"
} },
"Artifacts": \[
{
"URI": "s3://jeteye/components/artifacts/mycomponent/0.1.3/main.py",
"Unarchive": "NONE"
},
{
"URI": "s3://jeteye/components/artifacts/mycomponent/0.1.3/FileUtility.py",
"Unarchive": "NONE"
} ] } ]
and during deploy i upload them to s3 using:
aws s3 cp ${SCRIPTPATH}/../src/mycomponent/0.0.1/main.py s3://${BUCKET}/components/artifacts/mycomponent/0.1.3/main.py
aws s3 cp ${SCRIPTPATH}/../src/mycomponent/0.0.1/FileUtility.py s3://${BUCKET}/components/artifacts/mycomponent/0.1.3/FileUtility.py
aws greengrassv2 create-component-version --inline-recipe fileb://${SCRIPTPATH}/../deploy/mycomponent.json
this works alright.
Now I want to put those 2 files in 1 zip file as an artifact like:
mkdir -p ${SCRIPTPATH}/../src/mycomponent/tmp
cd ${SCRIPTPATH}/../src/mycomponent/0.0.1 ; zip -r ${SCRIPTPATH}/../src/mycomponent/tmp/latest.zip *
aws s3 cp ${SCRIPTPATH}/../src/mycomponent/tmp/latest.zip s3://${BUCKET}/components/artifacts/mycomponent/0.1.14/mycomponent.zip
and changed my artifacts section of the receipe to:
"Artifacts": [
{
"URI": "s3://jeteye/components/artifacts/mycomponent/0.1.4/mycomponent.zip",
"Unarchive": "ZIP"
}
this doesn't work.
the mycomponent.zip is in s3 , in greengrass.log it shows:
2021-12-01T04:00:21.218Z [WARN] (pool-2-thread-172) com.aws.greengrass.deployment.DeploymentConfigMerger: merge-config. merge-config-service BROKEN. {serviceName=mycomponent}
2021-12-01T04:00:21.218Z [ERROR] (pool-2-thread-172) com.aws.greengrass.deployment.activator.DeploymentActivator: merge-config. Deployment failed. {deploymentId=e0269c0e-4183-4da1-9733-4a0149e08dee}
com.aws.greengrass.deployment.exceptions.ServiceUpdateException: Service mycomponent in broken state after deployment
at com.aws.greengrass.deployment.DeploymentConfigMerger.waitForServicesToStart(DeploymentConfigMerger.java:194)
at com.aws.greengrass.deployment.activator.DefaultActivator.activate(DefaultActivator.java:84)
at com.aws.greengrass.deployment.DeploymentConfigMerger.updateActionForDeployment(DeploymentConfigMerger.java:150)
at com.aws.greengrass.deployment.DeploymentConfigMerger.lambda$mergeInNewConfig$0(DeploymentConfigMerger.java:102)
at com.aws.greengrass.lifecyclemanager.UpdateSystemPolicyService.runUpdateActions(UpdateSystemPolicyService.java:95)
at com.aws.greengrass.lifecyclemanager.UpdateSystemPolicyService.lambda$startup$0(UpdateSystemPolicyService.java:165)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
what else needs to be done to be able to upload multiple files in 1 zipped artifact ? what am i missing ?