Skip to content

Commit

Permalink
Use dedicated build for noetic main (UniversalRobots#640)
Browse files Browse the repository at this point in the history
* Use dedicated build for noetic main
* Increase timeout waiting for first action server
* Add full noetic build matrix
* Make the integration test behind a compile flag

Since for our integration tests we would require docker being able to spawn a new container that can't necessarily be expected in any usecase.
Also, with making this optional we don't require docker as a test dependency which also makes the package a lot more lightweight.
  • Loading branch information
fmauch authored Oct 10, 2023
1 parent 1b0b8db commit 2cbb8b2
Show file tree
Hide file tree
Showing 11 changed files with 185 additions and 72 deletions.
63 changes: 0 additions & 63 deletions .github/workflows/ci.yml

This file was deleted.

20 changes: 20 additions & 0 deletions .github/workflows/ci_format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Clang-Format check
on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
format_check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: 'ros-industrial/industrial_ci@master'
env:
ROS_DISTRO: noetic
CLANG_FORMAT_CHECK: file
CLANG_FORMAT_VERSION: "9"
22 changes: 22 additions & 0 deletions .github/workflows/noetic-binary-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Noetic Binary Build Main
on:
workflow_dispatch:
branches:
- master
pull_request:
branches:
- master
push:
branches:
- master
schedule:
# Run every morning to detect flakiness and broken dependencies
- cron: '32 5 * * *'

jobs:
binary:
uses: ./.github/workflows/reusable_ici.yml
with:
ros_distro: noetic
ros_repo: main
ref_for_scheduled_build: master
22 changes: 22 additions & 0 deletions .github/workflows/noetic-binary-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Noetic Binary Build Testing
on:
workflow_dispatch:
branches:
- master
pull_request:
branches:
- master
push:
branches:
- master
schedule:
# Run every morning to detect flakiness and broken dependencies
- cron: '32 5 * * *'

jobs:
binary:
uses: ./.github/workflows/reusable_ici.yml
with:
ros_distro: noetic
ros_repo: testing
ref_for_scheduled_build: master
23 changes: 23 additions & 0 deletions .github/workflows/noetic-semi-binary-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Noetic Semi-Binary Build Main
on:
workflow_dispatch:
branches:
- master
pull_request:
branches:
- master
push:
branches:
- master
schedule:
# Run every morning to detect flakiness and broken dependencies
- cron: '32 5 * * *'

jobs:
binary:
uses: ./.github/workflows/reusable_ici.yml
with:
ros_distro: noetic
ros_repo: main
ref_for_scheduled_build: master
upstream_workspace: .noetic.rosinstall
23 changes: 23 additions & 0 deletions .github/workflows/noetic-semi-binary-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Noetic Semi-Binary Build Testing
on:
workflow_dispatch:
branches:
- master
pull_request:
branches:
- master
push:
branches:
- master
schedule:
# Run every morning to detect flakiness and broken dependencies
- cron: '32 5 * * *'

jobs:
binary:
uses: ./.github/workflows/reusable_ici.yml
with:
ros_distro: noetic
ros_repo: testing
ref_for_scheduled_build: master
upstream_workspace: .noetic.rosinstall
50 changes: 50 additions & 0 deletions .github/workflows/reusable_ici.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Reusable industrial_ci workflow
# original author: Denis Štogl <[email protected]>

on:
workflow_call:
inputs:
ref_for_scheduled_build:
description: 'Reference on which the repo should be checkout for scheduled build. Usually is this name of a branch or a tag.'
default: ''
required: false
type: string

upstream_workspace:
description: 'UPSTREAM_WORKSPACE variable for industrial_ci. Usually path to local .repos file.'
default: ''
required: false
type: string
ros_distro:
description: 'ROS_DISTRO variable for industrial_ci'
required: false
type: string
ros_repo:
description: 'ROS_REPO to run for industrial_ci. Possible values: "main", "testing"'
default: 'main'
required: false
type: string

jobs:
reusable_ici:
name: ${{ inputs.ros_distro }} ${{ inputs.ros_repo }} ${{ inputs.os_code_name }}
runs-on: ubuntu-latest
env:
DOCKER_RUN_OPTS: '-v /var/run/docker.sock:/var/run/docker.sock --network ursim_net'
ADDITIONAL_DEBS: 'docker.io'
steps:
- name: Checkout ${{ inputs.ref }} when build is not scheduled
if: ${{ github.event_name != 'schedule' }}
uses: actions/checkout@v3
- name: Checkout ${{ inputs.ref }} on scheduled build
if: ${{ github.event_name == 'schedule' }}
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref_for_scheduled_build }}
- run: docker network create --subnet=192.168.56.0/24 ursim_net
- uses: 'ros-industrial/industrial_ci@master'
env:
UPSTREAM_WORKSPACE: ${{ inputs.upstream_workspace }}
ROS_DISTRO: ${{ inputs.ros_distro }}
ROS_REPO: ${{ inputs.ros_repo }}
CMAKE_ARGS: -DUR_ROBOT_DRIVER_BUILD_INTEGRATION_TESTS=ON
12 changes: 11 additions & 1 deletion ur_robot_driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo)
endif()

# Default to off as this only works in environments where a new docker container can be started with the appropriate networking, which
# might not be possible e.g. inside the buildfarm
option(
UR_ROBOT_DRIVER_BUILD_INTEGRATION_TESTS
"Build integration tests using the start_ursim script"
OFF
)

find_package(catkin REQUIRED
COMPONENTS
actionlib
Expand Down Expand Up @@ -127,7 +135,9 @@ target_link_libraries(controller_stopper_node
if(CATKIN_ENABLE_TESTING)
find_package(rostest REQUIRED)

add_rostest(test/driver.test)
if(${UR_ROBOT_DRIVER_BUILD_INTEGRATION_TESTS})
add_rostest(test/driver.test)
endif()
endif()


Expand Down
4 changes: 2 additions & 2 deletions ur_robot_driver/launch/ur_control.launch
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@

<!-- spawn controller manager -->
<node name="ros_control_controller_spawner" pkg="controller_manager" type="spawner" respawn="false"
output="screen" args="$(arg controllers)" />
output="screen" args="$(arg controllers) --timeout 600" />

<!-- load other controller -->
<node name="ros_control_stopped_spawner" pkg="controller_manager" type="spawner" respawn="false"
output="screen" args="--stopped $(arg stopped_controllers)" unless="$(eval arg('stopped_controllers') == '')"/>
output="screen" args="--stopped $(arg stopped_controllers) --timeout 600" unless="$(eval arg('stopped_controllers') == '')"/>

<node name="controller_stopper" pkg="ur_robot_driver" type="controller_stopper_node" respawn="false" output="screen">
<remap from="robot_running" to="ur_hardware_interface/robot_program_running"/>
Expand Down
3 changes: 3 additions & 0 deletions ur_robot_driver/test/driver.test
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
<arg name="stopped_controllers" value="forward_joint_traj_controller forward_cartesian_traj_controller twist_controller pose_based_cartesian_traj_controller joint_based_cartesian_traj_controller"/>
</include>

<node name="ursim" pkg="ur_client_library" type="start_ursim.sh" respawn="false" output="screen">
</node>

<!--If the default controller changes, this remap has to be adapted, as well-->
<remap from="follow_joint_trajectory" to="/scaled_pos_joint_traj_controller/follow_joint_trajectory" />
<remap from="forward_cartesian_trajectory" to="/forward_cartesian_traj_controller/follow_cartesian_trajectory" />
Expand Down
15 changes: 9 additions & 6 deletions ur_robot_driver/test/integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,42 +53,45 @@ def init_robot(self):
"""Make sure the robot is booted and ready to receive commands"""

rospy.init_node('ur_robot_driver_integration_test')
# In CI we pull the docker image when this test is started. So, we wait a little longer for
# the first service...
initial_timeout = rospy.Duration(300)
timeout = rospy.Duration(30)

self.set_mode_client = actionlib.SimpleActionClient(
'/ur_hardware_interface/set_mode', SetModeAction)
if not self.set_mode_client.wait_for_server(timeout):
if not self.set_mode_client.wait_for_server(initial_timeout):
self.fail(
"Could not reach set_mode action. Make sure that the driver is actually running."
" Msg: {}".format(err))
)

self.trajectory_client = actionlib.SimpleActionClient(
'follow_joint_trajectory', FollowJointTrajectoryAction)
if not self.trajectory_client.wait_for_server(timeout):
self.fail(
"Could not reach controller action. Make sure that the driver is actually running."
" Msg: {}".format(err))
)

self.cartesian_passthrough_trajectory_client = actionlib.SimpleActionClient(
'forward_cartesian_trajectory', FollowCartesianTrajectoryAction)
if not self.cartesian_passthrough_trajectory_client.wait_for_server(timeout):
self.fail(
"Could not reach cartesian passthrough controller action. Make sure that the driver is actually running."
" Msg: {}".format(err))
)

self.joint_passthrough_trajectory_client = actionlib.SimpleActionClient(
'forward_joint_trajectory', FollowJointTrajectoryAction)
if not self.joint_passthrough_trajectory_client.wait_for_server(timeout):
self.fail(
"Could not reach joint passthrough controller action. Make sure that the driver is actually running."
" Msg: {}".format(err))
)

self.cartesian_trajectory_client = actionlib.SimpleActionClient(
'follow_cartesian_trajectory', FollowCartesianTrajectoryAction)
if not self.cartesian_trajectory_client.wait_for_server(timeout):
self.fail(
"Could not reach cartesian controller action. Make sure that the driver is actually running."
" Msg: {}".format(err))
)

self.set_io_client = rospy.ServiceProxy('/ur_hardware_interface/set_io', SetIO)
try:
Expand Down

0 comments on commit 2cbb8b2

Please sign in to comment.