ReleaseEngineering/How To/Move a Slave Between Production and Staging

From MozillaWiki
Jump to: navigation, search


Changes in slavealloc

https://secure.pub.build.mozilla.org/slavealloc/ui/#slaves

Find a slave of the required type that is not currently running a build/test. I tend to select the first available slave at either the start or end of the numerical range, rather than a slave from the middle of the range. You can click on the link in the "Current" attribute column to check the current status of the slave on the buildbot master to which it is attached. If you can't find a slave that is already idle, or you want a particular slave, click on the "Graceful Shutdown" button for the slave on its buildbot master page.

If you're planning to hook the slave up to a personal or development master, change the "Locked Master" attribute in slavealloc for your slave to the appropriate master.

If you don't need the slave to run buildbot, just uncheck the "Enabled" box in slavealloc.

I find it easiest to setup my personal development master to use the same slave connection passwords as production. This minimizes the number of changes needed for moving production->staging. However, if you choose to use staging credentials, you should also change the "Environment" attribute of your slave to "dev/pp."

Puppet changes

If you need to make puppet changes, follow the for pinning a slave to your own puppet environment.

Cleaning

If you don't need the slave to run buildbot, you may want to run some of the cleaning tasks we run as buildduty when loaning slaves. These tasks disable things like runner which may try to reboot the machine on you.

ssh keys

Test machines don't have ssh keys, but if you need to test the behavior of uploads from build or try servers, you'll need to swap in the staging ssh keys that are stored in the releng private repo in the private/keys/staging-keys.tar.bz2.gpg. If you don't have access to this file, have someone else in releng re-sign the file so you can use it.

When unpacked, the tarball will provide a directory named .ssh-staging/. Here are the steps I use to switch in the staging keys:

cd ~
tar jxvf staging-keys.tar.bz2
mv .ssh .ssh-production
ln -s .ssh-staging .ssh

On Windows, you're safer to copy the directory rather than trying to symlink.

Reboot

Once all that is done, reboot the machine.

On POSIX systems:

sudo reboot

On Windows:

shutdown -r -f -t 0

When you're done

The safest course of action is to reclaim the slave the same way we would for loan. This generally means re-imaging the slave and undoing the buildbot changes above.