-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapp.py
101 lines (88 loc) · 3.58 KB
/
app.py
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
93
94
95
96
97
98
99
100
101
#!/usr/bin/env python3
import os
import aws_cdk as cdk
from iot_fleetwise_setup.main_stack import MainStack
from iot_data_ingestion_pipeline.visibility_stack import VisibilityStack
from greengrass_components.ggv2_stack import Ggv2PipelineStack
from vision_system_visuals.vision_visuals import VisionVisualsStack
from vision_systems_data.vision_data import VisionDataStack
app = cdk.App()
MainStack(app, "biga-aws-iotfleetwise",
env=cdk.Environment(
account=os.getenv('CDK_DEFAULT_ACCOUNT'),
region=os.getenv('CDK_DEFAULT_REGION')))
# Fetch and check the existence of the yoctoSdkS3Path context parameter
yocto_sdk_s3_path = app.node.try_get_context("yoctoSdkS3Path")
yocto_sdk_script_name = app.node.try_get_context("yoctoSdkScriptName")
#if yocto_sdk_s3_path is None:
#raise Exception("Context parameter 'yoctoSdkS3Path' must be supplied")
# Fetch and check the existence of the yoctoSdkS3Path context parameter
s3_fwe_artifacts = app.node.try_get_context("s3FweArtifacts")
if s3_fwe_artifacts is None:
raise Exception("Context parameter 's3FweArtifacts' must be supplied")
# List of repository names
#repository_names = ["fleetwise_edge_connector",
# "rosbag2_play",
# "can_data_analyzer_publisher",
# "rtos_app_data_publisher",
# "rtos_os_data_publisher",
# "greengrass_stats_publisher",
# "virtual_can_forwarder",
# "ipcf_shared_memory",
# "ipcf_shared_memory_replacement"]
# List of repository names, and if they need to use graviton for building
repository_builds = [
{
"repository_name": "fleetwise_edge_connector",
"use_graviton": True
},
{
"repository_name": "rosbag2_play",
"use_graviton": False
},
{
"repository_name": "ipcf_shared_memory_replacement",
"use_graviton": True
},
{
"repository_name": "greengrass_stats_publisher",
"use_graviton": False
},
{
"repository_name": "can_data_analyzer_publisher",
"use_graviton": True
}
]
# Create stacks for each repository
for repo in repository_builds:
Ggv2PipelineStack(
app,
f"greengrass-components-pipeline-{repo['repository_name'].replace('_', '-')}",
repository_name=repo["repository_name"],
yocto_sdk_s3_path=yocto_sdk_s3_path,
yocto_sdk_script_name=yocto_sdk_script_name,
s3_fwe_artifacts=s3_fwe_artifacts,
s3_gg_components_prefix="gg",
use_graviton=repo["use_graviton"],
env=cdk.Environment(
account=os.getenv('CDK_DEFAULT_ACCOUNT'),
region=os.getenv('CDK_DEFAULT_REGION')
)
)
bucket_name = "vision-system-data-" + os.getenv('CDK_DEFAULT_ACCOUNT') + "-" + os.getenv("CDK_DEFAULT_REGION")
# Stack needed for Vision Data.
VisionVisualsStack(app, "VisionVisualsStack", bucket_name=bucket_name,
env=cdk.Environment(
account=os.getenv('CDK_DEFAULT_ACCOUNT'),
region=os.getenv('CDK_DEFAULT_REGION')))
# Stack needed for Observability.
VisibilityStack(app, "VisibilityStack",
env=cdk.Environment(account=os.getenv('CDK_DEFAULT_ACCOUNT'),
region=os.getenv('CDK_DEFAULT_REGION'))
)
bucket_name = 'vision-system-data-' + os.getenv('CDK_DEFAULT_ACCOUNT') + '-' + os.getenv('CDK_DEFAULT_REGION')
s3_path = '/vCar/vision-data-event-one-sample/processed-data/'
VisionDataStack(app, "VisionDataStack", s3_path=s3_path, bucket_name=bucket_name,
env=cdk.Environment(account=os.getenv('CDK_DEFAULT_ACCOUNT'),
region=os.getenv('CDK_DEFAULT_REGION')))
app.synth()