From MozillaWiki
Jump to: navigation, search

Hardware imaging instructions

  1. boot holding down "n"
  2. restore master on volume
  3. select talos-r3-snow-ref-v2.i386.hfs.dmg
  4. watch progress bar, wait for reboot
  5. in open cmd shell, as cltbld, type:
$ scutil --set HostName
$ hostname
  1. in system prefs, click "Sharing" and change computer name to "talos-r3-snow-0xx"
  2. shutdown
  3. Imaging done, next do slave/master setup.

***DRAFT*** Reference Image Info ***DRAFT***

Initial Setup and Account Creation

  1. Turn on Remote Login: System Preferences->Sharing
TB: To enable VNC login:
sudo /System/Library/CoreServices/RemoteManagement/ -activate -configure -access -on -restart -agent -privs -all -clientopts -setvnclegacy -vnclegacy -yes -setvncpw -vncpw somesecretpassword
  1. Turn off Bluetooth: System Preferences->Bluetooth
  2. Turn off Airport: System Preferences->Network
  3. Change the resolution to 1024 x 768, 60 Hz, Millions of Colours, under System Preferences->Displays (this is changed later)
  4. Change the password for the administrator user to the standard build system root password.
  5. Create a new admin-equiv account for the cltbld user using the standard build password. Set the cltbld user to automatically login.
  6. Under System Preferences->Sharing->Screen Sharing->Computer Settings change the VNC screen control password to the standard build password. NOTE: your VNC session will drop when you do this. You'll need to reconnect with the new password.
  7. If the hostname is wrong, e.g. unused-*, use sudo scutil --set HostName to fix it. NOTE: you'll need to restart the machine for this to fully take effect.
  8. Under System Preferences->Software Update, turn off automatic update checking.
  9. Using the Workgroup Manager, open the Preferences pane for the cltbld user. Under Software Update, set Manage: to Always, and set the Software Update server to use: as - NEED TO FIGURE THIS OUT
  10. TB: Ensure system language is "US English" [not "US English (computer)"]

Copy fonts from another Mac

cd /Library/Fonts
sudo rsync -av cltbld@moz2-darwin9-slave01:/Library/Fonts/ ./

Set dock size

defaults write tilesize -int 49; killall Dock

(until a fix is in for bug 470420)

TB: Disable quarantining of apps

We need to do this so OS X doesn't warn when opening a downloaded app, which is what automated mozmill tests do.

defaults write LSQuarantine -bool NO

Adjust sudoers

Edit /etc/sudoers to allow cltbld to reboot server. Add it as the last line or it may not work:

cltbld     ALL=NOPASSWD: /sbin/reboot

Installing Xcode

  1. Mount the Xcode disk image, and begin installing the XcodeTools.mpkg.
    • A standard install is fine (we don't need 10.3.9 support or WebObjects).
    • CHUD and 10.5 SDK are now installed by default

Installing wget

cd ~/Downloads
curl > wget-1.10.2.tar.gz
cd ~/work
tar -zvxf ~/Downloads/wget-1.10.2.tar.gz
cd wget-1.10.2
./configure --prefix=/usr
sudo make install

Installing MacPorts

sudo port -v selfupdate

sudo port install mercurial

sudo port install libidl
sudo port install autoconf213

Note: mercurial is now installed via a .dmg file from Firefox releng which places the binaries under the /tools directory.



  • Copy over the appropriate package from bm-admin01, either nrpe-darwin-i386.tar.gz or nrpe-darwin-powerpc.tar.gz depending on your platform. (TB: port install nrpe)
  • Create a nagios user and group
sudo dscl localhost -create /Local/Default/Users/nagios
sudo dscl localhost -create /Local/Default/Users/nagios UserShell /usr/bin/false
sudo dscl localhost -create /Local/Default/Users/nagios UniqueID 510
sudo dscl localhost -create /Local/Default/Groups/nagios
sudo dscl localhost -create /Local/Default/Groups/nagios UniqueID 1010
  • Unpack the package in /usr/local. Eg,
cd /usr/local && sudo tar xfz ~cltbld/nrpe-darwin-i386.tar.gz
  • Edit/checkout nrpe.cfg. The one in mozilla/tools/nagios/nrpe-mac.cfg may be useful.
  • setup nrpe.plist to launch at startup
sudo mkdir -p /usr/local/nagios/var
sudo chown nagios:nagios /usr/local/nagios/var
sudo cp -p /usr/local/nagios/etc/nrpe.plist /Library/LaunchDaemons/
sudo chown root:wheel /Library/LaunchDaemons/nrpe.plist
sudo launchctl load /Library/LaunchDaemons/nrpe.plist

Ask IT to setup the suite of checks.


# try if that doesn't work
md5 facter-1.5.6.gem
# should be e42990b6f40ade3c07e9ee91f052f717
md5 puppet-0.24.8.gem
# should be ad85a0aa6d63a91fbef6e578e3309bee
gem install facter-1.5.6.gem puppet-0.24.8.gem


#as root
mkdir /N
mount /N
cp /N/darwin9/com.reductivelabs.puppet.plist /Library/LaunchDaemons
cp /N/darwin9/ /usr/local/bin
chown root:wheel /Library/LaunchDaemons/com.reductivelabs.puppet.plist
chmod 644 /Library/LaunchDaemons/com.reductivelabs.puppet.plist
mkdir -p /var/puppet/log
launchctl load -w /Library/LaunchDaemons/com.reductivelabs.puppet.plist

cltbld environment

  • Copy from another moz2-darwin9-slave* slave the .profile and adjusted for Python ENV changes below
  • Copy from another moz2-darwin9-slave* the ~/.ssh/*
cd ~/.ssh
rm *
scp moz2-darwin9-slave03:.ssh/* . 
# this should work
# this should fail
# Thunderbird

Establish initial ssh connections and accept keys

Execute the following simple ssh calls to connect to the ftp server (stage), symbol server (if different from ftp), and update server so that the various pieces of the build can be uploaded automatically by the build scripts when needed:

ssh pwd
ssh pwd
ssh pwd

Mail config

You'll need to update the postfix config to make sure that myhostname is set correctly and that large messages can be sent. The tail of /etc/postfix/ should look similar to:

myhostname =
mailbox_transport = cyrus
# Allow large messages (unlimited size, required for tinderbox)
message_size_limit = 0

ntp config

sudo su -
echo "server iburst" > /etc/ntp.conf
kill -2 `ps x | grep ntp | grep -v grep | awk '{print $1}'`


Make directories

 mkdir -p /tools/dist/logs
 mkdir -p /builds/logs
 chown -R cltbld:admin /builds

Install Python 2.6.4

NB: 2.5.* would not compile in either 32bit or 64bit environments. gcc-4.0 complained about -Wno-long-double and gcc-4.2 did not provide all of the posix environment

cd /tools/dist
tar jxvf Python-2.6.4.tar.bz2
cd Python-2.6.4
./configure --prefix=/tools/python-2.6.4 --enable-framework=/tools/python --with-universal-archs=intel --enable-universalsdk=/
make test
sudo make install
sudo ln -s /tools/python-2.6.4 /tools/python
export PATH="/tools/python/bin:$PATH"

Installing Zope

cd /tools/dist
tar xfvj zope.interface-3.5.3.tar.gz
cd zope.interface-3.5.3
sudo python install --prefix=/tools/zope-3.5.3
sudo ln -s /tools/zope-3.5.3 /tools/zope

Installing Twisted

cd /tools/dist
tar xfvj Twisted-2.4.0.tar.bz2 
cd Twisted-2.4.0
cd TwistedCore-2.4.0
sudo python install --prefix=/tools/twisted-2.4.0
cd ..
sudo ln -s /tools/twisted-2.4.0 /tools/twisted
export PYTHONPATH="/tools/twisted/lib/python2.6/site-packages/:$PYTHONPATH"
python build
sudo python install --prefix=/tools/twisted-2.4.0

Installing Buildbot

Note: look in the puppet-manifests packages/devtools.pp file for the proper revision number to export and replace #### below with that revision number (TB: use BUILDBOT_PRODUCTION)

cd /tools/dist
sudo hg clone -r ####
cd buildbot
sudo python install --prefix=/tools/buildbot-####
sudo ln -s /tools/buildbot-#### /tools/buildbot

Installing build-tools

Note: look in the puppet-manifests packages/devtools.pp file for the proper revision number to export and replace #### below with that revision number

cd /tools
sudo hg clone -r #### build-tools-####
sudo ln -s /tools/build-tools-#### /tools/build-tools

Installing PyYAML

cd /tools/dist
tar -zvxf PyYAML-3.05.tar.gz
cd PyYAML-3.05
python build   
sudo python install

Install Mozmill (TB: Thunderbird only)

cd /tools/dist
sudo python
sudo easy_install mozrunner==2.4 jsbridge==2.3.7b1 mozmill==1.4.2b1

Install yasm (TB: Thunderbird only)

sudo port install yasm

Note: use yasm-1.1.0.dmg instead

Install ccache (TB: Thunderbird only)

sudo port install ccache

Final Configuration

Set the required Python environment variables in the Buildbot's user profile

echo 'export PATH="/opt/local/bin:/tools/buildbot/bin:/tools/twisted/bin:/tools/python/bin:$PATH"' >> ~/.profile
echo 'export PYTHONPATH="/tools/twisted/lib/python2.6/site-packages/:/tools/buildbot/lib/python2.6/site-packages/:$PYTHONPATH"' >> ~/.profile

Current Changes for Compile

Currently the configs/mozilla2-staging/macosx/mozilla-central/nightly/mozconfig needs to have the universal mozconfig import removed:

sed -i -e "s/. \$topsrcdir\/build\/macosx\/universal\/mozconfig//" build/.mozconfig

Symlink for autoconf

NB: I went to make this change but saw that there was already an autoconf213 binary at /opt/local/bin

Due to calling in RepackFactory to command=['bash', '-c', 'autoconf-2.13'] to fix this we have to add a symlink to autoconf213

sudo ln -s /opt/local/bin/autoconf213 /opt/local/bin/autoconf-2.13

"Install" 7z

We need 7zip for the l10n verification step of releases

sudo scp -p cltbld@bm-xserve16:/usr/local/bin/7z* /usr/local/bin/

Setup for verification on staging


Move ~/.ssh to ~/ssh_prod, and scp staging keys in from a staging box. Patch master config to allow new clone to connect and get jobs.

Setup buildbot start on boot

NB: The Python environment is very different than the one pulled via wget below - double check that it is accurate

cd /Library/LaunchAgents
sudo wget --no-check-certificate -Obuildbot.start.slave.plist [1]
sudo chown root:wheel buildbot.start.slave.plist

Add slave(s) to configuration files

The following files need to be updated with new slaves (note that the production Buildbot config is explicitly not updated here, it will be done later):

  • buildbot-configs/mozilla2-staging/
  • puppet-manifests/site-production.pp (or site-staging.pp for slaves that will be in staging permanently).

Once your patches have landed, you need to update the following checkouts:

  • On staging-master:
# as cltbld
cd /builds/buildbot/user-configs/clean-configs
hg pull && hg up
cd ../../user-configs2/clean-configs
hg pull && hg up
  • On production-puppet (or staging-puppet if you updated site-staging.pp):
# as root
cd /etc/puppet/manifests
hg pull && hg up
  • If a machine has been recloned/replaced then you also do this as root@production-puppet
puppetca --clean

Setup buildbot slave

The buildbot.tac file will automatically be generated to send the slave to the correct staging master (staging-master or sm-staging-try-master).

Run the slave through staging

see ReleaseEngineering:BuildSlaveSetup

Puppet packages

Disable bluetooth

TODO: Document this.

See bug 570843.


Spotlight hard disk indexing is disabled via a puppet recipe from bug 562632