Sandbox:Release:Automation:Configuration

From MozillaWiki
Jump to: navigation, search

Configuration

Where possible (and where it makes sense to), the release configuration reuses variables from the branches' dep/nightly config. These will not be discussed here. This MXR query will show you all of the places in the release automation set-up that branch variables are referenced.

The release configs themselves have a number of variables and options in them. These are discussed below.

sourceRepositories

This variable is information dense dictionary and mostly contains information only relevant to Tagging. Each key of sourceRepositories (eg. "mozilla"), has a value of a dict with the following structure:

  • name - The name of the source repository, without any leading directories
  • clonePath - (staging only) Where to clone this repository from in repo_setup
  • path - Where to clone this repository for everything else (tagging, builds, repacks, et. al)
  • revision - The revision to base this release on. If relbranch is None or the provided one does not exist, the automation will update to this revision before creating the relbranch.
  • relbranch - The name of the relbranch to use for this release. If set to None, it will be generated automatically. If provided and exists, the automation will update to it before doing any bumping or tagging. If provided and doesn't exist, it will be created.
  • bumpFiles - This is another dict, whose keys are the paths in the sourceRepo, and whose values are *another* dict, with the following structure.
    • version - The version number to use in this file on the relbranch
    • nextVersion - The version number to use in this file on the default branch

Here's a concrete example of sourceRepositories for a Firefox build. Note that the bump file versions are typically factored out to earlier variables to avoid repetition.

releaseConfig['sourceRepositories'] = {
  'mozilla': {
    'name': 'mozilla-central',
    'path': 'mozilla-central',
    'revision': 'aaaaabbbbcccc',
    'relbranch': None
    'bumpFiles': {
      'browser/config/version.txt': {
        'version': releaseConfig['appVersion'],
        'nextVersion': releaseConfig['nextAppVersion'],
      },
      'config/milestone.txt': {
        'version': releaseConfig['milestone'],
        'nextVersion': releaseConfig['nextMilestone'],
      },
    }
  }
}

Others

Variable Description
hgUsername The account name used when pushing tags, version bumps, and other configuration file updates back to repositories hosting on hg.mozilla.org.
hgSshKey The path to the ssh key to used when pushing things back to hg.mozilla.org. The username in hgUsername must be setup to accept this key in order for the automation to work correctly. Path is generally in the ~/ form in order to be platform independent.
l10nRepoClonePath This is exactly like sourceRepoClonePath, but is the root of the l10n repository directory used for cloning locale repos in repo_setup.
l10nRepoPath This is exactly like sourceRepoPath, but for locale repositories. http://hgHost/l10nRepoPath/ab-CD should be a cloneable repository.
l10nRevisionFile This is the path, relative to the master's directory, which contains a listing of all of the locales to build, and their changesets. This file is read in at buildmaster start/reconfig time and the information is passed along to ReleaseTaggingFactory, which tags all of the repositories for this release. Any subsequent steps which require a list of locales will pull them from shipped-locales. This is a bug that may or may not be fixed.
l10nRelbranch The relbranch to use for l10n repositories. See "relbranch" in the preceding section for mechanics. Generally should be set to the same thing as the sourceRepositories relbranches.
shippedLocalesPath The path, relative to the root of the sourceRepo, to shipped-locales.
mergeLocales When True, merging will be enable when running compare-locales.
l10nChunks The number of l10n builders to be used, per platform. If not present, defaults to DEFAULT_PARALLELIZATION set in process/release.py.
cvsroot The cvsroot to use for pulling MozBuild, patcher tools, and other things from CVS. It is also used to check in an update patcher config file and as such must be an account with write access.
productName The lowercase product brand name. Eg, 'firefox', 'thunderbird', etc.
appName The lowercase application name. Eg, 'browser', 'mailnews', etc.
binaryName The name which will be used in the filenames of installers, packages, and MARs. Usually is the same as productName.
oldBinaryName Same as above, but for the oldVersion.
version/appVersion Sometimes we need the application version to be different from what we "call" the build, eg public release candidates for a major release (3.1 RC1). appVersion and oldAppVersion are optional definitions used in places that# don't care about what we call it. Eg, when version bumping we will bump to appVersion, not version. As a concrete example, when we produce the first release candidate for 3.1, version will be '3.1rc1' and appVersion will be '3.1'.
milestone The milestone version of the current platform release. Eg, 1.9.1b2
nextAppVersion/nextMilestone These variables control what the appVersion and milestone will be bumped to on the "default" branch.
buildNumber The build number of the current release. 1 if it's the first try for this release. May be 2, 3, or higher if respins were required.
baseTag The base tag to use when tagging repositories. _BUILD$buildNumber and _RELEASE will be appending to this where necessary.
oldVersion/oldAppVersion Same thing as version/appVersion, but applies to the previous release. When 3.1rc1 is shipped oldVersion and oldAppVersion will both be 3.1b3. When we ship 3.1.1 oldVersion will be, eg, 3.1rc2 and oldAppVersion will be 3.1.
oldBuildNumber The build number of the previous release. This should be the build number which was actually shipped.
oldBaseTag Same as baseTag, but for the previous release.
enUSPlatforms This is a tuple containing all of the platforms that require an en-US build as part of the release. These platforms must exist in config.py for the branch being built.
l10nPlatforms A tuple containing all of the platforms that require l10n repacks. Any platform listed here must also be listed in enUSPlatforms.
talosTestPlatforms A tuple containing all of the platforms that require talos test runs to be requested. Platforms listed here must also be listed in enUSPlatforms.
unittestPlatforms A tuple containing all of the platforms that require unit test runs to be requested. Platforms listed here must also be listed in enUSPlatforms.
xulrunnerPlatforms A tuple containing all of the platforms that require XULRunner builds to be generated.
patcherConfig The name of the patcher config file to bump and pass to patcher2.pl.
patcherToolsTag The tag to update both the tools and source repository to before running patcher2.pl.
ftpServer The ftp server to use for 'beta' channel snippets when useBetaChannel is '1'. Regardless of what useBetaChannel is set to this must be passed.
stagingServer The stage server to use for 'betatest' snippets and most verification tests.
bouncerServer The bouncer server to use for 'release' and 'releasetest' channel snippets.
ausServerUrl The AUS URL to aus for update verify tests.
ausUser The username to use when uploading snippets to the AUS server
ausSshKey The SSH key to use when uploading snippets to the AUS server
releaseNotesUrl URL of release notes. If None use the default URL. Introduced in bug 553059.
useBetaChannel This variable controls which channel is used as the final release channel. In order to not generate 'release' channel snippets (ie: for beta releases) set it to 0 so that the 'beta' channel snippets will be considered the final release channel, pointing to mirrors. When set to 1, 'release' channel snippets will be generated and will be considered the channel for final release, pointing to mirrors and if the patcher config has 'beta' channel references, beta snippets will be generated and will point to ftpServer, otherwise no beta snippets are generated.
*VerifyConfig The configuration file names for the update verify configuration files for each platform.
updateVerifyChunks The number of builders to be used for update verify, per platform. If not present, defaults to DEFAULT_PARALLELIZATION set in process/release.py.
majorUpdateRepoPath The relative path repository that contains the shipped-locales file for the major update "to" release. If None, the rest of the majorUpdate* variables are not necessary.
majorUpdateToVersion, majorUpdateAppVersion, majorUpdateBuildNumber, majorUpdateBaseTag These variables contain information about the release you are generating a major update to. See version/appVersion/buildNumber/baseTag for descriptions of them.
majorUpdateReleaseNotesUrl Major Update release notes URL. If None use the default URL. Introduced in bug 553059.
majorUpdatePatcherConfig The Patcher config file to use for the major update. This can be an existing file, in which case it will be overwritten and committed, or a non-existant file, in which case it will be created and committed.
majorUpdateVerifyConfigs See updateVerifyConfigs description above.
testOlderPartials Applicable only to the "updates" step. When true, the update verify bumping step will mark the n-2 release to have both its partial and complete updates tested. When false, it will rely on the default behaviour of update verify (As of bug 514040, this is "test complete only for n-2 and earlier builds). Generally, should be True on 1.9.1 based releases and earlier and False on anything more recent.
doPartnerRepacks Whether or not to create and schedule partner repack builds as part of this release.
partnersRepoPath The repoPath of the repository containing the partner repack scripts and configs. Generally set to 'build/partner-repacks'. Only necessary when doPartnerRepacks is True.
AllRecipients List of email addresses to send step-by-step email notification of release progress, Defaults to release@
PassRecipients List of email addresses to send step-by-step email notification of release progress if and only if the step is successful, Defaults to release@, although we may want to send directly to r-d@
ReleaseTemplates Location of the message bodies to use to formulate the messages sent for the notifications
tuxedoConfig A configuration file of tuxedo-add.py, which contains FTP path templates for the deliverables (installers and MARs). Examples: stable version, alpha (devpreview) version.
tuxedoServerUrl Tuxedo server's API URL prefix. Trailing slash is important.

Preparation

There are a couple of things you can do prior to the "go to build" to hasten things when you do receive. Generally, we do the following ahead of time:

  • Post updated configs and any other patches you'll need for review, using 'FILLMEOUT' or similar as the revision.
  • Mark a clobberer for "Any master", $branch, "Any builder" with clobberer. This will instruct any slave that did the last release on $branch to clobberer their release directories.

If you are doing a test release in staging there is additional setup work to do, and the clobberer URL changes.

L10N Changesets

Currently we have separate changesets files for Fennec and Firefox. Both are generated from the l10n dashboard
First log in to the dashboard with your LDAP and then follow the instructions below

Fennec

android,android-xul
  • In the 'Add a multi-locale file for' field put
android-multilocale
  • select "Add"
    • repo: "releases/mozilla-beta"
    • branch: "default"
    • path: "mobile/android/locales/maemo-locales"
  • select "Generate it"
  • Copy and paste it into your repo's l10n-changesets_mobile-{version}.json
  • go back to the original page
  • select "Ship it" to preserve the record of what was shipped

Firefox

Note: these instructions also work for Thunderbird.

  • Click "ship it" to load up the milestone (eg: Firefox 8 Beta Build 2)
  • This will take you to https://l10n.mozilla.org/shipping/confirm-ship?ms=fx8_beta_b2
  • Open in a new tab the "l10n-changesets" URL (don't touch any of the other fields) record the URL on the build notes
  • copy and paste the list into your l10n-changesets_mozilla-{version}
  • go back to the original page
  • select "Ship it"
    • if you forget the URL, you can recreate the URL by judicious modification of the URL from the prior build notes

Starting the automation

Generally, the workflow for kicking off Release Automation is as follows:

  • Update the configuration files
  • Tag buildbotcustom (branch production-0.8), buildbot-configs (branch production), tools (branch default) with the correct _RELEASE and _BUILDn tags. You must use FIREFOX_${VERSION}_BUILDn and FIREFOX_${VERSION}_RELEASE for Firefox releases, FENNEC_${VERSION}_BUILDn and FENNEC_${VERSION}_RELEASE for Fennec releases, or all 4 tags for combined releases.
  • Update the Buildbot Master doing the release
  • Run the pre-flight sanity check. This is done in the master directory (watch out for PYTHONPATH). For example:
# Combined release
cd /builds/buildbot/build1/master
source ../bin/activate
PYTHONPATH=. python ../tools/buildbot-helpers/release_sanity.py -u bhearsum -V 6.0b2 --branch mozilla-beta --build-number 1 \
    --release-config release-firefox-mozilla-beta.py --release-config release-fennec-mozilla-beta.py --products firefox,fennec  \
    --dryrun localhost:9001
# Firefox-only release
cd /builds/buildbot/build1/master
PYTHONPATH=. python ../tools/buildbot-helpers/release_sanity.py -u bhearsum -V 6.0b2 --branch mozilla-beta --build-number 1 \
 --release-config release-firefox-mozilla-beta.py --products firefox  \
 --dryrun localhost:9001
  • Start the automation by running the sanity script again, without --dryrun. For example:
# buildbot should in in $PATH, source ve env
source ../bin/activate
PYTHONPATH=. python ../tools/buildbot-helpers/release_sanity.py -u rail \
 -V 6.0b2 --branch mozilla-beta --build-number 1 \
 -c release-firefox-mozilla-beta.py -c release-fennec-mozilla-beta.py --products firefox,fennec localhost:9001


If you're working in staging you must make sure to pass in the correct staging release config (staging_release-firefox-<branch name>.py)

If for some reason you need to perform the sendchange manually, here's a sample. Note that the branch name is the repo path to the source repository. In staging, this will be a user repo. All parameters are required:</p>

buildbot sendchange --username bhearsum --master localhost:9010 --branch releases/mozilla-release \
    -p script_repo_revision:FIREFOX_3_6_12_RELEASE -p products:firefox,fennec release_build

Starting Signing

The next step is to start the signing automation, which will download builds as they become available, and start the signing process once all builds are ready. For more details on starting the signing automation, see the Combined Signing page.

Android signing procedure is outlined here

Tree Merges (release driver)

Sync mozilla-beta to mozilla-release

Mercurial repositories used for final releases should be synced from mozilla-beta.

Tip of default on mozilla-release should be tagged and closed. mozilla-beta should be tagged and pulled. It creates new tip of default on mozilla-release. See Aurora specific sync mechanics for the details.

L10N repositories uses noop (dummy) merge if needed to simplify localizers life.


To handle this process use the following scripts.

Sync mozilla-beta to mozilla-release

Script available here (beta2release.sh) do not use as it doesn't update confvars.sh

# Adjust VERSION variable which stands for the current Firefox version in mozilla-release
VERSION=8
HG_USER="ffxbld <release@mozilla.com>"

hg clone http://hg.mozilla.org/releases/mozilla-release
hg clone http://hg.mozilla.org/releases/mozilla-beta

beta_rev=$(hg -R mozilla-beta id -i -r default)
release_rev=$(hg -R mozilla-release id -i -r default)

RELEASE_BASE_TAG="RELEASE_BASE_`date +%Y%m%d`"
RELEASE_TAG="FIREFOX_RELEASE_$VERSION"

hg -R mozilla-beta tag -r $beta_rev -u "$HG_USER" -m "Added tag $RELEASE_BASE_TAG for changeset $beta_rev. CLOSED TREE a=release DONTBUILD" $RELEASE_BASE_TAG
hg -R mozilla-beta push -e "ssh -l ffxbld -i ~/.ssh/ffxbld_dsa" ssh://hg.mozilla.org/releases/mozilla-beta

hg -R mozilla-release tag -r $release_rev -u "$HG_USER" -m "Added tag $RELEASE_TAG for changeset $release_rev. CLOSED TREE a=release" $RELEASE_TAG
hg -R mozilla-release commit -u "$HG_USER" -m "Closing old head. CLOSED TREE a=release" --close-branch

hg -R mozilla-release pull mozilla-beta
hg -R mozilla-release up -C default

# edit shipped-locales file if you need to remove some beta locales
# edit confvars.sh:
-ACCEPTED_MAR_CHANNEL_IDS=firefox-mozilla-beta,firefox-mozilla-release
+ACCEPTED_MAR_CHANNEL_IDS=firefox-mozilla-release

-MAR_CHANNEL_ID=firefox-mozilla-beta
+MAR_CHANNEL_ID=firefox-mozilla-release

# commit the changes
hg -R mozilla-release commit -u "$HG_USER" -m "Updating confvars.sh CLOSED TREE a=release"

# push back
# hg -R mozilla-release push -f -e "ssh -l ffxbld -i ~/.ssh/ffxbld_dsa" ssh://hg.mozilla.org/releases/mozilla-release

L10N sync

Script available here (beta2release_l10n.sh)

#!/bin/bash
set -x
set -e

HG_USER="ffxbld <release@mozilla.com>"
HG_HOST=hg.mozilla.org
repo=mozilla-release
release_repo_path=releases/l10n/mozilla-release
beta_repo_path=releases/l10n/mozilla-beta
wd=`pwd`/l10n

mkdir -p $wd
cd $wd

for l in `wget -q -O- http://$HG_HOST/releases/$repo/raw-file/default/browser/locales/shipped-locales | grep -v en-US | awk '{print $1}'`; do
    hg clone http://$HG_HOST/$release_repo_path/$l
    hg clone http://$HG_HOST/$beta_repo_path/$l $l.beta
    release_rev=`hg -R $l id -i -r default`
    beta_rev=`hg -R $l.beta id -i -r default`
    hg -R $l pull $l.beta
    hg -R $l up -C default
    heads=`hg -R $l heads --template '{rev}\n' default|wc -l`
    if [ "x$heads" != "x1" ]; then
        hg -R $l up -C -r $beta_rev
        HGMERGE=true hg -R $l merge -r $release_rev
        hg -R $l revert -a -y --no-backup -r $beta_rev
        hg -R $l commit -m "Merge from mozilla-beta" -u "$HG_USER"
        hg -R $l commit -u $HG_USER -m "Merge from mozilla-beta. CLOSED TREE a=release"
    fi
    hg -R $l diff -r $beta_rev -r default
    hg -R $l push -f -e "ssh -l ffxbld -i ~/.ssh/ffxbld_dsa" ssh://$HG_HOST/$release_repo_path/$l
done