Initial Application Setup ========================= This section will outline the initial setup of a MonkeyFarm environment from the administrators view. It is not complete, but meant to be a quick and dirty intro to getting a working system. Please note that there are many ways to configure MonkeyFarm. We make a few assumptions in this next section... primarily that of a focus on rpm packaging. MonkeyFarm is not limited to only building RPMs, but that is its primary development focus. Because the 'launchpad' plugin provides both a VCS, and Bug handler... and is publicly available for all users we will use that in our examples. Requirements ------------ This outline requires the following: - The monkeyfarm.hub is configured and accessible (you can make calls to the api) - The monkeyfarm.regulator is running and connected with the hub - The monkeyfarm.worker is running and connected with the hub - The monkeyfarm.mock plugin is installed and registered by the regulator and by all workers. - The monkeyfarm.git, monkeyfarm.bzr, or other VCS Plugin Provider is installed and registered by the regulator. - The monkeyfarm.client is functional and connected with the hub using the mf-admin account. Verify Some Things ------------------ Lets verify that we have some build handlers, bug handlers, and vcs handlers registered. .. code-block:: text $ mf build-handler listall generic_build mock $ mf vcs-handler listall bzr git launchpad $ mf bug-handler listall launchpad $ mf arch listall i386 x86_64 If using the 'git', or 'bzr' plugins for VCS (version control) you will need to modify the configs in /etc/monkeyfarm/plugins.d appropriately. That said the launchpad plugin should be ready to go using the public LaunchPad instance: /etc/monkeyfarm/plugins.d/launchpad.conf .. code-block:: text # Launchpad Configuration Settings # # Note: Default values can be set via .bootstrap..py # [launchpad] enable_plugin = true provider = mf # Path to bzr binary vcs_bin_path = /usr/bin/bzr # Repository URL template. The following vars are substituted: # # @MF_PROJECT_LABEL@ # @MF_PACKAGE_LABEL@ # @MF_ADMIN_GROUP_LABEL@ # @MF_DEV_GROUP_LABEL # vcs_url_template = 'bzr+ssh://bazaar.launchpad.net/~@MF_ADMIN_GROUP_LABEL@/@MF_PROJECT_LABEL@/@MF_PACKAGE_LABEL@/' # Bug URL template. The following vars are substituted: # # @MF_PROJECT_LABEL@ # @MF_BUG_LABEL@ # bug_url_template = 'https://bugs.launchpad.net/@MF_PROJECT_LABEL@/+bug/@MF_BUG_LABEL@' Make sure the bin path, and url templates are accurate for your environment. Obviously you need to have a git or bzr server running somewhere... based on which config you use (or for all of them).... and also have any SSH keys etc etc configured for the user running mf-regulatord to be able to pull (read-only) data from the git server. This is outside the scope of this document at this time. Note: These are system wide settings (which is why you have a project, and package macro/variable to use. This is substituted on a per project/package basis). For the launchpad plugin, you simply need a launchpad user account and to provide an SSH key that the user running mf-regulatord has access to. Creating Build Targets ---------------------- The following commands create a distro, release, and a few targets for Red Hat Enterprise Linux 5. .. code-block:: text $ mf distro create -l redhat --display-name "Red Hat Enterprise Linux" $ mf release create -l el5 --distro redhat --major-version 5 $ mf target create -l el5.i386 \ > --release el5 --arch i386 \ > --target-config-file ~/epel-5-i386.cfg \ > --build-handler mock This is all pretty straight forward, but that last one gets a bit complex. Note that we are using the 'mock' build handler (provided by the monkeyfarm.mock plugin). The build handler tells MonkeyFarm how to build for that target. Additionally, mock requires a target to have a mock configuration set as its config. We are using a stock mock config, however in order to dynamically build off of generated MonkeyFarm yum repositories we need to add the following to the 'repos' section of the mock config: .. code-block:: text # @MF_TARGET_DATA@ We can see what that config file had in it by looking at the target: .. code-block:: text $ mf target show el5.i386 Label | el5.i386 Display Name | Red Hat Enterprise Linux 5 i386 Owner | mf-admin Created On | 2010-12-12 20:59:03 Last Update | 2010-12-12 20:59:03 Build Count | 0 Distro | redhat Release | el5 Version | 5 Arch | i386 Build Handler | mock Host Sig | redhat-5-i386 --- %(config) ---------------------------------------------------------------- config_opts['root'] = 'el5.i386' config_opts['target_arch'] = 'i386' config_opts['chroot_setup_cmd'] = 'install buildsys-build' config_opts['dist'] = 'el5' # only useful for --resultdir variable subst config_opts['yum.conf'] = """ [main] cachedir=/var/cache/yum debuglevel=1 logfile=/var/log/yum.log reposdir=/dev/null retries=20 obsoletes=1 gpgcheck=0 assumeyes=1 syslog_ident=mock syslog_device= # repos [core] name=base mirrorlist=http://mirrorlist.centos.org/?release=5&arch=i386&repo=os [update] name=updates mirrorlist=http://mirrorlist.centos.org/?release=5&arch=i386&repo=updates [groups] name=groups baseurl=http://buildsys.fedoraproject.org/buildgroups/rhel5/i386/ [extras] name=epel mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=i386 [testing] name=epel-testing enabled=0 mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=testing-epel5&arch=i386 [local] name=local baseurl=http://kojipkgs.fedoraproject.org/repos/dist-5E-epel-build/latest/i386/ cost=2000 enabled=0 # @MF_TARGET_DATA@ """ Now we do the same for el5.x86_64: .. code-block:: text $ mf target create -l el5.x86_64 \ > --release el5 --arch x86_64 \ > --target-config-file ~/epel-5-x86_64.cfg \ > --build-handler mock Targets are system wide, therefore you will need to create a target for whatever distros your users want to build against. From here we simply need to create a project and a package, then submit a build. Setting up an Example Project ----------------------------- I'm going to use the 'drizzle' project as an example: .. code-block:: text $ mf group create \ -l drizzle-admin \ --display-name 'Drizzle Administrators' \ --restricted=True $ mf group create \ -l drizzle-developers \ --display-name 'Drizzle Developers' \ --restricted=True $ mf project create \ -l drizzle \ --display-name 'Drizzle' \ --admin-group drizzle-admin \ --dev-group drizzle-developers \ --vcs-handler launchpad \ --bug-handler launchpad \ --url http://drizzle.org $ mf package create \ -l drizzle7 \ --summary 'A Lightweight SQL Database for Cloud and Web' \ --source-name drizzle7 \ --user derks \ --one-per-system=true \ --footprint=2 $ mf package-branch create \ -l drizzle7.rpm \ --package drizzle7 \ --build-handler mock \ --url='bzr+ssh://bazaar.launchpad.net/~drizzle-developers/pkg-drizzle/rpm/' \ --release=el5,el6,fc13,fc14 \ --group=drizzle-developers $ mf build create \ -l drizzle7-2011.01.08-1 \ --package-branch drizzle7.rpm \ --type newpackage