Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"carma" shell script update to support dual compute system #2189

Draft
wants to merge 32 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
31dde3a
Initial support for swarm commands in carma bash script
willjohnsonk Nov 8, 2023
66a8100
Updated dual compute deploy commands and volume config based on testing
willjohnsonk Nov 13, 2023
2b9c1b6
Minor fixes to token command, added fi
willjohnsonk Nov 13, 2023
a97e5ce
Double quotes and spaces, my enemy
willjohnsonk Nov 13, 2023
01a60e9
Added commands for log attachment, help, and initial registry setup
willjohnsonk Nov 16, 2023
09f343b
Changed swarm update-config to support config set arguments, fixed ar…
willjohnsonk Nov 17, 2023
93e637f
Added edit arg and minor updates to config management
willjohnsonk Nov 17, 2023
4564bc6
Minor fixes following dual compute test
willjohnsonk Nov 17, 2023
89ea7b4
Migrated swarm code to extensions and changed from ifs to functions. …
willjohnsonk Nov 21, 2023
99d1ff4
Swarm install/config status added. Minor improvments to image-based a…
willjohnsonk Nov 22, 2023
712d7af
Updated to support env variables
willjohnsonk Nov 22, 2023
0872174
Naming fixes and added clarity
willjohnsonk Nov 27, 2023
b71efdf
Registry updates for testing, minor fixes
willjohnsonk Nov 27, 2023
42c3a46
Test fix for env variable subshell usage
willjohnsonk Nov 27, 2023
6092f73
Added read only vars, PR changes, fixed stop and register
willjohnsonk Nov 28, 2023
35f7a27
Added dual compute params and updated LaunchDescription
willjohnsonk Nov 29, 2023
b2c0b40
Changed carma_src launch decription to better reflect conditionals
willjohnsonk Nov 30, 2023
36283b8
Fixes to configuration params and string syntax following testing on …
willjohnsonk Dec 1, 2023
0af1659
Fixed an issue that prevented setting a full image name in set config
willjohnsonk Dec 1, 2023
b001822
Removed unnecessary echo
willjohnsonk Dec 1, 2023
d15d4c8
Addressing PR comments related to variable naming and other issues in…
willjohnsonk Dec 5, 2023
0453dc8
Removed commented-out items, minor registry fix
willjohnsonk Dec 5, 2023
fc90a39
Fixed EOF on registry
willjohnsonk Dec 5, 2023
1bcfa09
Corrected EOF issue on register from tab, added domain environment va…
willjohnsonk Dec 5, 2023
70502e4
Added a check for carma-config-data volume existence on worker
willjohnsonk Dec 18, 2023
ec78263
Improved IP/USER fetching by removing carma-base dependency
willjohnsonk Dec 19, 2023
d6c3db2
Updated settings to reflect working config on the dual compute test s…
willjohnsonk Dec 19, 2023
37e56ae
Added rsync files to engineering_tools for tracking, may need to be m…
willjohnsonk Dec 26, 2023
e801637
Cleared shell check warnings
willjohnsonk Jan 2, 2024
ff69d8b
Merged develop into branch, resolved conflicts
willjohnsonk Jan 3, 2024
6a29f4c
Fixed swapped Manager/Worker variables
willjohnsonk Jan 4, 2024
623f636
Minor directory access change
willjohnsonk Jan 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions carma/launch/carma.env
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,9 @@ export CARMA_LOCZ_NS="/localization"

# Namespace of nodes in the web ui stack
export CARMA_UI_NS="/ui"

###
# Dual compute configuration
###
# Link ROS 2 instances across hosts
export ROS_DOMAIN_ID=2
43 changes: 38 additions & 5 deletions carma/launch/carma_src.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,22 @@ def generate_launch_description():
default_value= 'False',
description='Flag to enable opening http tunnesl to CARMA Cloud'
)

# Declare system_architecture
system_architecture = LaunchConfiguration('system_architecture')
declare_system_architecture = DeclareLaunchArgument(
name = 'system_architecture',
default_value = 'single',
description = 'Flag to define whether a single compute system or a dual compute system is being used'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also specify the accepted values for this config in the description?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically the accepted values are shown in both of these but I can see how it's not clear. It'd be better to be bolded but can't have that, do you think putting it as 'single' 'dual' / 'manager' 'worker' with single quotes in the text be clear enough?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, i think having them in single quotes would make it clear that those are the values we can use here

)

# Declare host_placement
host_placement = LaunchConfiguration('host_placement')
declare_host_placement = DeclareLaunchArgument(
name = 'host_placement',
default_value = 'manager',
description = 'Flag to define whether the current active host is a manager or worker for ROS node allocation'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, can you define the accepted values for the config in the description?

)

# Declare port
port = LaunchConfiguration('port')
Expand Down Expand Up @@ -144,8 +160,10 @@ def generate_launch_description():
simulation_mode = LaunchConfiguration('simulation_mode')
declare_simulation_mode = DeclareLaunchArgument(name='simulation_mode', default_value = 'False', description = 'True if CARMA Platform is launched with CARLA Simulator')


# Launch ROS2 rosbag logging
ros2_rosbag_launch = GroupAction(
condition=IfCondition(PythonExpression(["'", host_placement, "' == 'manager'"])),
adev4a marked this conversation as resolved.
Show resolved Hide resolved
actions=[
IncludeLaunchDescription(
PythonLaunchDescriptionSource([ThisLaunchFileDir(), '/ros2_rosbag.launch.py']),
Expand All @@ -158,8 +176,8 @@ def generate_launch_description():
)

# Nodes

transform_group = GroupAction(
condition=IfCondition(PythonExpression(["'", host_placement, "' == 'manager'"])),
actions=[
PushRosNamespace(EnvironmentVariable('CARMA_TF_NS', default_value='/')),
IncludeLaunchDescription(
Expand All @@ -168,7 +186,9 @@ def generate_launch_description():
]
)


environment_group = GroupAction(
condition=IfCondition(PythonExpression(["'", host_placement, "' == 'manager'"])),
actions=[
PushRosNamespace(EnvironmentVariable('CARMA_ENV_NS', default_value='environment')),
IncludeLaunchDescription(
Expand All @@ -183,7 +203,9 @@ def generate_launch_description():
]
)


localization_group = GroupAction(
condition=IfCondition(PythonExpression(["'", host_placement, "' == 'manager'"])),
actions=[
PushRosNamespace(EnvironmentVariable('CARMA_LOCZ_NS', default_value='localization')),
IncludeLaunchDescription(
Expand All @@ -202,7 +224,9 @@ def generate_launch_description():
]
)


v2x_group = GroupAction(
condition=IfCondition(PythonExpression(["'", host_placement, "' == 'manager'"])),
actions=[
PushRosNamespace(EnvironmentVariable('CARMA_MSG_NS', default_value='message')),
IncludeLaunchDescription(
Expand All @@ -217,10 +241,11 @@ def generate_launch_description():
]
)


guidance_group = GroupAction(
condition=IfCondition(PythonExpression(["'", host_placement, "' == 'worker'"])),
actions=[
PushRosNamespace(EnvironmentVariable('CARMA_GUIDE_NS', default_value='guidance')),

IncludeLaunchDescription(
PythonLaunchDescriptionSource([ThisLaunchFileDir(), '/guidance.launch.py']),
launch_arguments={
Expand All @@ -237,7 +262,9 @@ def generate_launch_description():
]
)


drivers_group = GroupAction(
condition=IfCondition(PythonExpression(["'", host_placement, "' == 'manager'"])),
actions=[
PushRosNamespace(EnvironmentVariable('CARMA_INTR_NS', default_value='hardware_interface')),
IncludeLaunchDescription(
Expand All @@ -250,7 +277,9 @@ def generate_launch_description():
]
)


system_controller = Node(
condition=IfCondition(PythonExpression(["'", host_placement, "' == 'manager'"])),
package='system_controller',
name='system_controller',
executable='system_controller',
Expand All @@ -259,10 +288,11 @@ def generate_launch_description():
arguments=['--ros-args', '--log-level', GetLogLevel('system_controller', env_log_levels)]
)


ui_group = GroupAction(
condition=IfCondition(PythonExpression(["'", host_placement, "' == 'manager'"])),
actions=[
PushRosNamespace(EnvironmentVariable('CARMA_UI_NS', default_value='ui')),

IncludeLaunchDescription(
PythonLaunchDescriptionSource([ThisLaunchFileDir(), '/ui.launch.py']),
launch_arguments={
Expand All @@ -272,6 +302,7 @@ def generate_launch_description():
]
)


return LaunchDescription([
declare_vehicle_calibration_dir_arg,
declare_vehicle_config_dir_arg,
Expand All @@ -290,13 +321,15 @@ def generate_launch_description():
declare_arealist_path,
declare_vector_map_file,
declare_simulation_mode,
declare_system_architecture,
declare_host_placement,
drivers_group,
transform_group,
environment_group,
localization_group,
v2x_group,
guidance_group,
guidance_group,
ros2_rosbag_launch,
ui_group,
system_controller
])
])
2 changes: 1 addition & 1 deletion engineering_tools/carma
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ carma__attach() {
local CARMA_DOCKER_FILE="`docker run --rm --volumes-from carma-config:ro --entrypoint sh busybox:latest -c 'cat /opt/carma/vehicle/config/docker-compose.yml'`"
JonSmet marked this conversation as resolved.
Show resolved Hide resolved

echo "Attaching to CARMA container STDOUT..."
echo "$CARMA_DOCKER_FILE" | docker-compose -p carma -f - logs --follow --tail=10
echo "$CARMA_DOCKER_FILE" | docker-compose -p carma logs -f - logs --follow --tail=10
willjohnsonk marked this conversation as resolved.
Show resolved Hide resolved
}

carma-config__edit() {
Expand Down
Loading