ReferencePlatforms/Mac-10.6
Contents
- 1 Hardware imaging instructions
- 2 ***DRAFT*** Reference Image Info ***DRAFT***
- 2.1 Initial Setup and Account Creation
- 2.2 Copy fonts from another Mac
- 2.3 Set dock size
- 2.4 TB: Disable quarantining of apps
- 2.5 Adjust sudoers
- 2.6 Installing Xcode
- 2.7 Installing wget
- 2.8 Installing MacPorts
- 2.9 Nagios
- 2.10 Puppet
- 2.11 cltbld environment
- 2.12 Establish initial ssh connections and accept keys
- 2.13 Mail config
- 2.14 ntp config
- 2.15 Buildbot
- 2.16 Installing PyYAML
- 2.17 Install Mozmill (TB: Thunderbird only)
- 2.18 Install yasm (TB: Thunderbird only)
- 2.19 Install ccache (TB: Thunderbird only)
- 2.20 Final Configuration
- 2.21 Current Changes for Compile
- 2.22 Symlink for autoconf
- 2.23 "Install" 7z
- 2.24 Setup for verification on staging
- 2.25 Setup buildbot start on boot
- 2.26 Add slave(s) to configuration files
- 2.27 Setup buildbot slave
- 2.28 Run the slave through staging
- 3 Puppet packages
- 4 Spotlight
Hardware imaging instructions
- boot holding down "n"
- restore master on volume
- select talos-r3-snow-ref-v2.i386.hfs.dmg
- watch progress bar, wait for reboot
- in open cmd shell, as cltbld, type:
$ scutil --set HostName talos-r3-snow-0xx.build.mozilla.org $ hostname talos-r3-snow-0xx.build.mozilla.org $
- in system prefs, click "Sharing" and change computer name to "talos-r3-snow-0xx"
- shutdown
- Imaging done, next do slave/master setup.
***DRAFT*** Reference Image Info ***DRAFT***
https://wiki.mozilla.org/Mac:64BitRelEng
Initial Setup and Account Creation
- Turn on Remote Login: System Preferences->Sharing
TB: To enable VNC login: sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -restart -agent -privs -all -clientopts -setvnclegacy -vnclegacy -yes -setvncpw -vncpw somesecretpassword
- Turn off Bluetooth: System Preferences->Bluetooth
- Turn off Airport: System Preferences->Network
- Change the resolution to 1024 x 768, 60 Hz, Millions of Colours, under System Preferences->Displays (this is changed later)
- Change the password for the administrator user to the standard build system root password.
- Create a new admin-equiv account for the cltbld user using the standard build password. Set the cltbld user to automatically login.
- 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.
- If the hostname is wrong, e.g. unused-*, use
sudo scutil --set HostName new.hostname.mozilla.org
to fix it. NOTE: you'll need to restart the machine for this to fully take effect. - Under System Preferences->Software Update, turn off automatic update checking.
- 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 http://bm-xserve01.build.mozilla.org:8088/ - NEED TO FIGURE THIS OUT
- 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 com.apple.dock 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 com.apple.LaunchServices 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
- 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 https://ftp.gnu.org/pub/gnu/wget/wget-1.10.2.tar.gz > 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 make sudo make install
Installing MacPorts
- download from https://www.macports.org/install.php the MacPorts-1.8.2.pkg and follow instructions to install
- open terminal to get fresh environment
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.
[TB: https://momo-thumper.sj.mozillamessaging.com/mirror/moco-releng/]
Nagios
- 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.
Puppet
wget http://reductivelabs.com/downloads/gems/facter-1.5.6.gem # try https://downloads.puppetlabs.com/gems/facter-1.5.6.gem if that doesn't work md5 facter-1.5.6.gem # should be e42990b6f40ade3c07e9ee91f052f717 wget http://projects.reductivelabs.com/attachments/download/584/puppet-0.24.8.gem md5 puppet-0.24.8.gem # should be ad85a0aa6d63a91fbef6e578e3309bee gem install facter-1.5.6.gem puppet-0.24.8.gem
NB: TBD
#as root mkdir /N mount 10.2.71.136:/export/buildlogs/puppet-files /N cp /N/darwin9/com.reductivelabs.puppet.plist /Library/LaunchDaemons cp /N/darwin9/sleep-and-run-puppet.sh /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 ssh staging-stage.build.mozilla.org # this should fail ssh stage.mozilla.org # Thunderbird ssh tbirdbld@stage.mozilla.org
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 ffxbld@stage.mozilla.org pwd ssh ffxbld@aus2-staging.mozilla.org pwd ssh ffxbld@hg.mozilla.org ssh ffxbld@dm-symbolpush01.mozilla.org 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/main.cf should look similar to:
myhostname = bm-xserve16.build.mozilla.org mailbox_transport = cyrus
# Allow large messages (unlimited size, required for tinderbox) message_size_limit = 0
ntp config
sudo su - echo "server ntp1.build.mozilla.org iburst" > /etc/ntp.conf kill -2 `ps x | grep ntp | grep -v grep | awk '{print $1}'` exit
Buildbot
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 wget https://www.python.org/ftp/python/2.6.4/Python-2.6.4.tar.bz2 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 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 wget https://pypi.python.org/packages/source/z/zope.interface/zope.interface-3.5.3.tar.gz tar xfvj zope.interface-3.5.3.tar.gz cd zope.interface-3.5.3 sudo python setup.py install --prefix=/tools/zope-3.5.3 sudo ln -s /tools/zope-3.5.3 /tools/zope
Installing Twisted
cd /tools/dist wget https://twistedmatrix.com/Releases/Twisted/2.4/Twisted-2.4.0.tar.bz2 tar xfvj Twisted-2.4.0.tar.bz2 cd Twisted-2.4.0 cd TwistedCore-2.4.0 sudo python setup.py 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 setup.py build sudo python setup.py 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 #### https://hg.mozilla.org/build/buildbot cd buildbot sudo python setup.py 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 #### https://hg.mozilla.org/build/tools build-tools-#### sudo ln -s /tools/build-tools-#### /tools/build-tools
Installing PyYAML
cd /tools/dist wget https://pyyaml.org/download/pyyaml/PyYAML-3.05.tar.gz tar -zvxf PyYAML-3.05.tar.gz cd PyYAML-3.05 python setup.py build sudo python setup.py install
Install Mozmill (TB: Thunderbird only)
cd /tools/dist wget http://peak.telecommunity.com/dist/ez_setup.py sudo python ez_setup.py 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
NB: TBD
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/config.py
- 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 moz2-darwin8-slaveNN.build.mozilla.org
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
Spotlight hard disk indexing is disabled via a puppet recipe from bug 562632