Changes between Initial Version and Version 1 of Meetings/MacPortsMeeting2018/BuildbotRestructuring


Ignore:
Timestamp:
Mar 13, 2018, 10:20:19 AM (6 years ago)
Author:
neverpanic (Clemens Lang)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Meetings/MacPortsMeeting2018/BuildbotRestructuring

    v1 v1  
     1= BuildBot Restructuring
     2
     3== Original Problem
     4When designing the new buildbot at the last MacPorts Meeting in 2016, we tried to achieve the following picture for each commit:
     5
     6{{{
     7 +---------------+
     8 |    commit     |
     9 +---------------+
     10 |    prepare    |
     11 |   resources   |
     12 +---------------+
     13 |   port dep1   |
     14 +---------------+
     15 |   port dep2   |
     16 +---------------+
     17 |      ...      |
     18 +---------------+
     19}}}
     20
     21Where port dep1, port dep 2, etc. are dependencies of the port actually changed in the commit and are scheduled in dependency order. We did not end up doing this, because it requires the ability to dynamically add steps, which buildbot 0.8 does not support yet. We would have had to switch to buildbot >= 0.9 for this to work.
     22
     23We then attempted to emulate the same by introducing the portwatcher and triggering builds from the portwatcher on a separate portbuilder builder, to emulate the same picture:
     24
     25{{{
     26 +--------------+
     27 |   commit     |
     28 +--------------+
     29 |   scheduler  |
     30 +--------------+
     31 |   prepare    |         +---------------+
     32 |  resources   |  ---->  |   port dep1   |
     33 +--------------+         +---------------+
     34                          |   port dep2   |
     35                          +---------------+
     36                          |   port dep3   |
     37                          +---------------+
     38}}}
     39
     40Unfortunately this did not work either, because we could not get buildbot to schedule builds in the order we triggered them (#52766). To work around this, we introduced the `mpbb install-dependencies` step:
     41
     42{{{
     43 +--------------+
     44 |   commit     |
     45 +--------------+
     46 |   prepare    |
     47 |  resources   |
     48 +--------------+         +---------------+
     49 |   scheduler  |  ---->  |  port1 deps   |
     50 +--------------+         +---------------+
     51                          |  port1 build  |
     52                          +---------------+
     53                          |  port2 deps   |
     54                          +---------------+
     55                          |  port2 build  |
     56                          +---------------+
     57}}}
     58
     59== Ryan's proposal
     60Ryan asked us to get rid of the separate portwatcher & portbuilder jobs and re-configure the remaining job to interleave the two types of actions. As we understood it, this was to solve the following problem:
     61
     62 - A commit for portA comes in
     63 - portwatcher for this commit schedules a portbuilder job for portA
     64 - This build takes a long time
     65 - While the build is still running, a new commit for the same port arrives, which queues a portwatcher job
     66 - Another commit for the same port arrives, which queues another portwatcher job
     67 - When the portbuilder job finishes, a useless build is scheduled for portA.
     68
     69He proposed the following to solve this:
     70
     71{{{
     72 +---------------+
     73 |    commit1    |
     74 +---------------+
     75 |    prepare    |
     76 |   resources   |
     77 +---------------+
     78 |   scheduler1  |
     79 +---------------+
     80 +---------------+
     81 |   port1 dep1  |
     82 +---------------+
     83 +---------------+
     84 |   port1 dep2  |
     85 +---------------+
     86 +---------------+
     87 |    commit2    |
     88 +---------------+
     89 |    prepare    |
     90 |   resources   |
     91 +---------------+
     92 |   scheduler2  |
     93 +---------------+
     94 +---------------+
     95 |   port1 dep2  |
     96 +---------------+
     97 +---------------+
     98 |     port1     |
     99 +---------------+
     100 +---------------+
     101 |   port2 dep1  |
     102 +---------------+
     103 +---------------+
     104 |   port2 dep2  |
     105 +---------------+
     106 +---------------+
     107 |     port2     |
     108 +---------------+
     109}}}
     110
     111Unfortunately that introduces the problem with the prepared shared resources (like the portindex, mpbb checkout, ports tree), because we really cannot change the portstree while we have build scheduled in a dependency order that was computed from the old ports tree. This would cause seemingly random and hard-to-debug problems if a follow-up commit changes dependencies of ports.
     112
     113If we were to wait for the steps planned by the first scheduler to finish, we would end up in the same situation as outlined at the beginning, which was our initial approach, but only works with buildbot >= 0.9.
     114
     115To avoid the problem outlined by Ryan, we could also just enable build merging on the portwatcher, which would avoid the spurious builds.
     116
     117== Alternative Solutions
     118We could also try setting up buildbot 1.0 and just fix the UI, rather than working around 0.8's limitations with hacks.
     119
     120Also, #52766 is solved now, enabling us to schedule builds in-order, so we could also implement this approach again:
     121
     122{{{
     123 +---------------+
     124 |    commit     |
     125 +---------------+
     126 |   scheduler   |
     127 +---------------+
     128 |    prepare    |         +---------------+
     129 |   resources   |  ---->  |   port dep1   |
     130 +---------------+         +---------------+
     131                           |   port dep2   |
     132                           +---------------+
     133                           |   port dep3   |
     134                           +---------------+
     135}}}
     136
     137The approach with two separate builders is always affected by #53587 (a restart of the buildmaster will trigger pending portwatcher and portbuilder jobs at the same time), though.