bzr-playground.gnome.org

The bzr-playground machine has a number of components that all hook together to make things work.

  • The branch structure on disk
  • The import scripts and email
  • Themed loggerhead, with additional custom html (apache config)
  • SSH logins

Branch layout

The simplest thing to start with is the layout of the branches on the disk itself.

The actual location of the branches is found in /srv/bzr. This location is symlinked from root (/bzr -> /srv/bzr).

Official branches

The official branches are imported using bzr-svn into the /bzr/gnome directory, where each module has its own directory. For example, gedit has a location /bzr/gnome/gedit. Each module has its own shared repository in that directory. The imports that bzr-svn produces creates a branch for trunk, each subversion branch in the branches location, and at this stage, a branch for each subversion tag.

A truncated example is shown here for gedit.

/bzr/gnome/gedit <- shared repository
/bzr/gnome/gedit/trunk <- the main branch
/bzr/gnome/gedit/branches/gnome-2-20
/bzr/gnome/gedit/branches/gnome-2-22
... (and many other branches)
/bzr/gnome/gedit/tags/GNOME_2_20_BRANCHPOINT
/bzr/gnome/gedit/tags/GNOME_2_22_BRANCHPOINT
... (and many other tags)

All the branches in the /bzr/gnome area are owned by the user bzrgnome. This is the user that runs the imports. This stops accidental writing to these branches by other users.

User branches

Any user is able to push branches to the playground to a location under /bzr. While it is possible for the user to call the branch anything, it is suggested that the users use their login id as the directory under /bzr where they put their own branches.

The helper script found at: http://svn.gnome.org/svn/vcs-mirror/trunk/contrib/bzr-gnome-setup.py sets up the appropriate local branches with the public locations set up so the users can just bzr push to the playground location.

The directory /bzr has group rights to allow members of the gnome group to create directories. All the users that log in with SSH keys are members of the gnome group, and so can create their branches there.

Import scripts

The Subversion imports are done using bzr-svn, and at the time of writing this, bzr was at version 1.8, and bzr-svn was 0.4.13.

The import scripts were originally written by John Carr, and were modified slightly for the playground. They can be found at http://bzr-playground.gnome.org/vcs-mirror/playground/files (loggerhead) or bzr+ssh://bzr-playground.gnome.org/gnome/vcs-mirror/playground.

There is a user created on the machine called "bzrgnome". This user is subscribed to the gnome commit email list. The import script (mirror.py) reads the emails from ~/Maildir/new and parses them to detect the gnome module. Once the emails have been processed, they are moved to ~/Maildir/cur (not the best name). The script is normally run with nohup, and has run without interruption for over two weeks (once the file exhaustion problem was fixed).

Themed Loggerhead

A gnome themed loggerhead was created, and can be found at https://code.edge.launchpad.net/~thumper/loggerhead/gnome-loggerhead. This branch is on the server at /srv/gnome-loggerhead.

Loggerhead is started with the following command line:

  ./serve-branches --user-dirs --trunk-dir=gnome /bzr

from the /srv/gnome-loggerhead directory.

The --user-dirs tells loggerhead to use ~user in the urls, and the --trunk-dir=gnome tells loggerhead to use directories in the gnome directory as primary module names.

Apache config

NameVirtualHost a.b.c.d:80

<VirtualHost a.b.c.d:80>
  ServerName bzr-playground.gnome.org
  ServerAlias bzr-gnome.canonical.com
  CustomLog /var/log/apache2/bzr-playground.gnome.org.access-log combined
  ErrorLog  /var/log/apache2/bzr-playground.gnome.org.error-log

  ProxyRequests off
  ProxyTimeout  20
  <Proxy *>
    Order deny,allow
    Allow from localhost a.b.c.d
  </Proxy>


  <Directory /srv/bzr.gnome.org/>
    Options Indexes FollowSymLinks MultiViews +Includes
    XBitHack on
    AllowOverride None
    Order allow,deny
    allow from all
  </Directory>

  RewriteEngine On

  # .bzr access for /~foo goes to /srv/bzr/foo
  RewriteRule ^/~(.*)/.bzr(|/.*)$ /srv/bzr/$1/.bzr$2 [L]
  # .bzr access for /gnome/foo goes to /srv/bzr/gnome/foo
  RewriteRule ^/gnome/(.*)/.bzr(|/.*)$ /srv/bzr/gnome/$1/.bzr$2 [L]
  # .bzr access for /foo also goes to /srv/bzr/gnome/foo
  RewriteRule ^/(.*)/.bzr(|/.*)$ /srv/bzr/gnome/$1/.bzr$2 [L]

  # Static pages.
  # I think if we moved the document root to be /srv/bzr.gnome.org,
  # and move the robots.txt there, we could simplify some of the following rules.
  RewriteRule ^/robots.txt$ /srv/bzr/robots.txt [L]
  RewriteRule ^/$ /srv/bzr.gnome.org/index.html [L]
  RewriteRule ^/users.html$ /srv/bzr.gnome.org/users.html [L]
  RewriteRule ^/fixed/(.*)$ /srv/bzr.gnome.org/fixed/$1 [L]

  # Redirect any older "gnome" roots to the same without the gnome.
  RewriteRule ^/gnome/(.*)$ /$1 [R]

  # Damned lies is special.
  RewriteRule ^/admin/damned-lies(|/.*)$       /srv/damnlies/$1 [L]

  # Loggerhead proxies.
  RewriteRule ^/(.*)$ http://localhost:8080/$1 [L,P]

</VirtualHost>

The static pages are the nice front pages for modules and contributors shown on http://bzr-playground.gnome.org. These files are found at /srv/bzr.gnome.org.

SSH Logins

These are mirrored somehow from the gnome LDAP server.

Attic/DistributedSCM/BazaarPlayground (last edited 2013-11-22 23:18:38 by WilliamJonMcCann)