wiki:RunningBuildbotOnWindows

Version 25 (modified by Almad, 6 years ago) (diff)

Adding .py to buildbot_service command

Many people use Buildbot Windows slaves, not sure if anyone uses Windows as the master (seems to be Linux, generally) - actually a few people do, see below.

Ben Hearsum has begun work on an NSIS slave Installer, which installs all needed Buildbot dependencies (Python, Twisted, ZopeInterface) and prompts the user for the info to fill in the .tac file (buildmaster:port, username, password).

 Preliminary Mozilla doc on WinXP setup


Buildbot on Windows - Installation Instructions.

Notes:

  • These have been tested with Windows XP & Vista.
  • Author:
    • Will Wilson willw -at- fireflyworlds -dot- com.
  • Reviewers
    • Build master section
      • no one yet....
    • Build slave section
      • Terry Rankine terry.rankine -at- csiro -dot- au.
    • Service section
      • Terry Rankine terry.rankine -at- csiro -dot- au.

Windows Requirements:

Windows Installation:

  1. Install Python.
  2. Add c:python24 and c:python24scripts to the system PATH.
  3. Add .py to PATHEXT to enable python files to be executed. Test it in a NEW command prompt window.
    echo %PATHEXT%
    
  4. Install the Python Win32 extensions.
  5. Install the twisted framework.
  6. Try testing the twisted installation at the command prompt. Make sure it shows the correct version of Twisted (2.4.0).
    trial --version
    
    1. if you got this - see step 2....
      C:Documents and Settingsuildslave>trial --version
      'trial' is not recognized as an internal or external command,
      operable program or batch file.
      
  7. Change directory to the buildbot pre-install folder (the unziped file)
    cd c:<path to extracted buildbot zip folder>
    
  8. Install buildbot by typing from the buildbot install folder.
    python setup.py install
    
  9. Edit the buildbot.bat file now found in C:python24scripts to contain the correct script path (it points at c:python23 by default).
    <favourite editor... wordpad.exe> C:python24scriptsuildbot.bat
    
  10. Open a command prompt and check buildbot version information, hopefully returning the version numbers if everything went well.
    buildbot --version
    

Windows build master setup

Prerequisites:

  • Install Buildbot and its dependencies.
  • Use the Buildbot manual for reference.

Setup process:

  1. Create a settings directory for build master state. Make sure it's accessible to the build user and reflects the name of the project.
  2. Create a master to initialise buildbot state in the given folder.
    buildbot create-master <dir-path>
    
  3. Create a master.cfg file in the new master directory (use the master.cfg.sample for hints). This will hold the configuration script for the build master.
  4. Setup the master configuration as needed (more details to come).
  5. Start the build master.
    buildbot start <dir-path>
    
  6. Check the twistd.log in the build master folder for errors or warnings.
  7. Assuming the master launched successfully, it should now be hosting its waterfall page (usually at  http://localhost:8010/).
  8. You may want to get a better style sheet for the waterfall display, to do this just adjust "html.Waterfall(..., css='c:\buildbot.css')" in the master.cfg.

Windows build slave setup

Prerequisites:

  • Install Buildbot and its dependencies.
  • Use the Buildbot manual for reference.

Setup process:

  1. Setup a build slave account for the build slave process.
  2. Create a settings directory for build slave state. Make sure it's accessible to the build slave user and reflects the name of the project. Something like "bbslave_myproject" would do.
  3. Get the host name and port (default: 9989) for the build master.
  4. Get the assigned name and password for this build slave.
  5. Initialise buildbot state in the given folder.
    buildbot create-slave <slave-dir-path> <master-name>:<master-port> <slave-name> <slave-password>
    
  6. Edit <slave-dir-path>/info/admin and enter your name and email address (as you are the administrator of this build slave).
  7. Edit <slave-dir-path>/info/host file and enter details and technical specifications for the system running the build slave. (OS, user, slave-dir, intalled pre-reqs and versions)
  8. Now launch the build slave process. If you have problems, check the twistd.log found in the build slave directory for errors and warnings.
    buildbot start <slave-dir-path>
    
  9. You should now be able to see your slave bot listed on the waterfall page on the build master.

Windows Buildbot service setup

Prerequisites:

  • Install Buildbot and its dependencies.
  • Create a working Buildbot master and/or slave installation (see above).
  • Use the Buildbot manual for reference.

Setup process:

  1. Run a command line (under Vista run it as administrator).
  2. Test that the service installer python file was installed. It should have been installed to the c:python24scripts folder.
    python <python-dir>scriptsuildbot_service.py
    
  3. Add permission to allow the builder user to "Log on as a service" for this go to
    Administrative Tools -> Local Security Settings -> User Rights Assignment. 
    
  4. Enter
    python buildbot_service.py --user YOURDOMAINuilduser --password <theuserspassword> --startup auto install 
    
    1. If you get an error about the account not existing - make the user look like this .username
      C:Documents and Settingsuildslave>buildbot_service.py --user buildslave --password buildTHIS --startup auto install
      Installing service BuildBot
      Error installing service: The account name is invalid or does not exist, or the
      password is invalid for the account name specified. (1057)
      
      C:Documents and Settingsuildslave>buildbot_service.py --user .uildslave --password buildTHIS --startup auto install
      Installing service BuildBot
      Service installed
      
  5. Add full permissions for the builder user to registry key HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesBuildBot.
  6. Add full permissions for the build user to the buildbot configuration directories.
  7. Enter
    buildbot_service.py start "c:/<buildbot_dir>" "d:/<another_buildbot_dir>" 
    
  8. It should now be up and running, to check for issues consult the event viewer and the twistd.log files.
  9. Once complete the service should start with the machine.

Troubleshooting Service Install:

  • Exceptions during startup are logged in the Event Viewer, under the "Application" log.
  • When using Buildbot 0.7.6, and Twisted 2.5.0 or later, ticket #53 may apply (even if you were able to start buildbot from the command line).
  • When installing on Windows Vista Family edition, user rights can not be managed using the Administrative Tools. This tool can be used to grant your buildbot user the "Logon as Service" right (based on Microsoft's knowledge base article 132958). Usage: addLogOnAsServiceRight username
  • When running buildbot as a service using the instructions above on Windows Server 2003, SVN hangs during the update process (unclear as to why). Also after stopping the service, SVN isn't terminated properly, which may cause subsequent headaches. Running "buildbot start ." works well and the instructions at  http://ascendwiki.cheme.cmu.edu/BuildBot also work.

Another useful instruction is  Installing a Buildbot service on Windows at ASCEND wiki.

Attachments

  • addLogOnAsServiceRight.zip Download (22.3 KB) - added by eric.brayet 6 years ago. Command line tool to give a user the "Logon as Service" right (based on Microsoft's knowledge base article 132958)