carla/Jenkinsfile

360 lines
15 KiB
Plaintext
Raw Normal View History

2020-03-19 07:45:00 +08:00
#!/usr/bin/env groovy
pipeline
{
agent none
2018-05-07 23:33:43 +08:00
options
{
2018-07-10 22:26:05 +08:00
buildDiscarder(logRotator(numToKeepStr: '3', artifactNumToKeepStr: '3'))
2018-05-08 23:01:04 +08:00
}
stages
{
2020-03-19 07:45:00 +08:00
stage('Creating nodes')
{
agent { label "master" }
steps
{
script
{
JOB_ID = "${env.BUILD_TAG}"
2021-02-10 01:42:13 +08:00
jenkinsLib = load("/home/jenkins/jenkins_426.groovy")
2020-08-25 18:58:12 +08:00
2020-03-19 21:38:04 +08:00
jenkinsLib.CreateUbuntuBuildNode(JOB_ID)
jenkinsLib.CreateWindowsBuildNode(JOB_ID)
2020-03-19 07:45:00 +08:00
}
}
}
stage('Building CARLA')
{
parallel
{
stage('ubuntu')
{
2020-03-19 07:45:00 +08:00
agent { label "ubuntu && build && ${JOB_ID}" }
2021-02-10 02:35:20 +08:00
environment
{
UE4_ROOT = '/home/jenkins/UnrealEngine_4.26'
}
stages
{
stage('ubuntu setup')
{
steps
{
2020-12-11 20:11:14 +08:00
sh 'git update-index --skip-worktree Unreal/CarlaUE4/CarlaUE4.uproject'
Ros2 (#6862) * Adding ROS2 manager * Trying to compile fastDDS in windows, but have problems with dependencies * Camera sensors connected to ROS2, dependencies disabled temporaly * Including enum with sensors list * adding GNSS sensor capture * adding IMU sensor capture * adding DVS sensor capture * adding Lidar sensor capture * adding SemanticLidar and Radar capture * adding ObstacleDetector and some fixes * modify cmakelists, failed to find libatomic * fixed libatomic * compile fast-dds with libc++ * fixed compliation fast dds with libcxx * linked carla with fastdds * Fixed Fast-DDS lib Now its compiled to a intermediate lib with a bridge so libstdc++ can be used * moved all ros2 deps to ros2 folder renamed types from .cxx to .cpp * Finally FastDDS compiled and working inside CARLA * exposed publish function for testing * fixed code style * make ros2 optional * make ros2 optional * Added defines to compile ROS2 code * ros image publisher working * deleted some buffer copies * Added more topics and ROS2 types * Adding sensor Transform as argument, and add function to send buffer or serialize and send buffer * Removing empty buffer from DVS sensor * fixed lidar publisher * fixed lidar publisher * Fix buffer of RGB in ROS2 * adding timestamp of each frame into ROS2 manager * sending timestamps with frame to ROS2 * put apart timestamp from frame counter call * adding BufferView to share buffers * adding BufferView to share buffers * adding ros_name attribute to all actors * mapping ros_name for each actor * ROS2 is now published in a different thread Publishers now can be created on demand and be reused Added subscriber for ego vehicle Fixed build scripts * forgot to add this fix * add ros2 to windows scripts * fixed default ros topic names * fix topic name duplication * Adding functions for enable/disable sensors publishing without listen to it * Added Camera info and ROI types RGB Camera now publishes in both topics * move camera info immutable data to the constructor * Publish transform for all topics Create Camera DVS subtopics Fixed bug with Lidar * Added flip Y to semantic lidar * Adding callbacks for subscribers from Unreal * Adding camera info to ROS2 (resolution and FOV) * Finished ROS2 naming from python * Fixed bug with ros names * Delete topics when deleting the sensors * setting the rosname same as default no longer rewrites it * ROS transform fix * Added all camera topics with the image and camera info Added vehicle control Added clock publisher * Change ros2 topic names for vehicle subscriber and clock publisher * Rename vehicle control ros2 topic name * rename subscriber type to CarlaEgoVehicleControl * Fix semantic lidar default ros name Fix sizeof the semantic lidar data buffer * Changed controller stored as string to pointer * Back to previous version for default hero ros name Removed debug prints * Remvoe callback when ego publisher disconnects * Serializing DVS data before sending to ROS * dvs camera image and lidar * DVS Pointcloud publishing * Remove unnecessary fields * Send local transforms to ros * avoid transform recalculation if not needed * Optical Flow Camera fixed * Set fixed branch for Fast-DDS to avoid cmake version change issues * Finally Working on package * Fix style from FastDDS auto generated files * Added ros2 to ubuntu in jenkins * removed ros2 from jenkins, test * restore ros2 in jenkins * fix copy shareds, and removed server dependency from libcarla * test installing the fastdds dependencies in jenkins * move installing deps to separate stage * removed install deps * Fixing test_benchmark_streaming * Fixed imu orientation and camera info data * Fixing test_benchmark_streaming.cpp with BufferView * Removing DEBUG_ONLY() * publish collision sensor * Fixing unit-tests with the new BufferView * camera info is set once * Fix echo camera info * fix transform rotation * Fixing ros_name attribute creation * fixed camera info and region of interest publish * fix IMU compass * Forgot to add ros2 flag to jenkins package --------- Co-authored-by: bernatx <bernatx@gmail.com>
2023-11-06 19:34:07 +08:00
sh 'make setup ARGS="--python-version=3.7,2 --target-wheel-platform=manylinux_2_27_x86_64 --chrono --ros2"'
}
}
stage('ubuntu build')
{
steps
{
sh 'make LibCarla'
2021-07-15 17:18:34 +08:00
sh 'make PythonAPI ARGS="--python-version=3.7,2 --target-wheel-platform=manylinux_2_27_x86_64"'
Ros2 (#6862) * Adding ROS2 manager * Trying to compile fastDDS in windows, but have problems with dependencies * Camera sensors connected to ROS2, dependencies disabled temporaly * Including enum with sensors list * adding GNSS sensor capture * adding IMU sensor capture * adding DVS sensor capture * adding Lidar sensor capture * adding SemanticLidar and Radar capture * adding ObstacleDetector and some fixes * modify cmakelists, failed to find libatomic * fixed libatomic * compile fast-dds with libc++ * fixed compliation fast dds with libcxx * linked carla with fastdds * Fixed Fast-DDS lib Now its compiled to a intermediate lib with a bridge so libstdc++ can be used * moved all ros2 deps to ros2 folder renamed types from .cxx to .cpp * Finally FastDDS compiled and working inside CARLA * exposed publish function for testing * fixed code style * make ros2 optional * make ros2 optional * Added defines to compile ROS2 code * ros image publisher working * deleted some buffer copies * Added more topics and ROS2 types * Adding sensor Transform as argument, and add function to send buffer or serialize and send buffer * Removing empty buffer from DVS sensor * fixed lidar publisher * fixed lidar publisher * Fix buffer of RGB in ROS2 * adding timestamp of each frame into ROS2 manager * sending timestamps with frame to ROS2 * put apart timestamp from frame counter call * adding BufferView to share buffers * adding BufferView to share buffers * adding ros_name attribute to all actors * mapping ros_name for each actor * ROS2 is now published in a different thread Publishers now can be created on demand and be reused Added subscriber for ego vehicle Fixed build scripts * forgot to add this fix * add ros2 to windows scripts * fixed default ros topic names * fix topic name duplication * Adding functions for enable/disable sensors publishing without listen to it * Added Camera info and ROI types RGB Camera now publishes in both topics * move camera info immutable data to the constructor * Publish transform for all topics Create Camera DVS subtopics Fixed bug with Lidar * Added flip Y to semantic lidar * Adding callbacks for subscribers from Unreal * Adding camera info to ROS2 (resolution and FOV) * Finished ROS2 naming from python * Fixed bug with ros names * Delete topics when deleting the sensors * setting the rosname same as default no longer rewrites it * ROS transform fix * Added all camera topics with the image and camera info Added vehicle control Added clock publisher * Change ros2 topic names for vehicle subscriber and clock publisher * Rename vehicle control ros2 topic name * rename subscriber type to CarlaEgoVehicleControl * Fix semantic lidar default ros name Fix sizeof the semantic lidar data buffer * Changed controller stored as string to pointer * Back to previous version for default hero ros name Removed debug prints * Remvoe callback when ego publisher disconnects * Serializing DVS data before sending to ROS * dvs camera image and lidar * DVS Pointcloud publishing * Remove unnecessary fields * Send local transforms to ros * avoid transform recalculation if not needed * Optical Flow Camera fixed * Set fixed branch for Fast-DDS to avoid cmake version change issues * Finally Working on package * Fix style from FastDDS auto generated files * Added ros2 to ubuntu in jenkins * removed ros2 from jenkins, test * restore ros2 in jenkins * fix copy shareds, and removed server dependency from libcarla * test installing the fastdds dependencies in jenkins * move installing deps to separate stage * removed install deps * Fixing test_benchmark_streaming * Fixed imu orientation and camera info data * Fixing test_benchmark_streaming.cpp with BufferView * Removing DEBUG_ONLY() * publish collision sensor * Fixing unit-tests with the new BufferView * camera info is set once * Fix echo camera info * fix transform rotation * Fixing ros_name attribute creation * fixed camera info and region of interest publish * fix IMU compass * Forgot to add ros2 flag to jenkins package --------- Co-authored-by: bernatx <bernatx@gmail.com>
2023-11-06 19:34:07 +08:00
sh 'make CarlaUE4Editor ARGS="--chrono --ros2"'
2020-12-22 18:08:27 +08:00
sh 'make plugins'
sh 'make examples'
}
post
{
always
{
archiveArtifacts 'PythonAPI/carla/dist/*.egg'
archiveArtifacts 'PythonAPI/carla/dist/*.whl'
stash includes: 'PythonAPI/carla/dist/*.egg', name: 'ubuntu_eggs'
stash includes: 'PythonAPI/carla/dist/*.whl', name: 'ubuntu_wheels'
}
}
}
stage('ubuntu unit tests')
{
steps
{
2021-07-30 17:18:30 +08:00
sh 'make check ARGS="--all --xml --python-version=3.7,2 --target-wheel-platform=manylinux_2_27_x86_64"'
}
post
{
always
{
junit 'Build/test-results/*.xml'
archiveArtifacts 'profiler.csv'
}
}
}
stage('ubuntu retrieve content')
{
steps
{
sh './Update.sh'
}
}
stage('ubuntu package')
{
steps
{
2023-11-09 05:29:28 +08:00
sh 'make package ARGS="--python-version=3.7,2 --target-wheel-platform=manylinux_2_27_x86_64 --chrono"'
2023-10-27 20:39:37 +08:00
sh 'make package ARGS="--packages=AdditionalMaps,Town06_Opt,Town07_Opt,Town11,Town12,Town13,Town15 --target-archive=AdditionalMaps --clean-intermediate --python-version=3.7,2 --target-wheel-platform=manylinux_2_27_x86_64"'
sh 'make examples ARGS="localhost 3654"'
}
2020-08-25 18:58:12 +08:00
post
2020-03-19 07:45:00 +08:00
{
2020-08-25 18:58:12 +08:00
always
2020-03-19 07:45:00 +08:00
{
archiveArtifacts 'Dist/*.tar.gz'
stash includes: 'Dist/CARLA*.tar.gz', name: 'ubuntu_package'
// stash includes: 'Dist/AdditionalMaps*.tar.gz', name: 'ubuntu_package2'
stash includes: 'Examples/', name: 'ubuntu_examples'
}
2023-11-09 16:57:37 +08:00
}
}
stage('ubuntu package with ROS2')
{
steps
{
sh 'rm Dist/CARLA*.tar.gz'
sh 'make package ARGS="--python-version=3.7,2 --target-wheel-platform=manylinux_2_27_x86_64 --archive-sufix=ROS2 --chrono --ros2"'
}
post
{
always
{
archiveArtifacts 'Dist/CARLA*.tar.gz'
}
2020-09-16 19:22:09 +08:00
success
{
node('master')
{
script
{
JOB_ID = "${env.BUILD_TAG}"
2021-02-10 01:42:13 +08:00
jenkinsLib = load("/home/jenkins/jenkins_426.groovy")
2020-10-01 22:12:15 +08:00
2020-09-16 19:22:09 +08:00
jenkinsLib.CreateUbuntuTestNode(JOB_ID)
}
}
}
}
}
stage('ubuntu smoke tests')
{
agent { label "ubuntu && gpu && ${JOB_ID}" }
steps
{
unstash name: 'ubuntu_eggs'
unstash name: 'ubuntu_wheels'
2020-09-16 19:22:09 +08:00
unstash name: 'ubuntu_package'
// unstash name: 'ubuntu_package2'
2020-09-16 19:22:09 +08:00
unstash name: 'ubuntu_examples'
sh 'tar -xvzf Dist/CARLA*.tar.gz -C Dist/'
// sh 'tar -xvzf Dist/AdditionalMaps*.tar.gz -C Dist/'
2021-05-20 19:01:48 +08:00
sh 'DISPLAY= ./Dist/CarlaUE4.sh -nullrhi -RenderOffScreen --carla-rpc-port=3654 --carla-streaming-port=0 -nosound > CarlaUE4.log &'
2023-02-24 17:28:37 +08:00
sh 'make smoke_tests ARGS="--xml --python-version=3.7 --target-wheel-platform=manylinux_2_27_x86_64"'
2021-05-10 01:45:24 +08:00
sh 'make run-examples ARGS="localhost 3654"'
2020-09-16 19:22:09 +08:00
}
post
{
always
{
archiveArtifacts 'CarlaUE4.log'
junit 'Build/test-results/smoke-tests-*.xml'
deleteDir()
node('master')
{
script
{
JOB_ID = "${env.BUILD_TAG}"
2021-02-10 01:42:13 +08:00
jenkinsLib = load("/home/jenkins/jenkins_426.groovy")
2020-10-01 22:12:15 +08:00
2020-09-16 19:22:09 +08:00
jenkinsLib.DeleteUbuntuTestNode(JOB_ID)
}
}
2020-10-01 22:12:15 +08:00
}
}
}
2020-09-23 18:00:19 +08:00
stage('ubuntu deploy dev')
{
when { branch "dev"; }
steps
{
sh 'git checkout .'
2021-07-29 06:01:44 +08:00
sh 'make deploy ARGS="--replace-latest"'
2020-09-23 18:00:19 +08:00
}
}
stage('ubuntu deploy master')
{
when { anyOf { branch "master"; buildingTag() } }
steps
{
sh 'git checkout .'
sh 'make deploy ARGS="--replace-latest --docker-push"'
}
}
stage('ubuntu Doxygen')
{
when { anyOf { branch "master"; branch "dev"; buildingTag() } }
steps
{
sh 'rm -rf ~/carla-simulator.github.io/Doxygen'
2020-03-06 21:38:22 +08:00
sh '''
cd ~/carla-simulator.github.io
2021-10-27 15:16:38 +08:00
git remote set-url origin git@docs:carla-simulator/carla-simulator.github.io.git
2020-03-13 16:24:46 +08:00
git fetch
2020-03-06 21:38:22 +08:00
git checkout -B master origin/master
'''
sh 'make docs'
sh 'cp -rf ./Doxygen ~/carla-simulator.github.io/'
sh '''
cd ~/carla-simulator.github.io
git add Doxygen
git commit -m "Updated c++ docs" || true
git push
'''
}
2020-03-19 07:45:00 +08:00
post
{
always
{
deleteDir()
}
}
}
2020-03-21 01:13:08 +08:00
}
2020-08-25 18:58:12 +08:00
post
2020-03-21 01:13:08 +08:00
{
2020-08-25 18:58:12 +08:00
always
{
deleteDir()
2020-03-21 01:13:08 +08:00
node('master')
2020-03-13 16:24:46 +08:00
{
2020-03-21 01:13:08 +08:00
script
{
JOB_ID = "${env.BUILD_TAG}"
2021-02-10 01:42:13 +08:00
jenkinsLib = load("/home/jenkins/jenkins_426.groovy")
2020-08-25 18:58:12 +08:00
2020-03-21 01:13:08 +08:00
jenkinsLib.DeleteUbuntuBuildNode(JOB_ID)
}
2020-03-13 16:24:46 +08:00
}
}
}
}
2020-03-19 21:38:04 +08:00
stage('windows')
{
agent { label "windows && build && ${JOB_ID}" }
2021-02-10 02:35:20 +08:00
environment
{
2021-02-24 01:11:55 +08:00
UE4_ROOT = 'C:\\UE_4.26'
2021-02-10 02:35:20 +08:00
}
2020-03-19 21:38:04 +08:00
stages
{
stage('windows setup')
{
steps
{
2020-12-11 20:11:14 +08:00
bat """
call ../setEnv64.bat
git update-index --skip-worktree Unreal/CarlaUE4/CarlaUE4.uproject
"""
2020-03-19 21:38:04 +08:00
bat """
call ../setEnv64.bat
2021-03-01 23:56:31 +08:00
make setup ARGS="--chrono"
2020-03-19 21:38:04 +08:00
"""
}
}
stage('windows build')
{
steps
{
bat """
call ../setEnv64.bat
make LibCarla
"""
bat """
call ../setEnv64.bat
make PythonAPI
"""
bat """
call ../setEnv64.bat
2021-03-01 23:56:31 +08:00
make CarlaUE4Editor ARGS="--chrono"
2020-03-19 21:38:04 +08:00
"""
2020-12-22 18:08:27 +08:00
bat """
call ../setEnv64.bat
make plugins
"""
2020-03-19 21:38:04 +08:00
}
post
{
always
{
archiveArtifacts 'PythonAPI/carla/dist/*.egg'
archiveArtifacts 'PythonAPI/carla/dist/*.whl'
2020-03-19 21:38:04 +08:00
}
}
}
stage('windows retrieve content')
{
steps
{
bat """
call ../setEnv64.bat
call Update.bat
"""
}
}
stage('windows package')
{
steps
{
bat """
call ../setEnv64.bat
2021-03-01 23:56:31 +08:00
make package ARGS="--chrono"
2020-03-19 21:38:04 +08:00
"""
2021-03-01 18:34:22 +08:00
bat """
call ../setEnv64.bat
2023-10-27 20:39:37 +08:00
make package ARGS="--packages=AdditionalMaps,Town06_Opt,Town07_Opt,Town11,Town12,Town13,Town15 --target-archive=AdditionalMaps --clean-intermediate"
2021-03-01 18:34:22 +08:00
"""
2020-03-19 21:38:04 +08:00
}
post {
always {
archiveArtifacts 'Build/UE4Carla/*.zip'
}
}
}
stage('windows deploy')
{
2020-09-23 18:00:19 +08:00
when { anyOf { branch "master"; branch "dev"; buildingTag() } }
2020-03-19 21:38:04 +08:00
steps {
bat """
call ../setEnv64.bat
2020-03-20 01:58:09 +08:00
git checkout .
2020-03-19 21:38:04 +08:00
make deploy ARGS="--replace-latest"
"""
}
}
}
2020-08-25 18:58:12 +08:00
post
2020-03-19 21:38:04 +08:00
{
2020-08-25 18:58:12 +08:00
always
{
deleteDir()
2020-03-21 01:13:08 +08:00
node('master')
{
script
{
JOB_ID = "${env.BUILD_TAG}"
2021-02-10 01:42:13 +08:00
jenkinsLib = load("/home/jenkins/jenkins_426.groovy")
2020-08-25 18:58:12 +08:00
2020-03-21 01:13:08 +08:00
jenkinsLib.DeleteWindowsBuildNode(JOB_ID)
}
}
}
2020-03-19 21:38:04 +08:00
}
}
}
}
}
2018-05-07 23:33:43 +08:00
}