ReferencePlatforms/Test/Mac: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(Replaced ftp and http with https where it didn't make things worse.)
 
(12 intermediate revisions by 3 users not shown)
Line 8: Line 8:
#* System Preferences -> Desktop & Screen Saver
#* System Preferences -> Desktop & Screen Saver
#* Move 'Start screen saver' to 'Never'
#* Move 'Start screen saver' to 'Never'
# Autohide the dock
# 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
# Create a 'mozqa' account
# Create a 'mozqa' account
niutil -create / /Users/mozqa
#* System Preferences -> Accounts -> press '+' to add account
niutil -createprop / /Users/mozqa uid 503
#* Username : mozqa, 'Allow user to administrate this computer' checked
niutil -createprop / /Users/mozqa gid 503
#* in 'Login Items' add Terminal (Applications -> Utilities -> Terminal)
niutil -createprop / /Users/mozqa realname "Mozilla QA"
#** handy to have this on startup
niutil -createprop / /Users/mozqa home "/Users/mozqa"
niutil -createprop / /Users/mozqa shell "/bin/bash"
niutil -createprop / /Users/mozqa passwd "*"
niutil -create / /Groups/mozqa
niutil -createprop / /Groups/mozqa gid 503
passwd mozqa
# Enable VNC
# Enable VNC
#* System Preferences -> Sharing
#* System Preferences -> Sharing
Line 25: Line 26:
#* Change the VNC password
#* Change the VNC password
# Install the mozqa ssh key in ~/.ssh
# Install the mozqa ssh key in ~/.ssh
# Enable autologin
#* System Preferences -> Accounts -> Login Options -> Automatically login as 'mozqa'


=== XCode Installation ===
=== XCode Installation ===
Line 36: Line 39:


=== Wget ===
=== Wget ===
  curl ftp://ftp.gnu.org/pub/gnu/wget/wget-1.10.2.tar.gz > 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
  tar -zvxf wget-1.10.2.tar.gz
  tar -zvxf wget-1.10.2.tar.gz
  cd wget-1.10.2
  cd wget-1.10.2
Line 46: Line 49:
=== Install Python 2.4.4 ===
=== Install Python 2.4.4 ===
# Download and install MacPython
# Download and install MacPython
  wget http://www.pythonmac.org/packages/py24-fat/dmg/python-2.4.4-macosx2006-10-18.dmg
  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
  hdiutil attach python-2.4.4-macosx2006-10-18.dmg
  cd /Volumes/Univeral\ MacPython\ 2.4.4
  cd /Volumes/Univeral\ MacPython\ 2.4.4
Line 55: Line 58:


=== Install Twisted and Zope-Interface===
=== Install Twisted and Zope-Interface===
  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 -jvxf Twisted-2.4.0.tar.bz2
  tar -jvxf Twisted-2.4.0.tar.bz2
  cd Twisted-2.4.0
  cd Twisted-2.4.0
Line 79: Line 82:
== Talos Setup ==
== Talos Setup ==
=== Install PyYAML ===
=== Install PyYAML ===
  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
Line 87: Line 90:
=== Setting up a Talos Buildbot slave ===
=== Setting up a Talos Buildbot slave ===
How to setup a Buildbot Talos slave (replace the master.host, username, and password with the correct values)
How to setup a Buildbot Talos slave (replace the master.host, username, and password with the correct values)
  cd ~
  cd ~
  mkdir talos-slave
  mkdir talos-slave
  buildbot create-slave talos-slave master.host:9989 username password
  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.
You should then start the slave once to create the proper directory structure.
  buildbot start talos-slave
  buildbot start talos-slave
Line 96: Line 103:


== Apache Setup ==
== 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.
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 ===
=== Pageset ===
You will need to install a pageset in /Users/mozqa/pages
You will need to install a pageset in /Users/mozqa/pages
Line 103: Line 124:
  cd ~/talos-slave/$BUILDDIR
  cd ~/talos-slave/$BUILDDIR
  mkdir talos
  mkdir talos
* Open up /etc/httpd/httpd.conf and change both references of "/Library/WebServer/Documents" to "/Users/mozqa/talos-slave/$BUILDDIR/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:
Add an alias so Apache knows where the pageset is. Add this to your configuration file:
  Alias /page_load_test/pages /Users/mozqa/pages
  Alias /page_load_test/pages /Users/mozqa/pages
Line 112: Line 133:
  </Directory>
  </Directory>
Turn off logging, remove any lines that begin with "CustomLog"
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:
Restart apache with:
  sudo apachectl restart
  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 =
= 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.
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

Latest revision as of 01:32, 12 August 2018

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