What is Invenio Fabric?

Invenio Fabric is a set of Fabric tasks to help with Invenio's installation process.

Following the instructions described below will allow to have independent environments for Invenio + Inspire, Invenio OPS + Inspire or Invenio NEXT and easily switch between them.

The main page of Invenio Fabric is https://github.com/lnielsen-cern/invenio-fabric and this document repeats some of the information found on the website, focusing on the INSPIRE needs

#Requirements

Requirements

Fabric 1.4+: http://docs.fabfile.org
Virtualenv: http://pypi.python.org/pypi/virtualenv
Virtualenvwrapper: http://pypi.python.org/pypi/virtualenvwrapper

Optional:

Pythonbrew: https://github.com/utahta/pythonbrew
Important: Invenio Fabric requires you to already have system dependencies installed (e.g. OpenOffice etc). Please see http://invenio-software.org/wiki/Installation or e.g. https://github.com/lnielsen-cern/invenio-vagrant/blob/master/provision-ubuntu.sh for how to install system dependencies on your system.

Python 2.4: If you are planning to use Pythonbrew with Python 2.4, you must install virtualenv 1.7.2 (or lower), as virtualenv 1.8 dropped support for Python 2.4.

Before starting the installation process other libraries might be needed for Pythonbrew to be able to compile some Python modules, install them first:

$ sudo apt-get install zlib1g-dev libbz2-dev libreadline-dev libgdbm-dev libssl-dev libsqlite3-dev ncurses-dev libxslt-dev

To install the requirements follow the instructions in https://github.com/lnielsen-cern/invenio-fabric#requirements


Installation steps

Note: If installing Inspire, to avoid an error in the last step of the bootstrap process open your mysql config file (usually located in /etc/mysql/my.cnf) and add local-infile in both sections [mysqld] and [mysql] , otherwise the step install-dbchanges will fail

Invenio master + INSPIRE master

workon fabenv
cdvirtualenv
cd share/inspire/
  • Open fabfile.py
env = env_create('loc', name=env_make_name(inspireinvenio, py or '', ref or ''),
activate=activate, python=py, **kwargs)

First parameter of env_make_name is the name your new virtualenv will have once the process is finished.

env.CFG_INVENIO_REPOS += [
('inspire', {
'repository': 'http://invenio-software.org/repo/inspire',
'ref': 'master',
'bootstrap_targets': ['install', ],
'deploy_targets': ['install', ],
'requirements': ['requirements.txt', 'requirements-extra.txt'],
'configure_hook': template_hook_factory('config-local.mk', '%(topsrcdir)s/config-local.mk'),
'prepare_hook': None
}),
]

We are appending the INSPIRE repo to the variable CFG_INVENIO_REPOS. To see what are the defaults of this variable one can check the file env.py (part of Invenio Fabric distribution)

This will install Invenio master and Inspire master

Before starting the installation it is good to double check the config files:

  • config-local.mk - Inspire specific
  • etc/invenio-local.conf
They should work by default in a local development machine

Now, to start the installation, make sure you are in the folder share/inspire and then:

$ fab loc bootstrap

Here is a short description of what each step does:

  • mysql_dropdb: looks for db called like the first parameter of env_make_name and user with the same name, if exists drops it
  • mysql_createdb: In our example, will create db with name inspireinvenio and user inspireinvenio
  • venv_create: will create the virtualenv for your installation in folder $WORKON_HOME
  • repo_update: will take from your folder CFG_SRCDIR/invenio the branch master and from CFG_SRCDIR/inspire master.
  • venv_requirements: installs requirements, default requirements.txt and requirements-extra.txt
  • repo_install: will run bootstrap_targets on the repos
  • invenio_conf: copies the template invenio-local.conf to the virtualenv installation path
  • devserver_conf: copies the configuration file for the dev server. You can read it more about it in https://bitbucket.org/osso/invenio-devserver
  • invenio_createdb: creates all Invenio tables
  • inspire_dbchanges: for this step we need local-infile in my.cnf. It will insert Inspire specific data into the database

Invenio OPS + INSPIRE master

For developers in the OPS team, it is only needed to change in the fabfile.py the following:

env.CFG_INVENIO_REPOS += [
('inspire', {
'repository': ssh://%(user)s@lxplus.cern.ch/afs/cern.ch/project/inspire/repo/invenio-inspire-ops.git' % env,
'ref': 'master',
'bootstrap_targets': ['install', ],
'deploy_targets': ['install', ],
'requirements': ['requirements.txt', 'requirements-extra.txt'],
'configure_hook': template_hook_factory('config-local.mk', '%(topsrcdir)s/config-local.mk'),
'prepare_hook': None
}),
]

If in CFG_INVENIO_REPOS the repo invenio is not specified, by default the master branch will be installed. You can see the defaults in the invenio fabric source (see file env.py)

If you want to specify what to install we can explicitly write it like:

env.CFG_INVENIO_REPOS = [
('invenio', {
'repository': 'http://invenio-software.org/repo/invenio/',
'ref': 'origin/maint-1.1',
'bootstrap_targets': ['all', 'install', 'install-mathjax-plugin', 'install-ckeditor-plugin', 'install-pdfa-helper-files', 'install-jquery-plugins', ],
'deploy_targets': ['all', 'install', ],
}),
('inspire', {
'repository': 'http://invenio-software.org/repo/inspire',
'ref': 'master',
'bootstrap_targets': ['install', ],
'deploy_targets': ['install', ],
'requirements': ['requirements.txt', 'requirements-extra.txt'],
'configure_hook': template_hook_factory('config-local.mk', '%(topsrcdir)s/config-local.mk'),
'prepare_hook': None
})
]

Invenio Next

To install Atlantis demo site with Invenio next follow instructions from https://github.com/lnielsen-cern/invenio-fabric#usage-example Next and Inspire need further testing

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r3 - 2012-11-30 - JavierMartin
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Inspire All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback