Installation¶
Docker installation¶
The easiest way to get started with Zenodo is using the provided docker image. First checkout the source code, build all docker images and boot them up using Docker Compose:
$ git clone https://github.com/zenodo/zenodo.git
$ git checkout master
$ docker-compose build
$ docker-compose up
Next, create the database, indexes, fixtures and an admin user:
$ docker-compose run --rm web bash /code/zenodo/scripts/init.sh
$ docker-compose run --rm statsd bash /init.sh
Next, load demo records:
$ docker-compose run --rm web zenodo fixtures loaddemorecords
$ docker-compose run --rm web zenodo migration recordsrun
$ docker-compose run --rm web zenodo index reindex --yes-i-know
$ docker-compose run --rm web zenodo index run -d
Now visit the following URL in your browser:
https://<docker ip>
You can use the following web interface to inspect Elasticsearch and RabbitMQ:
- Elasticsearch: http://<docker ip>:9200/_plugin/hq/
- RabbitMQ: http://<docker ip>:15672/ (guest/guest)
Also the following ports are exposed on the Docker host:
80
: Nginx443
: Nginx5000
: Zenodo5432
: PostgreSQL5601
: Kibana5672
: RabbitMQ6379
: Redis8125
: StatsD (UDP)9200
: Elasticsearch9300
: Elasticsearch15672
: RabbitMQ management console
Dependencies
Zenodo depends on PostgreSQL, Elasticsearch, Redis and RabbitMQ.
Development installation¶
For core developers it is often faster and easier in the long run to not to use Docker, with a bit of extra up-front work to configure your box. Note, however that Docker provides the most similar environment to the production environment.
First check out the source code:
$ cd ~/src/
$ git clone https://github.com/zenodo/zenodo.git
$ cd zenodo
Next, create a virtual environment (using virtualenvwrapper):
$ mkvirtualenv zenodo
(zenodo)$
Zenodo works on both on Python 2.7 and 3.5+. However in case you need to use the XRootD storage interface, you will need Python 2.7 as the underlying libraries don’t support Python 3.5+ yet.
Next, install Invenio extensions and Zenodo itself:
(zenodo)$ pip install -r requirements.txt --src ~/src/ --pre
(zenodo)$ pip install -e .[all,postgresql]
Above command will checkout development versions of certain Invenio extensions
into ~/src/
as well as install Zenodo with PostgreSQL support.
Media assets¶
Afterwards you need to download and build the media assets for Zenodo. This is done like this:
(zenodo)$ ./scripts/setup-assets.sh
Note
For the above commands to work you need to have NodeJS, SASS, CleanCSS, UglifyJS and RequireJS installed:
(zenodo)$ ./scripts/setup-npm.sh
Feel free to take a peek in the scripts to see the commands being run
Initialization¶
Next, create the database and Elasticsearch indexes and an admin user:
(zenodo)$ ./scripts/init.sh
You must already have PostgreSQL, Elasticsearch 2.x, Redis and RabbitMQ for above to work.
Demo records¶
You can now load the demo records (licenses, funders, grants, records):
(zenodo)$ celery worker -A zenodo.celery -l INFO --purge
(zenodo)$ zenodo opendefinition loadlicenses
(zenodo)$ zenodo fixtures loadlicenses
(zenodo)$ zenodo openaire loadfunders \
--source=~/src/invenio-openaire/invenio_openaire/data/fundref_registry.rdf
(zenodo)$ zenodo fixtures loadfp6grants
(zenodo)$ zenodo openaire loadgrants --setspec=FP7Projects
(zenodo)$ zenodo fixtures loaddemorecords
(zenodo)$ zenodo migration recordsrun
(zenodo)$ zenodo migration reindex recid
(zenodo)$ zenodo index run -d
Badges¶
In order for the DOI badges to work you must have the Cairo SVG library and the DejaVu Sans font installed on your system . Please see Invenio-Formatter for details.