-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
Configuring EasyBuild is done by providing a configuration file.
EasyBuild will use the file that is provided by the path/filename in the following order:
- specified on the EasyBuild command line,
- from the environment variable
EASYBUILDCONFIG(if it is defined) - the (default) configuration file at the
<path where EasyBuild was placed>/easybuild/easybuild_config.py
EasyBuild expects the configuration file to contain valid Python code, because it executes its contents (using exec). The rationale is that this approach provides a lot of flexibility for configuring EasyBuild.
The configuration file must define the following six variables: buildPath, installPath, sourcePath, repositoryType, repositoryPath and logFormat.
If one of them is not defined, EasyBuild will complain and bail.
The buildPath variable specifies the directory in which EasyBuild builds its software packages.
Each software package is built in a subdirectory of the buildPath under <name>/<version>/<toolkit><versionsuffix>.
Note that the build directories are emptied by EasyBuild when the installation is completed. They are not removed at this point.
The installPath variable specifies the directory in which EasyBuild installs software packages and the corresponding module files.
The packages themselves are installed under installPath/software in their own subdirectory aptly named <name>/<version>-<toolkit><versionsuffix>, where name is the package name. The corresponding module files are installed under installPath/modules.
Setting MODULEPATH
After the configuration, you need to make sure that MODULEPATH environment variable is extended with the modules/all subdirectory of the installPath, i.e.:
export MODULEPATH=<installPath>/modules/all:$MODULEPATH
It is probably a good idea to add this to your (favourite) shell .rc file, e.g., .bashrc, and/or the .profile login scripts, so you do not need to adjust the MODULEPATH variable every time you start a new session.
The sourcePath variable specifies the directory in which EasyBuild looks for software source and install files.
Similarly to the configuration file lookup, EasyBuild looks for the installation files as given by the sources variable in the .eb specification file, in the following order of preference:
-
<sourcePath>/<name>: a subdirectory determined by the name of the software package -
<sourcePath>/<letter>/<name>: in the style of theeasyblocks/easyconfigsdirectories: in a subdirectory determined by the first letter (in lower case) of the software package and by its fullname -
<sourcePath>: directly in the source path
Note that these locations are also used when EasyBuild looks for patch files in addition to the various easybuild/easyconfigs directories that are listed in the PYTHONPATH.
You can (temporary) override both the buildPath and installPath settings by defining the EASYBUILDBUILDPATH and EASYBUILDINSTALLPATH environment variables.
Overriding the configuration file is commonly done when testing new easyblocks.
EasyBuild has support for keeping track of (tested) .eb specification files. These files serve configuration files for software package installation. After successfully installing a software package using EasyBuild, the corresponding .eb file is uploaded to a repository defined by the repositoryType and repositoryPath configuration variables.
Currently, EasyBuild supports the following repository types:
-
fs: a plain flat file repository. In this case, therepositoryPathcontains the directory where the files are stored, -
git: a non-empty bare git repository (created withgit init --bareorgit clone --bare). Here, therepositoryPathcontains the git repository location, which can be a directory or an URL. -
svn: an SVN repository. In this case, therepositoryPathcontains the subversion repository location, again, this can be a directory or an 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.
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 (inYYYYMMDDformat, e.g.20120324) -
time: the time at which the installation was started (inHHMMSSformat, e.g.214359)
Example : logFormat=("easylog","easybuild-%(name)s.log")
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")`
The default configuration file that comes with EasyBuild (easybuild/easybuild_config.py) can be used as a starting point.
It uses the following settings:
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
The repositoryType is set to fs, and the repositoryPath is specified as <prefix>/easybuild_ebfiles_repo.
The default log format uses all fields available:
("easybuildlog", "easybuild-%(name)s-%(version)s-%(date)s.%(time)s.log")