ReferencePlatforms/Test/Mac

From MozillaWiki
Jump to: navigation, search

Talos on Mac

Important: Do _NOT_ upgrade past 10.4.8. hdiutil has a bug/feature in 10.4.9 and above that prevents Talos Buildbot's from working properly.

OS Setup

  1. Change the resolution
    • System Preferences -> Displays
    • Select 1024x768
  2. Turn off the screen saver
    • System Preferences -> Desktop & Screen Saver
    • Move 'Start screen saver' to 'Never'
  3. Autohide the dock
  4. Turn off sleep
    • System Preferences -> Energy Saver
    • "Put the computer to sleep when it is inactive for..." Never
    • 'put the display to sleep' Never
    • uncheck 'Put the hard disk(s) to sleep when possible'
    • In options set dock to autohide
  5. Create a 'mozqa' account
    • System Preferences -> Accounts -> press '+' to add account
    • Username : mozqa, 'Allow user to administrate this computer' checked
    • in 'Login Items' add Terminal (Applications -> Utilities -> Terminal)
      • handy to have this on startup
  6. Enable VNC
    • System Preferences -> Sharing
    • Make sure 'Apple Remote Desktop' is checked.
    • Click 'Access Privileges'
    • Change the VNC password
  7. Install the mozqa ssh key in ~/.ssh
  8. Enable autologin
    • System Preferences -> Accounts -> Login Options -> Automatically login as 'mozqa'

XCode Installation

  1. The next step is to retrieve the Mac reference platform packages from CVS:
export CVS_RSH=ssh
ocvs -d :ext:unittest@cvs.mozilla.org:/mofo co ref-platforms/mac
  1. Install Xcode
    1. Mount the Xcode dmg
    2. Double click on XcodeTools.mpkg
    3. In the 'Installation Type' section choose 'Customize' and enable everything under 'Cross-Development'

Wget

curl https://ftp.gnu.org/pub/gnu/wget/wget-1.10.2.tar.gz > wget-1.10.2.tar.gz
tar -zvxf wget-1.10.2.tar.gz
cd wget-1.10.2
./configure --prefix=/usr
make
sudo make install

BuildBot Setup

Install Python 2.4.4

  1. Download and install MacPython
wget https://www.python.org/ftp/python/2.4.4/python-2.4.4-macosx2006-10-18.dmg
hdiutil attach python-2.4.4-macosx2006-10-18.dmg
cd /Volumes/Univeral\ MacPython\ 2.4.4
sudo installer -pkg MacPython.mpkg -target /
cd ..
hdiutil detach /Volumes/Univeral\ MacPython\ 2.4.4
  • You must logout and log back in to make sure you are using the new version of Python.

Install Twisted and Zope-Interface

wget https://twistedmatrix.com/Releases/Twisted/2.4/Twisted-2.4.0.tar.bz2
tar -jvxf Twisted-2.4.0.tar.bz2
cd Twisted-2.4.0
cd ZopeInterface-3.1.0c1
python setup.py build
sudo python setup.py install
cd ../TwistedCore-2.4.0/
python setup.py build
sudo python setup.py install
cd ..
python setup.py build
sudo python setup.py install
cd ..

Install BuildBot

ocvs -d:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -d buildbot mozilla/tools/buildbot
cd buildbot
python setup.py build
sudo python setup.py install
cd ..
rm -rf buildbot/

Talos Setup

Install PyYAML

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

Setting up a Talos Buildbot slave

How to setup a Buildbot Talos slave (replace the master.host, username, and password with the correct values)

cd ~
mkdir talos-slave
buildbot create-slave --umask=002 talos-slave master.host:9989 username password

Edit the buildbot.tac file to have keepalive = None

You should then start the slave once to create the proper directory structure.

buildbot start talos-slave
buildbot stop talos-slave

When running Buildbot slaves on Mac you must start it from a Terminal window in VNC and leave that window open (even though it's a daemon process). hdiutil will throw errors if you do not.

Apache Setup

Install apache from https://httpd.apache.org/download.cgi (use unix source) - the copy of apache bundled with the mac is too old.

In the apache directory:

./configure --prefix=/etc/apache2
make
make install

Stop the built in apache:

sudo apachectl stop

The DocumentRoot will be dependent on the builddir of your Buildbot slave. In this section that directory will be referred to as $BUILDDIR.

For machines in the pool of slaves, $BUILDDIR should be 'talos-data'.

Pageset

You will need to install a pageset in /Users/mozqa/pages

The rest

  • Create an empty directory so Apache doesn't complain:
cd ~/talos-slave/$BUILDDIR
mkdir talos
  • Open up /etc/apache2/httpd/httpd.conf and change both references of "/Library/WebServer/Documents" to "/Users/mozqa/talos-slave/$BUILDDIR/talos".

Add an alias so Apache knows where the pageset is. Add this to your configuration file:

Alias /page_load_test/pages /Users/mozqa/pages
<Directory /Users/mozqa/pages>
    Options Indexes
    Order allow,deny
    Allow from all
</Directory>

Turn off logging, remove any lines that begin with "CustomLog"

  • replace the old apache install with the new apache2 install
mv /usr/sbin/apachectl /usr/sbin/apachectl1.3
ln -s /etc/apache2/bin/apachectl /usr/sbin/apachectl

Restart apache with:

sudo apachectl start

Auto start on reboot

Install buildbot.start.talos.slave.plist in /Library/LaunchAgents/.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>EnvironmentVariables</key>
        <dict>
                <key>PATH</key>
                <string>/Library/Frameworks/Python.framework/Versions/Current/bin:/bin:/sbin:/usr/bin:/usr/sbin</string>
        </dict>
        <key>Label</key>
        <string>buildbot.start.talos.slave</string>
        <key>ProgramArguments</key>
        <array>
                <string>/Library/Frameworks/Python.framework/Versions/Current/bin/buildbot</string>
                <string>start</string>
                <string>/users/Mozqa/talos-slave</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
        <key>UserName</key>
        <string>mozqa</string>
        <key>WorkingDirectory</key>
        <string>/Users/mozqa/</string>
</dict>
</plist>

Updating Talos

Assuming your Buildbot master configuration is proper, Buildbot will automatically update Talos on every performance run. If the pageset is updated, you will need to refresh /home/mozqa/pages.

Post-cloning Setup for Pool

  • Edit /Users/mozqa/talos-slave/buildbot.tac.sample and update buildmaster_host and slavename appropriately
  • Rename buildbot.tac.sample to buildbot.tac
  • Reboot