46

AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

  • Upload
    others

  • View
    11

  • Download
    0

Embed Size (px)

Citation preview

Page 1: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS
Page 2: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

AGENDAIntroductionWhatisoVirtBasicviewofoVirtInfrastructureReleaseflowGerrithooksJenkinsjobstypesJenkinsjobsbuilderPublishingbuildstoarepositoryserverFutureplansQuestions

Page 3: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

INTRODUCTIONWhoarewe?

KirilNesenko-InfrastructureMaintainerandreleaseengineer.ResponsibleforreleaseengineeringactivitiesforoVirtproject.

EyalEdri-InfrastructureMaintaineratoVirtandCIteamleadatRedHat.

Page 4: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

WHATISOVIRToVirtisavirtualdatacentermanagerDeliverspowerfulmanagementofmultiplevirtualmachinesonmultiplehostsUsesKVM,libvirtandvdsm.CanbeinstalledonFedora,CentOSorRHEL

Page 5: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

OVIRTARCHITECTURE

Page 6: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

OVIRTUI

Page 7: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

OVIRTINFRASTRUCTUREVIEW

Page 8: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

SERVICESProvisioning:ForemanConfiguration:PuppetArtifacts(mirror):ArtifactorySourceControl:gitCodeReview:gerritCI:JenkinsSlaves:VMs+BareMetalhostsVirtualization:oVirt,OpenStack

Page 9: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

RELEASEPROCESS

Page 10: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

COMMITLIFECYCLE

Page 11: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

OVIRTCONTINUOUSDELIVERYOnepublisherperversionUseagenericscripttopublishthebuilds

Page 12: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

PUBLISHERJOB

Page 13: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

PUBLISHERJOB

Page 14: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

GERRITWhatisGerrit?

Page 15: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

GERRIT:GITWEBCodehosting(gitfrontend)

Page 16: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

GERRITHOOKWhatisahook?

Foreachworkflowstep(event)ascriptgetsexecuted

Page 17: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

GERRITHOOKSDefaultgerrithooksflaws:

1event<->1hookSamehookforallprojectsFireandforget,nointeraction

Solution:

Buildadispatcher!

Page 18: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

GERRITHOOKS:TRIGGER

PatchCreatedCommentAddedChangeMergedChangeAbandonedReferenceupdated(moreonnewerversions)

Page 19: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

GERRITHOOKS:EVENTTYPE

ByparameterspassedWewillbeabletodetectcustomevents:

MaintainerapprovedTestspassedMaintainerblocked...

Page 20: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

GERRITHOOKS:LABELS

Comment

Bug-Url:http://mytracker/bugid

Rerun-Hooks:all

What?

Label:labelcontent

Where?

Commitmessage

Example:

Page 21: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

GERRITHOOKS:CHAINS

Hooknametemplate:

${event}.${chain}.${hook_name}${event}.${hook_name}${event}

UsingeventnameChainassecondtermifwantedHierarchicalconfigfiles

Mainoneat$gerrit_dirPerprojectPerevent

Page 22: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

GERRITHOOKS:EXECUTION

Everythingtologfile(configurable):

Eachhookcan:

INFO::STARTING::change-mergedDEBUG::get_hooks::change-mergedonvdsm.git/hooksINFO::::AVAILABLEHOOKS::['change-merged.set_MODIFIED','change-merged.update_tracker']

V:VERIFIEDSCORE\nR:REVIEWSCORE\nCOMMENT

Breakit'shookchainBreakwholeexecution

Commonstdoutformat(eachsectionisoptional):

Page 23: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

GERRITHOOKS:REVIEW

Sumofallthereviews:

negativeonesprevailoverpositivesnovotemeansnochange0meansresetnegativevalue

Executionsummaryofallthehooks:

Page 24: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

GERRITHOOKS:SOURCECODE

Patchesarealwayswelcome!

Git:gitclonegit://gerrit.ovirt.org/gerrit-admin

Web:http://gerrit.ovirt.org/gitweb?p=gerrit-admin.git

Page 25: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

GERRITHOOKS:LIBSSomesimplegenericlibsavailableforthehooks:

Bugzilla

Gerrit

Configuration

Tools

Bashlibusageexample:sourcebz.shsourcegerrit.shgerrit.parse_params"$@"#Setstheparametersintoglobalvars#getthebugidsinthecommitmessageofthecommitpassedas#parameter(--commitSHA)bug_ids=($(bz.get_bug_id"$commit"))

Pythonlibusageexample:fromgerritimportGerritfromconfigimportload_configconfig=load_config()##Loadstheconfighierarchicalyintoadictgerrit=Gerrit(config.get('GERRIT_SRV'))##Connecttothegerritinstance

Page 26: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

Modifybugstatuswhenallpatchesmerged

GERRITHOOKS:BUGZILLAUpdateexternaltrackerinbugzilla

Modifybugstatuswhenfirstpatchsent

Page 27: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

JENKINSJOBBUILDERProblemswithmanualconfiguration

HardtomaintainHardtotrackHardtoreviewHardtochangecommonsettings

Sometaskssoonbecomequitepainful:

...AddanextrascmtojobsforprojectsA,Band

C

NewbranchforprojectM,duplicateallit'sjobs

Disable all the jobs for aprojectTest a job configuration before

deploying

Page 28: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

JENKINSJOBBUILDER

JenkinsjobBuildertotherescue!

Page 29: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

JENKINSJOBBUILDERSomepluginsthathelpedalongtheway:

Managejobsstatuses:

Configurationdeduplication:

Matrixconfigurations

Multijobsconfigchanges:

Configurationslice

Configuationchangemanagement:

JobConfighistory

Scriptler

Page 30: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

JENKINSJOBBUILDER

DevelopedbyOpenStackfolks(Kudos!!)Configurationascode(yamlformat)Easytoreviewchanges(onGerrit!)Code/configde-duplicationIncludeexternalshell/groovy/...scriptsTestbeforedeployingEasiertoorganize(perdirectory,perfile)Servesasbackup(easilyreplicateonanotherjenkins)

Page 31: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

JENKINSJOBBUILDER

Thiswillcreatethejobs:projectA-whatever-fc19projectA-whatever-fc20

-job-group:name:projectAdist:-fc19-fc20jobs:-'{name}-wahtever-{dist}'

-job-template:name:'{name}-whatever-{dist}'node:'slave-{dist}'triggers:-timed:'@midnight'builders:-shell:makewhateverpublishers:-archive:artifacts:'*.log'

RunningatmidnighOnslave-fc19andslave-fc20Executing'makewhatever'Archivingthelogs

Page 32: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

JENKINSJOBBUILDER

Oh!ButIwanttoaddanewdistro,el6

-job-group:name:projectAdist:-fc19-fc20-el6jobs:-'{name}-wahtever-{dist}'

Andacleanupafter

-job-template:name:'{name}-whatever-{dist}'node:'slave-{dist}'triggers:-timed:'@midnight'builders:-shell:makewhatever-shell:makecleanpublishers:-archive:artifacts:'*.log'

Page 33: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

JENKINSJOBBUILDEROfficialOpenstacklinks:

Checkjob

Code:

Docs: Latestbuilddocs

Httpsgitrepo

oVirtlinks

Gityamlcodetree

Deployjob

Page 34: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

OVIRTJENKINSJOBTYPESTriggeredonlyonpatchsetsTriggeredonlyonmergesMatrixjobsCOPRjobs

Page 35: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

POLLSCMVSGERRITTRIGGERWeusegerrittriggerplugininsteadofpollSCMAllowstotestpatchesbeforemergeReducestheloadonthegerritserver

Page 36: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

MATRIXJOBSAllowstoconfigurethejobstorunondifferentconfigurations

Page 37: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

MATRIXRELOADEDAllowstorerunthejobonaspecificconfiguration

Page 38: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

COPRCreatedbyFedorafolksIsaneasytouseautomaticbuildsystemprovidingapackagerepositoryasitsoutputReducestheloadonjenkinsslavesCLI+Jenkinsplugin

yum-yinstallcopr-clicopr-clibuildvdsmhttp://jenkins.ovirt.org/view/vdsm-

Page 39: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

COPRJENKINSPLUGIN

Page 40: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

RELEASEPROCESS

Page 41: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

CURRENTPROBLEMS/FUTURESOLUTIONSScarceresources

MovingtoanewinfrastructureOS1(openstack)slaves

JobsmanagementandcontrolMovealljobstoyamlGetdeveloperstohelpwrite/maintainjobs

LeveragemanualproceduresAutomatetheofficialrelease+signingpackagesAutomategerritconfig/projectcreation

Page 42: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

CURRENTPROBLEMS/FUTURESOLUTIONSIsolatetestenvironments

Docker/mockonallsimplebuildsOneslaveperjoboncomplexbuilds

Provisioningofslavesondemand

Leveragepackagebuilds

BuildonCopr(hasjenkinsplugin!)

Page 43: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

QUESTIONS?

Page 44: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

USEFULLINKSoVirt

oVirtgerrit

oVirtJenkins

Copr

JenkinsJobBuilderCode

JenkinsJobBuilderDocs

YAMLcodetree

Page 45: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS

CONTACTUS

Page 46: AGENDA - CloudBees...Source Control: git Code Review: gerrit CI: Jenkins Slaves: VMs + Bare Metal hosts Virtualization: oVirt, OpenStack RELEASE PROCESS COMMIT LIFE CYCLE OVIRT CONTINUOUS