Wednesday, 2018-02-28

*** caphrim007_ has joined #openstack-jjb00:03
*** caphrim007 has quit IRC00:06
*** caphrim007_ has quit IRC00:08
openstackgerritAnil Belur proposed openstack-infra/jenkins-job-builder master: Add support for build status Job Filter plugin  https://review.openstack.org/54819600:40
*** caphrim007 has joined #openstack-jjb01:21
*** caphrim007 has quit IRC01:21
larainemathanks zxiiro, joined01:22
*** caphrim007 has joined #openstack-jjb01:22
*** caphrim007_ has joined #openstack-jjb01:26
*** caphrim007 has quit IRC01:29
*** caphrim007_ has quit IRC06:36
*** ckonstanski has quit IRC07:17
*** hashar has joined #openstack-jjb08:18
*** electrofelix has joined #openstack-jjb08:36
openstackgerritSorin Sbarnea proposed openstack-infra/jenkins-job-builder master: Update artifact_resolver to make use of convert_mapping_to_xml()  https://review.openstack.org/47399409:08
openstackgerritMerged openstack-infra/jenkins-job-builder master: Update dynamic_scriptler_param_common to use convert_xml()  https://review.openstack.org/47596809:14
ssbarneahttps://review.openstack.org/#/c/519340/ -- on python-jenkins but important for jjb.09:22
ssbarneaelectrofelix: ^^09:22
openstackgerritMerged openstack-infra/jenkins-job-builder master: Update artifact_resolver to make use of convert_mapping_to_xml()  https://review.openstack.org/47399409:27
electrofelixssbarnea: yeah, I've been uncomfortable about that patch as it's making folders look identical to jobs with no plan on how to distinguish them subsequently. To manage jobs/views in folders, you need to be able to create the folders before the jobs which is important for updating multiple jobs in parallel09:55
ssbarneaelectrofelix: in fact folders are special job (project) types09:56
electrofelixthey are but you cannot create a job nested in a folder without the parent folder existing09:56
ssbarneaelectrofelix: the issue about having to create folder before job is valid, but we can fix in the future09:56
electrofelixso you need a way to distinguish between them09:56
ssbarneaby auto-creating folders.09:57
ssbarneanow, is a know limitation, aka bug.09:57
electrofelixif fixing in the future means undoing that patch, then no that doesn't work either.. need a path to a solution identified first, doesn't need to be implemented09:57
electrofelixadding stuff doesn't mean you can remove it in the future, can that will break people, once it's in, it's in for a very long time09:58
ssbarneaelectrofelix: i doubt we need to undo this patch, i do find its API quite clear.09:59
ssbarneaelectrofelix: why we would have to change it?10:00
electrofelixin jjb, how do you plan to determine if a job folder exists that is required for a job? or determine whether actually it's a job that cannot contain others?10:01
ssbarneaelectrofelix: i was more concerned about the issue with multibranches because sub-jobs of multibranch are not real jobs, cannot be configured individually.10:01
electrofelixthen don't include the two patches together10:01
ssbarneaelectrofelix: you mean that you are ok with previous patchset?10:03
ssbarneai think that we still need params to tell get_all_jobs what we are looking for. Do we want any "entity" that behaves like a job or we want to get all configurable jobs?10:04
ssbarneaclearly there is no way to delete a multibranch-branch-job using API because this is more of a "virtual-job".10:04
electrofelixI mean that if someone has a suggestion for how to distinguish folders in the future that will allow determining them sensibly without needing to make a change now (maybe that is just inspecting the class info which seems horrible to me, but if from app perspective it might be ok) then yes by all means lets land the previous iteration.10:05
electrofelixSimilarly it seems like it might be better to return all associated jobs and let the application decide how to handle the workflow multi branch project piece, assuming it returns enough info. The alternative is that for every unusual job or view type python-jenkins will need to add special handling, seems the wrong level?10:07
electrofelixssbarnea: does the original patch mean that the 'jobs' attribute gets exposed as part of the folder entries back to the calling application, I've a feeling it doesn't10:10
ssbarneaelectrofelix: ok, lets make changes atomic, one at a time. easy one https://review.openstack.org/#/c/548547/10:23
electrofelixssbarnea: I'm spinning up my test env to inspect what is returned, if it has the 'jobs' attribute exposed by default then I'm happy to approve10:25
*** electrofelix has quit IRC10:42
*** electrofelix has joined #openstack-jjb11:57
electrofelixssbarnea: confirmed we can use he attribute 'jobs' to distinguish a folder, next question, has anyone tested the behaviour of what happens when you say delete unmanaged jobs in jjb with this change applied?12:02
electrofelixI suspect the previous behaviour most likely was to ignore folders, now I suspect this would result in folders being deleted, which since jjb doesn't properly manage them, might be quite a surprise to anyone using jjb12:03
ssbarneaelectrofelix: nope, but i can test now. i considered these two unrelated.12:03
electrofelixgiven existing behaviour of jjb, it's likely most folders in use are not managed by jjb12:04
ssbarneaelectrofelix: can we first review/merge this https://review.openstack.org/#/c/87090/ ? it would help debugging the change above12:08
electrofelixdoes that need to be updated to call 'get_all_jobs()'? looks to sometimes use 'get_jobs()' https://review.openstack.org/#/c/87090/10/jenkins_jobs/cli/subcommand/list.py12:11
ssbarneaelectrofelix: good news, "jenkins-jobs delete myfolder/subfolder/deepjob" does the right thing.12:12
electrofelixssbarnea: btw, you can use 'git review -x 87090' to apply other changes12:12
ssbarneaelectrofelix: i know, but got too many to stack now, hopefully we will deal with them soon.12:12
ssbarneaalso "jenkins-jobs delete myfolder" works as expected, removing folder with all jobs included in it.12:14
ssbarneabut there is nothing special in python code about, everything is done by jenkins.12:15
electrofelixssbarnea: think https://git.openstack.org/cgit/openstack-infra/jenkins-job-builder/tree/jenkins_jobs/builder.py#n200 protects us from deleting unmanaged folders12:17
ssbarneaindeed12:19
electrofelixDoes that code cause issues for the multibranch stuff?12:21
*** electrofelix has quit IRC12:41
openstackgerritSorin Sbarnea proposed openstack-infra/jenkins-job-builder master: Update release to make use of convert_mapping_to_xml()  https://review.openstack.org/47992812:44
*** hashar is now known as hasharAway14:46
*** electrofelix has joined #openstack-jjb15:46
openstackgerritSorin Sbarnea proposed openstack-infra/jenkins-job-builder master: Add multibranch project-type  https://review.openstack.org/40394016:04
zxiirossbarnea: I think that entry.py line should be a separate patch to keep the patchset on topic imo16:10
ssbarneazxiiro: sure, will do that. are you going to be here the next hour?16:11
zxiirossbarnea: yeah I'm around all day. Wednesdays are (thankfully) quiet days for me.16:11
zxiiroelectrofelix: can you take a look at ssbarnea's multibranch patch? https://review.openstack.org/403940 I'd like your opinion on it and we're trying to get it in before the end of the week.16:12
ssbarneajust found a bug in it, give me few minutes to fix it before doing the review.16:13
openstackgerritSorin Sbarnea proposed openstack-infra/jenkins-job-builder master: Add multibranch project-type  https://review.openstack.org/40394016:15
openstackgerritSorin Sbarnea proposed openstack-infra/jenkins-job-builder master: Added main entry point  https://review.openstack.org/54864916:17
ssbarneazxiiro: now the bug is fixed. the trigger was not working correctly.16:20
zxiirossbarnea: FYI you shouldn't workflow +1 until we're ready to merge. (although to be fair that patch is pretty trivial so I think we can just merge it).16:20
zxiirossbarnea: we usually try to wait for 2x +2's CR before we merge a patch as best practice.16:20
ssbarneaok, i will keep in mind.16:20
zxiiroyep. np usually the 2nd person who +2's will +1 Workflow.16:21
zxiiroSometimes I just merge obvious patches like fixing typos or adding docs.16:21
ssbarneawe reached 25 open CRs on JJB, quite a record I think.16:22
ssbarneawell, i have a filter that lists only verified ones, others do not count.16:23
ssbarneazxiiro: this is one that you should find useful, https://review.openstack.org/#/c/87090/16:24
ssbarneawith this in, it would be easy to list (and eventually delete) all jobs that are not managed by jjb.16:26
zxiirossbarnea: there's a dashboard... let me find you the link16:28
zxiirossbarnea: I think it's this one https://review.openstack.org/#/projects/openstack-infra/jenkins-job-builder,dashboards/important-changes:important-changes-dashboard16:30
zxiirossbarnea: yeah i plan on verifying the list patch today16:31
zxiirossbarnea: it's been in my queue :)16:31
ssbarneathanks16:31
zxiirossbarnea: there was also this one https://review.openstack.org/#/projects/openstack-infra/jenkins-job-builder,dashboards/important-changes:review-inbox-dashboard16:31
zxiirobut looks like it's blank right now16:31
zxiiroprobably because we caught up with everythign that needs review16:31
openstackgerritMerged openstack-infra/jenkins-job-builder master: Added main entry point  https://review.openstack.org/54864916:36
electrofelixfor the multibranch patch I think that it should be split up to have the scm parts in the scm module and use dispatch to link in, also the style with the explicit setting of XML attrs instead of all being in the same call doesn't fit with the rest of the codebase16:55
*** hasharAway is now known as hashar17:04
zxiiroelectrofelix: oh yeah we also started a new mailing list just for jjb discussion https://groups.google.com/forum/#!forum/jenkins-job-builder17:05
*** caphrim007 has joined #openstack-jjb17:29
*** ckonstanski has joined #openstack-jjb17:40
*** hashar is now known as hasharDinner17:58
ssbarneaelectrofelix: the scm implementation from multibranch is not compatible with the ones from normal jobs. on clear example is gerrit which is supported only in multibranch.18:23
ssbarneaif i remember well even those overlapping have different representation at xml level.18:24
ssbarneathis is probably why original patch had "scm" under "multibranch" attribute instead of root.18:25
ssbarneaelectrofelix: here is the deal: classic modules map scm data into <scm> element but mutibranch one uses <sources><data><jenkins.branch.BranchSource>...18:38
ssbarneaimplementations are very different, i check "git" one, and they seem to have almost nothing in common.18:40
ssbarneaI could create a "sources" module and move the scm part there, but I doubt I cam make "scm" module produce two very different xml formats.18:41
ssbarneaor if I do, it will be a total mess18:41
electrofelixssbarnea: last time I checked, these plugins also work with the pipeline jobs, basically anything that supports the jenkins DSL, and the git one is the same between both the multibranch and freestyle meaning any options in the normal git scm are avaialble in the multibranch pipeline workflow project as well AFAICS19:04
electrofelixWhile we can't define them for the pipeline ones via jjb, it looks like these are intended to become the standard way to use SCMs, but maybe it's only limited to the git one being avilable for both19:05
ssbarneaelectrofelix: not true for multibranch, i checked 5mins ago.19:06
ssbarneayes, scm implementation is comatible between freetyle, pipeline, and others, but not mutibranch ones.19:06
ssbarneamultibranch ones are using "branch-api" plugin, which uses this <sources>19:07
ssbarneainitially I didn't understand why, but it starts to make some sense, classic scm always reffered to a specific branch to build.19:07
ssbarneasources, is more flexible, as it has rules for how to get the list of branches (which is dynamic), CRs, PRs,...19:08
electrofelixok, but you'll note that the current multibranch code is missing all the options supported for git repos, but within Jenkins UI you can access them all19:09
electrofelixso it's using the same git plugin behind the scenes for all of them, with the multibranch having additional options on top19:10
ssbarneain fact neither of us is right, is something in-between. some options are common/shared, some are unique to each others.19:13
electrofelixwonderful, that sounds like the worst of both worlds, so that means we need to move some of the git options in the scm module into a common helper function and reference from both?19:14
ssbarneafreestyle git: has branches to build unique, supports multiple repositories (instead of only one). some Behaviours (traits) are shared, but some are unique.19:14
ssbarneathe "Additional Behaviours" is is hard to compare, but is clearly different from one to another.  GIT behaviours: "Discover branches", "Filter by <...>" seem to be available only to mutibranch-git repos.19:19
ssbarneathe behaviour dropdown drives me crazy...19:19
ssbarneathere are 20+ options listed there, cannot even copy/paste them, cannot screenshot, html source is a mess.19:20
ssbarneaelectrofelix: what would you recommend?19:21
electrofelixclean up the existing patch, add a subsequent patch to move the scm entries out to separate functions within that file, and then look to build a list of what options are common for the git plugins between freestyle and multibranch pipeline and see if there is anything that obviously separates them from other the options?19:33
openstackgerritSorin Sbarnea proposed openstack-infra/jenkins-job-builder master: Add multibranch project-type  https://review.openstack.org/40394019:42
electrofelixbtw, why did you need '__main__' on the cli entry point?19:43
zxiirossbarnea: I think I am caught up on the code reviews but let me know if there's something that needs looking at. I see you guys have been hashing out the multibranch patch.19:51
ssbarneaelectrofelix: i needed it in order to make pycharm debuger load the module as cli. so I could set a breakpoint anywhere and just run the custom cli I wanted.19:53
ssbarneasomehow it didn't want to start without having a main on the module19:53
ssbarneaelectrofelix: see http://s3.sbarnea.com/ss/RunDebug_Configurations_2018-02-28_19-55-59.png19:56
ssbarneathere is no option to tell it which function from the module to run, it would fail without a main19:57
electrofelixah, I see, guessing you didn't try configuring pycharms to use ~/.tox/py27/bin/python and a test configuration to call 'jenkins-jobs' with it?20:05
*** electrofelix has quit IRC20:17
*** major12 has joined #openstack-jjb20:34
major12Hello20:36
major12Is there a good example how to group job templates ?20:37
major12I've just started with jjb and have something like - job-template:     !include: 1.yaml  - job-template:     !include: 2.yaml  - job-template:     !include: 3.yaml  - job-template:     !include: 4.yaml20:38
major12https://gist.github.com/anonymous/23285a6303afbebdd2e9dd9768dbcf4f20:39
major12It looks bad since some configs will include 20-30 templates20:39
zxiiromajor12: I think you're looking for job groups? https://docs.openstack.org/infra/jenkins-job-builder/definition.html#job-group20:40
major12Can job templates be placed inside job group?20:41
zxiiromajor12: yes that's the entire purpose of a job group. to put job templates inside of them.20:43
zxiiromajor12: then in your project definition you just call the job-group once and it pulls in all of the job templates.20:43
major12hmm... documentation says that jobs can be placed in job groups20:44
major12do you have example of config?20:44
zxiiromajor12: the example in that docs are using job-templates20:44
major12in doc @ your link only jobs are inside job group. job templates are still on root level of yaml config20:46
zxiiromajor12: the job group are defining job templates take a look at the names20:46
zxiiromajor12: the first job template is called "{name}-unit-tests" and the job group lists  "{name}-unit-tests" in it's list. it's using a job-template20:47
zxiiromajor12: when you call {name}-unit-tests. you're telling JJB to loko up the job template named {name}-unit-tests and pull it into your job group.20:48
zxiiromajor12: I think you're confusion might be that the "job-group" has a "jobs" definiton. that jobs definition includes job-templates. it doesn't mean single jobs. You can define both job-templates and jobs in them.20:50
major12Cool20:53
major12I will try now20:53
major12what key should be used in job-group? for jobs we have key "jobs:"20:58
major12this one is not wortking https://gist.github.com/anonymous/11872f78fa0813cec347c1366c8c107621:00
major12no syntax errors but no jobs rendered21:00
zxiiromajor12: you're still getting it wrong. look at the example again21:05
zxiiromajor12: DO NOT declare at "job-templates inside of the job group21:05
major12I want to move job template definitions out from main yaml config21:06
major12now I can do that in way shown here https://gist.github.com/anonymous/23285a6303afbebdd2e9dd9768dbcf4f21:06
zxiiromajor12: if i use your examlpe. this is how you should code it https://pastebin.com/1t8X6bx221:06
major12and this looks "not so perfect" to me since for 20 job templates I will have 60 lines in config21:07
zxiiromajor12: then split it into several files21:07
major121 for constant "- job-template"21:07
zxiiromajor12: you don't have to define everything in 1 file21:08
zxiiromajor12: we have over 2500 jobs defined in our system. We organize it by project and many projects reuse the same 20 or so job-templates defined in global-jjb https://github.com/opendaylight/releng-builder/tree/master/jjb21:10
zxiiromajor12: use the file system to your advantage and organize your repo so that you don't have to define 20 job templates in one file :)21:10
*** hasharDinner has quit IRC21:11
major12Do you include all the job-templates every time? Or your configuration is a little bit separated - one part in jjb configs and second in bash (command line parameters for jjb run) ?21:15
zxiiromajor12: no you only declare job templates once jjb will find it as long as it's in the directory.21:16
zxiiromajor12: in all of your project definitions you just state the name of the job-template21:17
zxiiromajor12: think of "job-templates" and "macros" as libraries you can pull into a "project" section.21:17
zxiiromajor12: declare once, use x times everywhere else.21:17
major12I understand that templates are declared once. Let me rephrase a little. When our deploying the jobs you are pointing jjb to folder with all job templates or just to specific file/folder which contain templates only for this project ?21:21
zxiiromajor12: jenkins-jobs supports a recursive option. As long as you organize all of your files inside the same top level directory it will find all of hte files. you just run jjb once21:22
zxiiromajor12: I recommend making a git repo just for jjb definitions and have all of your users work against that repo.21:23
zxiiromajor12: then you can have jjb run against the repo to deploy all of the jobs in that repo.21:23
major12Yes sure. I'm concerned that e.g. I have 2 projects with some common code base of templates. And if first project will commit something bad to common/ (like job intead of job-template) this might affect secont project. So code review should be "must" to avoid such situations21:26
zxiiromajor12: that's why we put it into a git repo and setup verify jobs to validate syntax and have committers review the code21:27
zxiiromajor12: you should have a team of folks with deep understanding of the jobs perform code review on changes21:27
zxiiromajor12: here's an example. https://git.opendaylight.org/gerrit/#/q/project:releng/builder21:29
zxiiromajor12: releng/builder is our jjb repo for our project and every chagne to jjb is code reviewed by a person and verified by Jenkins21:29
zxiiromajor12: we also make global-jjb available as an open source project in case we have some of our reusable job templates might be useful for you http://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/index.html#lfreleng-global-jjb21:31
zxiiromajor12: The CI jobs contain jobs for verifying and merging jjb21:31
zxiirojob templates*21:31
zxiirowe're also working on some jobs for managing global jenkins configuration that JJB cannot manage.21:32
major12Thanks a lot for your help !21:33
major12Could you recoment some tool for main jenkins config ?21:34
zxiiromajor12: I'm not aware of any. that's why we started developing those CI jobs in the link I gave you.21:35
zxiirocurrently the jenkins-cfg job only supports global jenkins variables but I'm about to finish up a patch to let us manage openstack cloud plugin configuration.21:36
major12We always can browse XML by python and update some nodes based on our config - but it would be great to have more standard solution21:37
major12Thanks a lot one more time !21:41
zxiiromajor12: np and good luck!21:41
*** major12 has left #openstack-jjb21:42
*** jplf has quit IRC23:18
*** jplf has joined #openstack-jjb23:22
*** zxiiro has quit IRC23:26
*** abelur has quit IRC23:26
*** abelur has joined #openstack-jjb23:27
*** zxiiro has joined #openstack-jjb23:28
*** caphrim007 has quit IRC23:50
*** caphrim007_ has joined #openstack-jjb23:51

Generated by irclog2html.py 2.15.3 by Marius Gedminas - find it at mg.pov.lt!