Skip to content
boegel edited this page Apr 3, 2012 · 13 revisions

Configuring EasyBuild is done by providing a configuration file.

EasyBuild will try and find a config file by following the following steps:

  • if a configuration file was specified on the EasyBuild command line, it will try and use that
  • else, if the environment variable EASYBUILDCONFIG is defined, it will treat its value as the path for the configuration file
  • otherwise, it will try and use the (default) configuration file at the path <path where EasyBuild was placed>/easybuild/easybuild_config.py

The configuration file is than executed as if it were Python code (using exec), which provides a lot of flexibility to configurate EasyBuild.

How configuration works

The configuration file should define the following variables: buildPath, installPath, sourcePath, repositoryType, repositoryPath and logFormat. If one of these variables is not defined, EasyBuild will complain when it is used using this configuration file.

Build path

The buildPath variable should specify the directory in which EasyBuild will build software packages.

Building a software package is then performed in a subdirectory of the build path: <name>/<version>/<toolkit><versionsuffix> .

These build directories are emptied by EasyBuild when installation is completed.

Install path

The installPath variable should specify the directory in which EasyBuild will install software packages.

In the install path, EasyBuild will create a subdirectory software where the software package will be installed, in a subdirectory <name>/<version>-<toolkit><versionsuffix>, and a subdirectory modules in which the module files will be installed.

Source path

The sourcePath variable should specify the directory in which EasyBuild should look for software source/install files.

EasyBuild will try and find the installation files specified by the sources variable in the .eb specification file, in the following order of preference:

  • <sourcePath>/<name>: in a subdirectory determined by the name of the software package
  • <sourcePath>/<letter>/<name>: in the style of the easyblocks/easyconfigs directories: in a subdirectory determined by the name of the software package and the first letter of that name (lower case)
  • <sourcePath>: directly in the source path

Patch files will also be looked for in these locations, and in addition in the various easybuild/easyconfigs directories that are in the listed in the PYTHONPATH.

Reconfiguration using environment variables

The build path and install path can be (temporary) redefined afterwards using the EASYBUILDBUILDPATH and EASYBUILDINSTALLPATH environment variables, which have preference over the paths specified in the configuration file.

This can be useful when testing new easyblocks, for example.

Specification files repository

EasyBuild supports keeping track of .eb specification files which serve as software package installation configuration files. To support this, EasyBuild will upload the specification file used in a successful installation to a repository defined by the repositoryType and repositoryPath configuration variables.

The repositoryType should be set to one of the following, to indicate the type of repository:

  • fs: a plain flat file repository; the repositoryPath should contain the directory where the files should be stored
  • git: a non-empty bare git repository (created with git init --bare or git clone --bare); the repositoryPath should contain the location of the git repository, i.e., a directory or URL
  • svn: an SVN repository; the repositoryPath should indicate the repository location (directory or URL)

Using git requires the GitPython Python modules, using svn requires the pysvn Python module (see Dependencies).

If access to the specification files repository fails for some reason (e.g., no network or a required Python module), then this will just result in a warning. EasyBuild will still install the software, only the specification file will not be added automatically into the repository.

Log format

The logFormat variable should contain a tuple specifying a log directory name and a template string, optionally using the following supported fields:

  • name: the name of the software package being installed
  • version: the version of the software package being installed
  • date: the date on which the installation was performed (in YYYYMMDD format, e.g. 20120324)
  • time: the time at which the installation was started (in HHMMSS format, e.g. 214359)

Example : logFormat=("easylog","easybuild-%(name)s.log")

Example configuration

A simple example configuration file, which specifies the home directory as base and dictates to use /tmp as build path:

import os

home = os.getenv('HOME')

buildPath = "/tmp/easybuild"
installPath = home
sourcePath = os.path.join(home, "sources")

repositoryType = 'fs'
repositoryPath = os.path.join(home, "ebfiles")

logFormat = ("easybuildlogs", "%(name)s-%(version)s.log")`

Default configuration

The default configuration file that comes with EasyBuild (easybuild/easybuild_config.py) can be used as a starting point. It uses the following settings:

Paths

The prefix for the build, install and source directories is obtained from the EASYBUILDPREFIX environment variable, if it is defined.

If not, the prefix is set to the home directory, which is determined using the environment variable HOME.

If for some reason $HOME is not defined, the configuration file reverts to using /tmp as prefix.

The different paths are then defined as follows:

  • buildPath: <prefix>/easybuild_build
  • installPath: <prefix>/easybuild
  • sourcePath: <prefix>/easybuild_sources

Specification files repository

The repositoryType is set to fs, and the repositoryPath is specified as <prefix>/easybuild_ebfiles_repo.

Log format

The default log format uses all fields available:

("easybuildlog", "easybuild-%(name)s-%(version)s-%(date)s.%(time)s.log")

Clone this wiki locally