ReferencePlatforms/Mac-10.6

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 talos-r3-snow-0xx.build.mozilla.org
$ hostname
talos-r3-snow-0xx.build.mozilla.org
$
  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***

https://wiki.mozilla.org/Mac:64BitRelEng

Initial Setup and Account Creation

  1. 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
  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 new.hostname.mozilla.org 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 http://bm-xserve01.build.mozilla.org:8088/ - 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 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

  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 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

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