-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathrecipe-arm64-jp5.yaml
More file actions
92 lines (92 loc) · 4.91 KB
/
Copy pathrecipe-arm64-jp5.yaml
File metadata and controls
92 lines (92 loc) · 4.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
---
RecipeFormatVersion: "2020-01-25"
ComponentName: "aws.edgeml.dda.LocalServer.arm64JP5"
ComponentVersion: "1.0.0"
ComponentDescription: DDA Local Web Server App - ARM64 JetPack 5
ComponentPublisher: Amazon
ComponentDependencies:
aws.greengrass.Nucleus:
VersionRequirement: ">=2.4.0"
aws.greengrass.ShadowManager:
VersionRequirement: ">=2.2.0"
aws.greengrass.Cli:
VersionRequirement: ">=2.6.0"
ComponentConfiguration:
DefaultConfiguration:
StreamShadowName: "streamConfigurationShadow"
AppRunnerShadowName: "appRunnerShadow"
StationName: "DDA_Station_ARM64_JP5"
ComponentName: "aws.edgeml.dda.LocalServer.arm64JP5"
accessControl:
aws.greengrass.ShadowManager:
'aws.edgeml.dda.LocalServer.arm64JP5:shadow:1':
policyDescription: 'Allows access to shadows'
operations:
- 'aws.greengrass#GetThingShadow'
- 'aws.greengrass#UpdateThingShadow'
resources:
- $aws/things/*/shadow
- $aws/things/*/shadow/name/*
'aws.edgeml.dda.LocalServer.arm64JP5:shadow:2':
policyDescription: 'Allows access to things with shadows'
operations:
- 'aws.greengrass#ListNamedShadowsForThing'
resources:
- '*'
aws.greengrass.ipc.mqttproxy:
'aws.edgeml.dda.LocalServer.arm64JP5:mqttproxy:1':
policyDescription: Allows access to shadow pubsub topics
operations:
- "aws.greengrass#SubscribeToIoTCore"
- "aws.greengrass#PublishToIoTCore"
resources:
- $aws/things/*/shadow/name/*
aws.greengrass.Cli:
'aws.edgeml.dda.LocalServer.arm64JP5:cli:1':
policyDescription: 'Allows access to restart and stop DDA greengrass components'
operations:
- 'aws.greengrass#RestartComponent'
- 'aws.greengrass#StopComponent'
resources:
- 'aws.edgeml.dda.*'
- 'model*'
'aws.edgeml.dda.LocalServer.arm64JP5:cli:2':
policyDescription: 'Allows access to list and get details for greengrass components on device'
operations:
- 'aws.greengrass#ListComponents'
- 'aws.greengrass#GetComponentDetails'
resources:
- '*'
Manifests:
- Platform:
os: linux
architecture: aarch64
Lifecycle:
Install:
RequiresPrivilege: true
Script: |
docker images --quiet --filter=dangling=true | xargs --no-run-if-empty docker rmi -f || true; docker load -i {artifacts:decompressedPath}/aws.edgeml.dda.LocalServer.arm64JP5-aarch64/custom-build/aws.edgeml.dda.LocalServer.arm64JP5/flask-app.tar && docker load -i {artifacts:decompressedPath}/aws.edgeml.dda.LocalServer.arm64JP5-aarch64/custom-build/aws.edgeml.dda.LocalServer.arm64JP5/react-webapp.tar
chmod +x {artifacts:decompressedPath}/aws.edgeml.dda.LocalServer.arm64JP5-aarch64/custom-build/aws.edgeml.dda.LocalServer.arm64JP5/host_scripts/*.sh
bash {artifacts:decompressedPath}/aws.edgeml.dda.LocalServer.arm64JP5-aarch64/custom-build/aws.edgeml.dda.LocalServer.arm64JP5/host_scripts/install_nvidia_csi_service.sh
Run:
RequiresPrivilege: true
SetEnv:
COMPONENT_WORK_PATH: "{work:path}"
KERNEL_ROOT_PATH: "{kernel:rootPath}"
INFERENCE_COMPONENT_DECOMPRESED_PATH: "{aws.edgeml.dda.InferenceApp:artifacts:decompressedPath}"
LOCAL_SERVER_COMPONENT_DECOMPRESSED_PATH: "{artifacts:decompressedPath}/aws.edgeml.dda.LocalServer.arm64JP5-aarch64"
Script: |
bash {artifacts:decompressedPath}/aws.edgeml.dda.LocalServer.arm64JP5-aarch64/custom-build/aws.edgeml.dda.LocalServer.arm64JP5/host_scripts/setup_dda_users.sh ;
bash {artifacts:decompressedPath}/aws.edgeml.dda.LocalServer.arm64JP5-aarch64/custom-build/aws.edgeml.dda.LocalServer.arm64JP5/host_scripts/get_nvidia_libs_versions.sh;
bash {artifacts:decompressedPath}/aws.edgeml.dda.LocalServer.arm64JP5-aarch64/custom-build/aws.edgeml.dda.LocalServer.arm64JP5/host_scripts/setup_paths.sh;
bash {artifacts:decompressedPath}/aws.edgeml.dda.LocalServer.arm64JP5-aarch64/custom-build/aws.edgeml.dda.LocalServer.arm64JP5/host_scripts/configure_usb.sh;
export $(grep -v '^#' /tmp/.dda.env | xargs) ;
docker compose --profile $DOCKER_PROFILE -f {artifacts:decompressedPath}/aws.edgeml.dda.LocalServer.arm64JP5-aarch64/custom-build/aws.edgeml.dda.LocalServer.arm64JP5/docker-compose.yaml up --no-build ;
Shutdown:
RequiresPrivilege: true
Script: |
systemctl stop nvidia-csi-capture || true
docker compose --profile $DOCKER_PROFILE -f {artifacts:decompressedPath}/aws.edgeml.dda.LocalServer.arm64JP5-aarch64/custom-build/aws.edgeml.dda.LocalServer.arm64JP5/docker-compose.yaml down
Artifacts:
- URI: s3://BUCKET_NAME/COMPONENT_NAME/COMPONENT_VERSION/aws.edgeml.dda.LocalServer.arm64JP5-aarch64.zip
Unarchive: ZIP