Actions

Buildslave Last Activity

class slaveapi.actions.buildslave_last_activity.buildslave_last_activity

Get the build slave state, last activity time, and uptime. Returns a dictionary of the form: {

‘last_state’: # unknown, booting, stopped, ready, running_command ‘last_activity_seconds’: # last activity age according to twistd.log, in seconds. ‘uptime’: uptime # machine uptime, in seconds.

}

Buildslave Uptime

class slaveapi.actions.buildslave_uptime.buildslave_uptime

Attempts to retrieve the build slave uptime (time since last reboot). This is done with the “uptime” command on Unix-based OS’s, and by running “net statistics server” on windows.

Create AWS Instance

class slaveapi.actions.aws_create_instance.aws_create_instance

Attempts to create an aws instance for a given owner

Parameters:
  • email (str) – the full ldap username of owner requesting instance
  • bug (str) – the number of the bug that needs the instance
  • instance_type (str) – accepted values are ‘build’ and ‘test’
  • disambig (int) – A numerical value to help uniquely identify this machine (useful when a user already has an instance but needs a new one of the same type)
Return type:

tuple

Disable

class slaveapi.actions.disable.disable

Attempts to disable the named slave from buildbot.

Details of what was attempted and the result are reported into the slave’s problem tracking bug at the end.

Disabling is done in a series of steps outlined below:

  1. Disable In Slavealloc: unchecks enabled box for slave in slavealloc

  2. Stop Buildbot Process: stops buildbot process by either a calling a

    graceful_shutdown or a more aggressive forceful reboot.

  3. Update Problem Tracking Bug: reopen problem tracking bug and leave

    comment if a ‘comment’ field was passed

Parameters:
  • name (str) – hostname of slave
  • reason (str) – reason we wish to disable the slave
  • force (bool) – force a reboot immediately instead of graceful_shutdown
Return type:

tuple

Reboot

class slaveapi.actions.reboot.reboot

Attempts to reboot the named slave a series of ways, escalating from peacefully to mercilessly. Details of what was attempted and the result are reported into the slave’s problem tracking bug at the end. Reboots are attempted through the following means (from most peaceful to least merciful):

  • SSH: Logs into the machine via SSH and reboots it with an appropriate command.
  • Mozpool: Connects to Mozpool and issues a reboot command. If the slave has no mozpool interface, this is skipped.
  • IPMI: Uses the slave’s IPMI interface to initiate a hard reboot. If the slave has no IPMI interface, this is skipped.
  • PDU: Powercycles the slave by turning off the power, and then turning it back on.
  • Bugzilla: Requests that IT reboot the slave by updating or creating the appropriate bugs.

Shutdown Buildslave

class slaveapi.actions.shutdown_buildslave.shutdown_buildslave

Attempts to gracefully shut down the buildslave process on the named slave. In order to support Windows, this must be done by contacting the Buildbot Master the slave talks to, and requesting the shut down there. (Slave-side graceful shutdown doesn’t work on Windows.) Once initiated, the shutdown is confirmed by watching the slave’s twistd.log file.

Start AWS Instance

class slaveapi.actions.aws_start_instance.aws_start_instance

Attempts to start an aws instance

Parameters:name – hostname of slave
Return type:tuple of status, msg

Stop AWS Instance

class slaveapi.actions.aws_stop_instance.aws_stop_instance

Attempts to stop an aws instance

Parameters:name – hostname of slave
Return type:tuple of status, msg

Terminate AWS Instance

class slaveapi.actions.aws_terminate_instance.aws_terminate_instance

Attempts to terminate an aws instance

Parameters:name – hostname of slave
Return type:tuple of status, msg