<div dir="ltr"><div>Hi Pierre</div><div>Thank you for the quick and comprehensive reply.</div><div>I deducted the second solution a couple of hours ago, but it is important for me that my insights are convergent with your, professional, analysis.</div><div>Thanks a lot.<br></div><div>Regards</div><div>Tomasz</div></div><br><div class="gmail_quote"><div dir="ltr">niedz., 25 gru 2016 o 22:27 użytkownik Pierre Tardy <<a href="mailto:tardyp@gmail.com">tardyp@gmail.com</a>> napisał:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">Hi thomas,<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Buildbot bootstrap is based on Twisted's ".tac" files, which are expected to be started  using twistd -y buildbot.tac.</div><div class="gmail_msg">The "buildbot start" script is actually just a convenience wrapper around twistd. It actually just run twistd, and then watches for the logs to confirm buildbot successfully started. There is no value added beyond this log watching, so it is not strictly mandatory to start buildbot with buildbot start.</div><div class="gmail_msg">You can just start it with twistd -y buildbot.tac.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">As you pointed up the official docker image is starting buildbot with twistd -ny buildbot.tac</div><div class="gmail_msg">If you look at the help of twistd, -y means the Twisted daemon will run a .tac file, and the -n means it wont daemonize.</div><div class="gmail_msg">This is because docker is doing process watching by itself, and do not want its entrypoint to daemonize.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">The buildbot start command also has a --no-daemon option, which really only is 'exec'ing to twistd -ny.</div><div class="gmail_msg">So for your dockerfile, you can as well us twistd -ny or buildbot start --no-daemon, this will work the same.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Another Docker specific is that the buildbot.tac is different. It configured the twistd logs to output to stdout instead of outputing to twisted.log.</div><div class="gmail_msg">This is because docker design expects logs to be in stdout so that you can configure any fancy cloud log forwarder independently from the application's tech.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Regards</div><div class="gmail_msg">Pierre</div></div><br class="gmail_msg"><div class="gmail_quote gmail_msg"></div><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">Le dim. 25 déc. 2016 à 14:32, Tomasz Urbański <<a href="mailto:utom.pl@gmail.com" class="gmail_msg" target="_blank">utom.pl@gmail.com</a>> a écrit :<br class="gmail_msg"></div></div><div class="gmail_quote gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><div dir="ltr" class="gmail_msg">Hi,<div class="gmail_msg">I'm trying to compose the simplest possible docker master image that runs buildbot start in ENTRYPOINT/CMD.</div><div class="gmail_msg">I've tried to use a lot of combinations of 'dumb-init', 'gosu' and 'exec', but with no success.</div><div class="gmail_msg">The situation is as follows:</div><div class="gmail_msg">1) When I try to run deamonized buildroot with the command 'docker run -d -v $local/vol/bldbot/master:/var/lib/buildbot buildbot-master-test ', the container starts successfully, but is is terminated abruptly. The log looks as follows:</div><div class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">[timestamp] [-] Log opened.<br class="gmail_msg"></div><div class="gmail_msg">[timestamp] [-] twistd 16.0.0 (/usr/bin/python 2.7.12) starting up.</div><div class="gmail_msg">[timestamp] [-] reactor class: twisted.internet.epollreactor.EPollReactor.</div><div class="gmail_msg">[timestamp] [-] Starting BuildMaster -- buildbot.version: 0.9.2</div><div class="gmail_msg">[timestamp] [-] Loading configuration from '/var/lib/buildbot/master.cfg'</div><div class="gmail_msg">[timestamp] [-] Setting up database with URL 'sqlite:/state.sqlite'</div><div class="gmail_msg">[timestamp] [-] setting database journal mode to 'wal'</div><div class="gmail_msg">[timestamp] [-] doing housekeeping for master 1 c8aa8b0d5ca3:/var/lib/buildbot</div><div class="gmail_msg">[timestamp] [-] adding 1 new changesources, removing 0<br class="gmail_msg"></div><div class="gmail_msg">[timestamp] [-] adding 1 new builders, removing 0</div><div class="gmail_msg">[timestamp] [-] adding 2 new schedulers, removing 0</div><div class="gmail_msg">[timestamp] [-] No web server configured on this master</div><div class="gmail_msg">[timestamp] [-] adding 1 new workers, removing 0</div><div class="gmail_msg">[timestamp] [-] PBServerFactory starting on 9989</div><div class="gmail_msg">[timestamp] [-] Starting factory <twisted.spread.pb.PBServerFactory instance at 0x7f2cca079b00></div><div class="gmail_msg">[timestamp] [-] BuildMaster is running</div></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">2) When I run the container in the interactive mode with the command 'docker run --rm -it -v $local/vol/bldbot/master:/var/lib/buildbot buildbot-master-test  /bin/sh' and next I run the command 'buildbot start' all works like charm.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I've already studied the content of official buildbot master docker image, tj.  'buildbot/buildbot-master'. I see that authors decided to use the command 'exec twistd -ny $B/buildbot.tac' in start_buildbot.sh.<br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">So the question is, how to compose the ENTRYPOINT/CMD instructions in the Dockerfile that runs simply buildbot start.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">See also discussion and further details on <a href="http://stackoverflow.com/questions/41299608/daemonized-buildbot-start" class="gmail_msg" target="_blank">Stack Overflow</a></div></div></div></blockquote></div><div class="gmail_quote gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
_______________________________________________<br class="gmail_msg">
users mailing list<br class="gmail_msg">
<a href="mailto:users@buildbot.net" class="gmail_msg" target="_blank">users@buildbot.net</a><br class="gmail_msg">
<a href="https://lists.buildbot.net/mailman/listinfo/users" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.buildbot.net/mailman/listinfo/users</a></blockquote></div>
</blockquote></div>