Installation¶
Install from Source¶
Jikken can be installed from source. This installation is compatible with Linux/Mac OS X and Python 3.{5,6}. In order to use mongoDB or elasticsearch a database need to be setup and running already.
- git clone the library
git clone https://github.com/outcastofmusic/jikken.git
- run the setup install
python3 setup.py install
Database Configuration¶
Jikken uses a configuration file named config with the database information it will use. It will look for it in the experiment scripts directory in teh file $SCRIPT_DIR/.jikken/config. If it can’t find a project specific config it will look for a global one inside the users HOME dir in the file ~/.jikken/config. If That doesn’t exist either it will create it with default values using tinydb as the database.
The config file should look like this
[db]
path = ~/.jikken/jikken_db/
type = tiny
name = jikken
Where: - path is the path to the database (or a valid uri in the case of mongodb or es. - type is the type of the database (valid options are: tiny, mongo, es (ES not implemented yet). - name is the name of the database to use. Default is jikken.
An example of a config file using Mongo would be
[db]
path = mongodb://localhost:27017
type = mongo
name = jikken
An example of a config file using ElasticSearch would be
[db]
path = http:://localhost:9200
type = es
name = jikken
Setup MongoDB using docker¶
pull the mongodb image:
docker pull mongo
then run the image. You can use the -p flag to map the port to a localport (that matches the one in the config file and also mount a local folder where the db will be located
docker run --name jikken-mongo -p $LOCALPORT:27017 -v $LOCALPATH:/data/db -d mongo
For more info see the official docker mongo information.
Setup ES using docker¶
pull the es image:
docker pull docker.elastic.co/elasticsearch/elasticsearch-oss:6.0.0
then run the image. (this command is for development mode):
docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch-oss:6.0.0
For more info see the official docker es guide.