31
The ROS build farm What it can do for me (And how it does it) Oct. 9th 2016 Dirk Thomas ROSCon 2016, Seoul, Korea

The ROS build farm...The ROS build farm What it can do for me (And how it does it) Oct. 9th 2016 Dirk Thomas ROSCon 2016, Seoul, Korea build.ros.org Create easy-to-install packages

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: The ROS build farm...The ROS build farm What it can do for me (And how it does it) Oct. 9th 2016 Dirk Thomas ROSCon 2016, Seoul, Korea build.ros.org Create easy-to-install packages

TheROSbuildfarmWhatitcandoforme

(Andhowitdoesit)

Oct.9th2016DirkThomas

ROSCon2016,Seoul,Korea

Page 2: The ROS build farm...The ROS build farm What it can do for me (And how it does it) Oct. 9th 2016 Dirk Thomas ROSCon 2016, Seoul, Korea build.ros.org Create easy-to-install packages

build.ros.org

Createeasy-to-installpackages

Runtestsbefore/aftercodechanges

GenerateAPIdoc

andmetainformation

Page 3: The ROS build farm...The ROS build farm What it can do for me (And how it does it) Oct. 9th 2016 Dirk Thomas ROSCon 2016, Seoul, Korea build.ros.org Create easy-to-install packages

CentralServicevs.DistributedYoucould

createDebianpackagesyourselfrunthetestusinge.g.TravisCIgenerateAPIdocumentationyourself

Butsettingupalltheseprocessesisquitesomeeffort

havingsomeoneelsedoitisgreatfortheuserstheartifactsshouldbehostedinacentralplaceifyoudownload"official"binariesyouknowwhatyouaregetting

Page 4: The ROS build farm...The ROS build farm What it can do for me (And how it does it) Oct. 9th 2016 Dirk Thomas ROSCon 2016, Seoul, Korea build.ros.org Create easy-to-install packages

CentralServiceButDistributedRepositoriesAROSdistributionconsistsofnumerouspackages

variousvcstypesvarioushostingservices

foreachROSdistributiontargetplatformse.g.Kinetic:UbuntuXenialandWily,DebianJessie,(Fedora23and24)packagesandversionsreferencingallrepositories

formatofyamlfilesspecifiedin

Touseanyoftheseservicesyouneedtoregisteryourrepositories

github.com/ros/rosdistro

REP143

rosdistro/index.yaml

distributions:...kinetic:distribution:[kinetic/distribution.yaml]distribution_cache:<urltokinetic-cache.yaml.gz>

rosdistro/kinetic/distribution.yaml

repositories:...catkin:doc:...release:...source:...

release_platforms:...ubuntu:-wily-xenial

Page 5: The ROS build farm...The ROS build farm What it can do for me (And how it does it) Oct. 9th 2016 Dirk Thomas ROSCon 2016, Seoul, Korea build.ros.org Create easy-to-install packages

TheHigh-LevelViewGetthesourcecode:

e.g.gitcloneInstalltherequireddependencies:

usingrosdepBuildapackage:cmake,make,makeinstall

Runthetests:maketest

CreateaDebianpackage:apt-srcbuild

Generatedocumentationrosdoc_lite

Page 6: The ROS build farm...The ROS build farm What it can do for me (And how it does it) Oct. 9th 2016 Dirk Thomas ROSCon 2016, Seoul, Korea build.ros.org Create easy-to-install packages

SomeMoreDetailsNeedtosetuptheenvironmentforbuilding

Installalldependencies(usingbinarypackages)Sinceeachjobhasdifferentdependencieseachjobneedstostartwitha"clean"stateInsideaDockercontainer

BuildthecodefromonerepositoryMightcontainmorethanoneROSpackageTherepositoryisclonedintoacatkinworkspaceInvokecatkin_make_isolated

InstallthecodeTocheckthattheinstallstep"works"

BuildandrunthetestsEachtestproducesaxUnit-likeresultfile

Onecontainerformultiplepackages

Buildvs.testdependencies

Page 7: The ROS build farm...The ROS build farm What it can do for me (And how it does it) Oct. 9th 2016 Dirk Thomas ROSCon 2016, Seoul, Korea build.ros.org Create easy-to-install packages

catkin_makevs.catkin_make_isolatedWhiletheDockercontainercontainsthedependenciesforallpackagesEachpackageisstillbuilt"inisolation":

catkin_make catkin_make_isolated

CMakecalls 1,forthewholews N,eachpkgseparatelySideeffects Needtodependonotherpkgstargets

catkin_EXPORTED_TARGETS

Locationofartifacts

MergedinasinglefolderE.g.oneincludedir

Eachpkghasitsownfolder

Sideeffects Packagecanimplicitlyaccesse.g.theheadersfromotherpkgs

Pros Fasterduetohigherparallelization

Cleanseparation,bettertoidentifyproblems

Thebuildfarmonlybuildssinglethreaded

Page 8: The ROS build farm...The ROS build farm What it can do for me (And how it does it) Oct. 9th 2016 Dirk Thomas ROSCon 2016, Seoul, Korea build.ros.org Create easy-to-install packages

Runtestsbefore/aftercodechanges

Page 9: The ROS build farm...The ROS build farm What it can do for me (And how it does it) Oct. 9th 2016 Dirk Thomas ROSCon 2016, Seoul, Korea build.ros.org Create easy-to-install packages

DevelJobs

IN:repository

check1h

clone

Docker#1

installbuilddep

build

install

Docker#2

installtestdep

buildtests

runtestsOUT:resultCMake/compilerwarnings,failingtests

OUT:email

rosdistro/kinetic/distribution.yaml

genmsg:source:type:giturl:https://github.com/ros/genmsg.gitversion:<validbranchname>

pkg/package.xml

<maintaineremail="[email protected]">DirkThomas</maintainer>

+commiterssincethejobwasstable

Page 10: The ROS build farm...The ROS build farm What it can do for me (And how it does it) Oct. 9th 2016 Dirk Thomas ROSCon 2016, Seoul, Korea build.ros.org Create easy-to-install packages

PullRequestJobs

IN:repository

GitHubwebhook

OUT:GitHubPRstatus

rosdistro/kinetic/distribution.yaml

genmsg:source:test_pull_request:truetype:giturl:https://github.com/ros/genmsg.gitversion:<validbranchname>

Page 11: The ROS build farm...The ROS build farm What it can do for me (And how it does it) Oct. 9th 2016 Dirk Thomas ROSCon 2016, Seoul, Korea build.ros.org Create easy-to-install packages

PullRequestJobsLimitationsbuild.ros.orgonlysupportsGitHubatthemomentJenkinsGitHubuserros-pull-request-builderneedsaccesstotheorgunit

Alternatives

RunthesameprocessusinganyotherCIproviderE.g.TravisCI,seeexample.travis.ymlfile:

wiki.ros.org/buildfarm/Pullrequesttesting

docsingithub.com/ros-infrastructure/ros_buildfarm

Page 12: The ROS build farm...The ROS build farm What it can do for me (And how it does it) Oct. 9th 2016 Dirk Thomas ROSCon 2016, Seoul, Korea build.ros.org Create easy-to-install packages

GenerateAPIdocandmetainformation

Page 13: The ROS build farm...The ROS build farm What it can do for me (And how it does it) Oct. 9th 2016 Dirk Thomas ROSCon 2016, Seoul, Korea build.ros.org Create easy-to-install packages

DocJobs

IN:repository

check3d

clone

changelogrst→html

metainformation

crossrefindex

Docker

installdocdep

generatemsg/srv

rosdoc_lite∀pkgsOUT:resultrosdoc_litewarnings

OUT:email

OUT:generateddocsuploadtowebserver

OUT:updatecrossrefindex

rosdistro/kinetic/distribution.yaml

genmsg:doc:type:giturl:https://github.com/ros/genmsg.gitversion:<validbranchortagname>

Page 14: The ROS build farm...The ROS build farm What it can do for me (And how it does it) Oct. 9th 2016 Dirk Thomas ROSCon 2016, Seoul, Korea build.ros.org Create easy-to-install packages

WikiIntegration

wikimarkup

<<PackageHeader(roscpp)>>

Page 15: The ROS build farm...The ROS build farm What it can do for me (And how it does it) Oct. 9th 2016 Dirk Thomas ROSCon 2016, Seoul, Korea build.ros.org Create easy-to-install packages

Createeasy-to-installpackages

Page 16: The ROS build farm...The ROS build farm What it can do for me (And how it does it) Oct. 9th 2016 Dirk Thomas ROSCon 2016, Seoul, Korea build.ros.org Create easy-to-install packages

ReleaseProcess

sourcerepository catkin_prepare_releasetagversion

releaserepository bloomeachpackage,withDebianfiles

Debiansourcepackages sourcejobseachosnameandoscodenamee.gUbuntuXenial

Debianbinarypackages binaryjobseachos(code)nameandarche.gUbuntuXenialamd64

Page 17: The ROS build farm...The ROS build farm What it can do for me (And how it does it) Oct. 9th 2016 Dirk Thomas ROSCon 2016, Seoul, Korea build.ros.org Create easy-to-install packages

Bloom

sourcerepositoryonasinglebranch:-pkgA-pkgB

releaserepositoryseparatebranches:

pkgA pkgB

pkgApackage.xml:-buildtype-builddeps-rundepsCHANGELOG.rst

pkgAe.g.Debian-changelog-control-rules

Decidehowtobuildpkg

Maprosdepkeysto

targetspecificnames

rst→custom

Eachtargetplatformneedscustomspecialization,e.g.Wilyvs.Xenial

AUTOMATION

-Makesreleasingaseasyaspossible-Butallowscustomizationanywhereintheprocess-Createstherosdistropullrequestforyou

Page 18: The ROS build farm...The ROS build farm What it can do for me (And how it does it) Oct. 9th 2016 Dirk Thomas ROSCon 2016, Seoul, Korea build.ros.org Create easy-to-install packages

SourcedebJobs

IN:releaserepo

check15min

clonespecificbranch

pkg,os(code)namee.g.debian/ros-kinetic-bar-1.2.3-4_xenial

Dockerinstalltools

debhelpergit-buildpackage

gbpbuildpackage

OUT:result

OUT:email

OUT:Debiansourcepackageuploadtoaptrepo

OUT:triggerbinaryjobs∀architectures

Page 19: The ROS build farm...The ROS build farm What it can do for me (And how it does it) Oct. 9th 2016 Dirk Thomas ROSCon 2016, Seoul, Korea build.ros.org Create easy-to-install packages

BinarydebJobs

IN:Debiansourcepackage

triggeredbysourcedebjob

fetchfromaptrepo

abort?

appendtimestampDocker

installbuilddep

dpkg-buildpackage

OUT:result

OUT:email

OUT:Debianbinarypackageuploadtoaptrepo

OUT:triggerbinaryjobs∀downstreampkgs

Page 20: The ROS build farm...The ROS build farm What it can do for me (And how it does it) Oct. 9th 2016 Dirk Thomas ROSCon 2016, Seoul, Korea build.ros.org Create easy-to-install packages

AptRepositories

"main"packages.ros.org/ros/ubuntu

Distributedmirrors

"testing"packages.ros.org/ros-shadow-fixed/ubuntu

"main"

"testing"manualsync

"building"newlybuiltpkgsgohere

autosync

ServercolocatedwithJenkins

Pleasedonotusethisonedirectly

Page 21: The ROS build farm...The ROS build farm What it can do for me (And how it does it) Oct. 9th 2016 Dirk Thomas ROSCon 2016, Seoul, Korea build.ros.org Create easy-to-install packages

StatusPages

building

testing

main bu

ildingsquarelinkto

Jenkinsbinaryjob

repositories.ros.org/status_page/

Page 22: The ROS build farm...The ROS build farm What it can do for me (And how it does it) Oct. 9th 2016 Dirk Thomas ROSCon 2016, Seoul, Korea build.ros.org Create easy-to-install packages

"Decipher"JenkinsJobNamesSomeexamplejobnamesIsrc_uS__roscpp__ubuntu_saucy__sourceJdev__ros_comm__ubuntu_trusty_amd64Kbin_uX64__rospack__ubuntu_xenial_amd64__binary

Untilfirst__:prefixforgroupofjobs

Untilnext__:thepackageorrepositorynameThenosname,oscodename,arch(exceptforsourcejobs),source/binary(forreleasejobs)

Page 23: The ROS build farm...The ROS build farm What it can do for me (And how it does it) Oct. 9th 2016 Dirk Thomas ROSCon 2016, Seoul, Korea build.ros.org Create easy-to-install packages

JenkinsStatisticscount success unstable failure aborted not_built disabled

All 39785 38504(96.78%) 148(0.37%) 361(0.90%) 250(0.62%) 14(0.03%) 508(1.27%)Ibin_arm_uThf 2348 1997(85.05%) - 16(0.68%) 8(0.34%) 0(0.00%) 327(13.92%)Ibin_uS32 2348 2316(98.63%) - 22(0.93%) 9(0.38%) 1(0.04%) 0(0.00%)Ibin_uS64 2348 2314(98.55%) - 22(0.93%) 11(0.46%) 1(0.04%) 0(0.00%)Ibin_uT32 2348 2333(99.36%) - 12(0.51%) 3(0.12%) 0(0.00%) 0(0.00%)Ibin_uT64 2348 2334(99.40%) - 11(0.46%) 3(0.12%) 0(0.00%) 0(0.00%)Idev 769 645(83.87%) 26(3.38%) 98(12.74%) 0(0.00%) 0(0.00%) 0(0.00%)Idoc 807 756(93.68%) 31(3.84%) 16(1.98%) 1(0.12%) 3(0.37%) 0(0.00%)Ipr 29 20(68.96%) 3(10.34%) 2(6.89%) 0(0.00%) 4(13.79%) 0(0.00%)Isrc_uS 2348 2348(100.00%) - 0(0.00%) 0(0.00%) 0(0.00%) 0(0.00%)Isrc_uT 2348 2348(100.00%) - 0(0.00%) 0(0.00%) 0(0.00%) 0(0.00%)Kbin_dj_dJ64 941 894(95.00%) - 12(1.27%) 33(3.50%) 0(0.00%) 2(0.21%)Kbin_djv8_dJv8 941 875(92.98%) - 14(1.48%) 33(3.50%) 0(0.00%) 19(2.01%)Kbin_uW32 941 903(95.96%) - 12(1.27%) 26(2.76%) 0(0.00%) 0(0.00%)Kbin_uW64 941 903(95.96%) - 12(1.27%) 26(2.76%) 0(0.00%) 0(0.00%)Kbin_uX32 941 910(96.70%) - 10(1.06%) 21(2.23%) 0(0.00%) 0(0.00%)Kbin_uX64 941 910(96.70%) - 10(1.06%) 21(2.23%) 0(0.00%) 0(0.00%)Kbin_uxhf_uXhf 941 817(86.82%) - 11(1.16%) 30(3.18%) 0(0.00%) 83(8.82%)Kdev 291 215(73.88%) 47(16.15%) 29(9.96%) 0(0.00%) 0(0.00%) 0(0.00%)Kdoc 304 288(94.73%) 11(3.61%) 4(1.31%) 1(0.32%) 0(0.00%) 0(0.00%)Kpr 30 23(76.66%) 3(10.00%) 1(3.33%) 0(0.00%) 3(10.00%) 0(0.00%)Ksrc_dJ 941 933(99.14%) - 0(0.00%) 0(0.00%) 0(0.00%) 8(0.85%)Ksrc_uW 941 941(100.00%) - 0(0.00%) 0(0.00%) 0(0.00%) 0(0.00%)Ksrc_uX 941 941(100.00%) - 0(0.00%) 0(0.00%) 0(0.00%) 0(0.00%)Manage 86 86(100.00%) 0(0.00%) 0(0.00%) 0(0.00%) 0(0.00%) 0(0.00%)

Page 24: The ROS build farm...The ROS build farm What it can do for me (And how it does it) Oct. 9th 2016 Dirk Thomas ROSCon 2016, Seoul, Korea build.ros.org Create easy-to-install packages

Run"Jobs"LocallyThebuildfarmispoweredbythePythonpackageAfterinstallingit:

Debianpackagepython-ros-buildfarmPyPIros_buildfarm

Youcanrun:<manyargs>

<manyargs><manyargs>

toeasilyreproduceresultsofthebuildfarmrun"jobs"foranytargetplatform(withinDocker)locally

ros_buildfarm

generate_devel_script.pygenerate_doc_script.pygenerate_release_script.py

Page 25: The ROS build farm...The ROS build farm What it can do for me (And how it does it) Oct. 9th 2016 Dirk Thomas ROSCon 2016, Seoul, Korea build.ros.org Create easy-to-install packages

TestAcrossMultipleRepos①Youmakerelatedchangesindifferentrepos,e.g.

repoA:addanewAPIrepoB:usethenewAPI→Thedevel/PRjobswon'tworkforthiscase☹

repoA:passesbutdoesn'treallycheckthenewAPIrepoB:failsbecauseit'susingthelastreleasedversionofA

②YouwanttocheckifyourchangesbreakanydownstreampackagesrepoA:makesomechangesrepoB:checkthatthetestsforthelastreleasedversionstillpass→Thedevel/PRjobsdon'tcoverforthiscaseeither☹

Page 26: The ROS build farm...The ROS build farm What it can do for me (And how it does it) Oct. 9th 2016 Dirk Thomas ROSCon 2016, Seoul, Korea build.ros.org Create easy-to-install packages

Prerelease"Job"

underlayworkspace

overlayworkspace

Selectedsourcerepos

DepsfromDebianpkgs

Selectedoverlayrepos

Implicitoverlayrepos

prerelease.ros.org

Page 27: The ROS build farm...The ROS build farm What it can do for me (And how it does it) Oct. 9th 2016 Dirk Thomas ROSCon 2016, Seoul, Korea build.ros.org Create easy-to-install packages

SupportedTargetsThebuildfarmcanproducebinarypackagesfor

Ubuntu,Debianamd64,i386,arm64,armhf

Wecan'tcoverallcombinations( ),forKineticwecoverUbuntu:Xenial&Wilyamd64&i386,Xenialarm64&amrhfDebian:Jessieamd64&arm64

Bloomalsogeneratesmetainformationforrpm(Fedora)Butwedon'tbuildbinarypackages(yet?)

IfyouwanttocreatebinariesforanotsupportedtargetTalktous(<hint>donationscancoverthecostfortheneededresources )

Contributecodetoautomatebuildingbinariesfornewtargetsor[seenextslide]

Page 28: The ROS build farm...The ROS build farm What it can do for me (And how it does it) Oct. 9th 2016 Dirk Thomas ROSCon 2016, Seoul, Korea build.ros.org Create easy-to-install packages

YourOwnBuildFarmUsecases

BuildadifferentOSname/OScodename/architecturecombinationProcessprivaterepositories

YouwillneedyourownrosdistrodatabaseTrymodifiedversionofthebuildfarm

Twostepprocess[ ]1. Provisionmachines:

Jenkinsmaster,Apachewebserver,Buildslaves2. GeneratetheJenkinsjobs

Many

Expectcontinuouseffort

wiki.ros.org/buildfarm

configurationoption

Page 29: The ROS build farm...The ROS build farm What it can do for me (And how it does it) Oct. 9th 2016 Dirk Thomas ROSCon 2016, Seoul, Korea build.ros.org Create easy-to-install packages

WhatCanYouDoRegisteryourrepositories

adddocentrytogeneratedocumentationcreateawikipageforyourpackages

addsourceentryfordeveljobsandeasycloningforusersifthedeveljobfails,don'tremovetheentry,onlydisablethejob:

e.g.yourrepodependsonotherpackageswhicharenotreleasedconsiderenablingpullrequesttestingreleaseyourpackages,alsointonewerROSdistros

WatchoutfornotificationemailsfromJenkinsreadit,searchfortheproblem,trytofixit,askforhelpasalastresort:disablethejob,blacklisttarget,removetherelease

test_commits:false

Page 30: The ROS build farm...The ROS build farm What it can do for me (And how it does it) Oct. 9th 2016 Dirk Thomas ROSCon 2016, Seoul, Korea build.ros.org Create easy-to-install packages

Troubleshooting"Itworkslocallybutthejobfails"→somethingmustbedifferent

Haveyoutriedusing`catkin_make_isolated`?Mostcommonlyyouhaveadependencyinstalledbutthebuildfarmdoesn't.Checkthedeclareddependencies.

"Thedeveljobpassedbutthereleasefailed"Inadeveljoballpackagessharethesamecontainer.Onepackagemightdeclareadependencyanotherpackageuseswithoutdeclaringititself.

Expect(veryrarely)allkindsof"hicups"aptupdatefailingsincetherepositoryisbeingmodifiedconcurrentlynetworkproblems,GitHubresettingtheconnection,anhttprequestnotbeinghandled,...Ifyourproblempersistsit'sprobablynotsuchahicup

CMakeErrorat/opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:83(find_package):Couldnotfindapackageconfigurationfileprovidedby"<pkg_name>"

Page 31: The ROS build farm...The ROS build farm What it can do for me (And how it does it) Oct. 9th 2016 Dirk Thomas ROSCon 2016, Seoul, Korea build.ros.org Create easy-to-install packages

Questions...

Formoreinformationgoto:github.com/ros-infrastructure/ros_buildfarm