ReferencePlatforms/Mac-10.6: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
mNo edit summary
(Replaced ftp and http with https where it didn't make things worse.)
 
(66 intermediate revisions by 6 users not shown)
Line 1: Line 1:
__TOC__
__TOC__
= 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*** =
= ***DRAFT*** Reference Image Info ***DRAFT*** =
Line 6: Line 21:
== Initial Setup and Account Creation ==
== 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 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.
# 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.
# 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.
# 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 <code>sudo scutil --set HostName new.hostname.mozilla.org</code> to fix it. NOTE: you'll need to restart the machine for this to fully take effect.
# If the hostname is wrong, e.g. unused-*, use <code>sudo scutil --set HostName new.hostname.mozilla.org</code> 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.
# 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
# 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 ==
== Installing Xcode ==
Line 18: Line 63:
# Mount the Xcode disk image, and begin installing the XcodeTools.mpkg.  
# 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).  
#* A standard install is fine (we don't need 10.3.9 support or WebObjects).  
#* Make sure to install the 10.5 SDK, as it is not installed by default.
#* CHUD and 10.5 SDK are now installed by default
#* CHUD is now installed by default


== Installing wget ==
== Installing wget ==


  curl ftp://ftp.gnu.org/pub/gnu/wget/wget-1.10.2.tar.gz > wget-1.10.2.tar.gz
cd ~/Downloads
  tar -zvxf wget-1.10.2.tar.gz
  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
  cd wget-1.10.2
  ./configure --prefix=/usr
  ./configure --prefix=/usr
Line 32: Line 78:
== Installing MacPorts ==
== Installing MacPorts ==


* Install MacPorts-1.8.2 and the following MacPorts packages...
* download from https://www.macports.org/install.php the MacPorts-1.8.2.pkg and follow instructions to install
** mercurial
* open terminal to get fresh environment
** libidl
 
** autoconf213  
sudo port -v selfupdate
<strike> sudo port install mercurial</strike>
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 ==
== 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.
* 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  
* Create a nagios user and group  


Line 53: Line 106:


* Edit/checkout nrpe.cfg. The one in mozilla/tools/nagios/nrpe-mac.cfg may be useful.
* Edit/checkout nrpe.cfg. The one in mozilla/tools/nagios/nrpe-mac.cfg may be useful.
* Run enablenrpe to turn it on
* setup nrpe.plist to launch at startup


  sudo /usr/local/nagios/sbin/enablenrpe
  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.
Ask IT to setup the suite of checks.
Line 61: Line 118:
== Puppet ==
== Puppet ==


  wget http://reductivelabs.com/downloads/puppet/puppet-0.24.8.gem
  wget http://reductivelabs.com/downloads/gems/facter-1.5.6.gem
  sudo gem install puppet-0.24.8.gem
# try https://downloads.puppetlabs.com/gems/facter-1.5.6.gem if that doesn't work
 
md5 facter-1.5.6.gem
== ssh ==
# should be e42990b6f40ade3c07e9ee91f052f717
 
wget http://projects.reductivelabs.com/attachments/download/584/puppet-0.24.8.gem
scp the cltbld and appropriate role keys over directly from a machine that already has them installed. In .ssh, make sure the cltbld keys are called cltbld* and not id_dsa*, then symlink
  md5 puppet-0.24.8.gem
 
  # should be ad85a0aa6d63a91fbef6e578e3309bee
  ln -s cltbld_dsa id_dsa
  gem install facter-1.5.6.gem puppet-0.24.8.gem
  ln -s cltbld_dsa.pub id_dsa.pub
 
This is temporary to get hold of the standard .profile (we should move that file to public cvs).


== ENV setup ==
'''NB''': TBD


  cvs -d :ext:cltbld@cvs.mozilla.org:/mofo co release/tinderbox-configs/host
  #as root
  ln -s release/tinderbox-configs/host/mac-osx-profile .profile
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


...at which point you'll probably want to restart your shell to use the new .profile.
== cltbld environment ==


== switch to role key ==
* Copy from another moz2-darwin9-slave* slave the .profile and adjusted for Python ENV changes below
* Copy from another moz2-darwin9-slave* the ~/.ssh/*


In ~/.ssh,
cd ~/.ssh
rm *
scp moz2-darwin9-slave03:.ssh/* .


  rm id_dsa id_dsa.pub
  # this should work
  ln -s ffxbld_dsa id_dsa
ssh staging-stage.build.mozilla.org
  ln -s ffxbld_dsa.pub id_dsa.pub
  # this should fail
 
  ssh stage.mozilla.org
or substitute ffxbld for whatever key is appropriate for what you will be building.  
# Thunderbird
ssh tbirdbld@stage.mozilla.org


== Establish initial ssh connections and accept keys ==
== Establish initial ssh connections and accept keys ==
Line 100: Line 165:


== Mail config ==
== Mail config ==
'''NB''': Postfix config is tinderbox client specific, all the buildbot information goes over a socket to the master and is posted to the tinderbox server from there.


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:
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:
Line 110: Line 173:
  # Allow large messages (unlimited size, required for tinderbox)
  # Allow large messages (unlimited size, required for tinderbox)
  message_size_limit = 0
  message_size_limit = 0
You'll then want to restart postfix to pick up the changes.
Also make sure that Mail.app is installed.


== ntp config ==
== ntp config ==
Line 128: Line 187:
   mkdir -p /tools/dist/logs
   mkdir -p /tools/dist/logs
   mkdir -p /builds/logs
   mkdir -p /builds/logs
  chown -R cltbld:admin /builds


=== Install Python 2.6.4 ===
=== Install Python 2.6.4 ===
Line 134: Line 194:


  cd /tools/dist
  cd /tools/dist
  wget http://www.python.org/ftp/python/2.6.4/Python-2.6.4.tar.bz2
  wget https://www.python.org/ftp/python/2.6.4/Python-2.6.4.tar.bz2
  tar jxvf Python-2.6.4.tar.bz2
  tar jxvf Python-2.6.4.tar.bz2
  cd Python-2.6.4
  cd Python-2.6.4
  ./configure --prefix=/tools/python --enable-framework=/tools/python --with-universal-archs=intel --enable-universalsdk=/
  ./configure --prefix=/tools/python-2.6.4 --enable-framework=/tools/python --with-universal-archs=intel --enable-universalsdk=/
  make
  make
  make test
  make test
  make install
  sudo make install


sudo ln -s /tools/python-2.6.4 /tools/python
  export PATH="/tools/python/bin:$PATH"
  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 ===
=== Installing Twisted ===


  cd /tools/dist
  cd /tools/dist
  wget http://tmrc.mit.edu/mirror/twisted/Twisted/2.4/Twisted-2.4.0.tar.bz2
  wget https://twistedmatrix.com/Releases/Twisted/2.4/Twisted-2.4.0.tar.bz2
  tar xfvj Twisted-2.4.0.tar.bz2  
  tar xfvj Twisted-2.4.0.tar.bz2  
  cd Twisted-2.4.0
  cd Twisted-2.4.0
  cd ZopeInterface-3.1.0c1
  cd TwistedCore-2.4.0
python setup.py build
  sudo python setup.py install --prefix=/tools/twisted-2.4.0
  sudo python setup.py install
  cd ..
  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
  python setup.py build
  sudo python setup.py install --prefix=/tools/python
  sudo python setup.py install --prefix=/tools/twisted-2.4.0


=== Installing Buildbot ===
=== 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
  cd /tools/dist
  cvs -d:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -d buildbot mozilla/tools/buildbot
  sudo hg clone -r #### https://hg.mozilla.org/build/buildbot
  cd buildbot
  cd buildbot
  python2.5 setup.py install
  sudo python setup.py install --prefix=/tools/buildbot-####
  sudo python2.5 setup.py install
  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 ==
== Installing PyYAML ==


  cd /tools/dist
  cd /tools/dist
  wget http://pyyaml.org/download/pyyaml/PyYAML-3.05.tar.gz
  wget https://pyyaml.org/download/pyyaml/PyYAML-3.05.tar.gz
  tar -zvxf PyYAML-3.05.tar.gz
  tar -zvxf PyYAML-3.05.tar.gz
  cd PyYAML-3.05
  cd PyYAML-3.05
  python setup.py build   
  python setup.py build   
  sudo python setup.py install
  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 ==
== Final Configuration ==
Line 178: Line 277:
Set the required Python environment variables in the Buildbot's user profile
Set the required Python environment variables in the Buildbot's user profile


  echo 'export PATH="/opt/local/bin:/tools/buildbot/bin:/tools/python/bin:$PATH"' >> ~/.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 ==
== Current Changes for Compile ==
Line 186: Line 286:
  sed -i -e "s/. \$topsrcdir\/build\/macosx\/universal\/mozconfig//" build/.mozconfig
  sed -i -e "s/. \$topsrcdir\/build\/macosx\/universal\/mozconfig//" build/.mozconfig


== Copy fonts from another Mac ==
== 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 [https://bug428124.bugzilla.mozilla.org/attachment.cgi?id=371801]
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


cd /Library/Fonts
* If a machine has been recloned/replaced then you also do this as root@production-puppet
  sudo rsync -av cltbld@moz2-darwin9-slave01:/Library/Fonts/ ./
  puppetca --clean moz2-darwin8-slaveNN.build.mozilla.org


== Set dock size ==
== Setup buildbot slave ==


defaults write com.apple.dock tilesize -int 49; killall Dock
The buildbot.tac file will automatically be generated to send the slave to the correct staging master (staging-master or sm-staging-try-master).


(until a fix is in for bug 470420)
==Run the slave through staging==
see [[ReleaseEngineering:BuildSlaveSetup]]


== Symlink for autoconf ==
= Puppet packages =
== Disable bluetooth ==
TODO: Document this.


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


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


sudo ln -s /opt/local/bin/autoconf213 /opt/local/bin/autoconf-2.13
Spotlight hard disk indexing is disabled via a puppet recipe from bug 562632

Latest revision as of 01:42, 12 August 2018

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