Run component asuser

0

Hi All,

I have a python package, packed as a zip, it is unarchived by greengrass
but greengrass runs the final component as ggc_user
How can I specify the user which has the correct environment variables for which the setup has been done???
Note, that I am not sure, if that even will work, if the environment is correct, as in 'bash' when I run 'env' as that user. But that may be because of lack of linux experience.

Currently I have this deployment.json. Any help appriciated!

{
"targetArn": "arn:aws:iot:eu-west-2:20404040404:thinggroup/mygroup",
"revisionId": "24",
"deploymentId": "d9f4ea87-a6b7-4911-9de7-66caec7467fc",
"deploymentStatus": "ACTIVE",
"iotJobId": "d66414c5-1141-4b7c-b8af-8895a0de0943",
"iotJobArn": "arn:aws:iot:eu-west-2:4949494949:job/d66414c5-1141-4b7c-b8af-8895a0de0943",
"components": {
"com.helmet-detection": {
"componentVersion": "1.0.17",
"configurationUpdate": {
"merge": "{"runWithDefault":{"posixUser":"jetson:ggc_group"}}"
},
"runWith": {}
}
},
"deploymentPolicies": {
"failureHandlingPolicy": "ROLLBACK"
},
"iotJobConfiguration": {},
"creationTimestamp": "2021-11-03T17:00:07.657000+01:00",
"isLatestForTarget": true,
"tags": {}
}

enierop
질문됨 2년 전198회 조회
6개 답변
0

Hello,
Please see the "runWith" portion in https://docs.aws.amazon.com/greengrass/v2/developerguide/create-deployments.html.

"runWith" is configurable on a per-component basis. In order to set it, you set the "runWith" key in the deployment under that component's key. It is not configurable as part of the configurationUpdate section of a deployment.

If you wish to change the runWith user for all components and not just a single component, then you will do a configuration update for the aws.greengrass.Nucleus component instead. https://docs.aws.amazon.com/greengrass/v2/developerguide/greengrass-nucleus-component.html#greengrass-nucleus-component-configuration

Cheers,
Michael

AWS
전문가
답변함 2년 전
0

thank you very much, I cannot seem to set the runWith in the console....

Have tried 'create-deployment' using aws command but no solution
Where do I set this???
Thank you.

"components": {
"com.helmet-detection": {
"componentVersion": "1.0.18",
"runWith": {<------------> todo?}
}
},

enierop
답변함 2년 전
0

Hi,
RunWith is settable in the console too. On the third page when creating a deployment you have a table listing the components to be deployed. Select the radio icon next to the component you wish to change, then click on the configure component button. At the bottom of the modal you can drop down advanced options and then change the runWith user.

Have a look at the API docs for setting the runwith using the CLI: https://docs.aws.amazon.com/greengrass/v2/APIReference/API_CreateDeployment.html

Cheers,
Michael

AWS
전문가
답변함 2년 전
0

Thank you, found that....

Unfortunately the component is still being ran as ggc_user
2021-11-04T08:08:57.115Z [WARN] (Copier) com.helmet-detection: stderr. WARNING:tensorflow:From /home/ggc_user/.local/l

When I do aws greengrassv2 get-deployment I have this...
"com.helmet-detection": {
"componentVersion": "1.0.18",
"configurationUpdate": {
"merge": "{"runWith":{"posixUser":"jetson:ggc_group"}}"
},
"runWith": {}
}

enierop
답변함 2년 전
0

Hi,
You still haven't set the runWith user correctly. You are still setting the "runWith" user as part of the "configurationUpdate", which is not correct; it is a separate key.

You must set runWith in the deployment as shown below.

"com.helmet-detection": {
    "componentVersion": "1.0.18",
    "configurationUpdate": {
    },
    "runWith": {"posixUser": "jetson:ggc_group"}
}
AWS
전문가
답변함 2년 전
0

The point is, that the json I showed was created by the system after setting like

components": {
"com.helmet-detect": {
"componentVersion": "1.0.2",
"runWith": {
"posixUser": "jetson"
}
}
},

But I found out, that at the bottom left, there is a link, I never saw before, where we can enter a user...
This works.

enierop
답변함 2년 전

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

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

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

관련 콘텐츠