-
Notifications
You must be signed in to change notification settings - Fork 159
GangaDB User Guide
With the completion of GSoC 2020 project, ganga project now supports the usage of databases to store job information instead of saving them as files in the gangadir
folder. To upgrade and get the new features, install ganga from the feature branch [database-master](https://github.com/ganga-devs/ganga/tree/database-master):
-
Install from source
# clone the repository $ git clone https://github.com/ganga-devs/ganga $ git checkout database-master # install the package $ python setup.py install
-
Install using pip from source
$ pip install https://github.com/ganga-devs/ganga/tree/database-master/archive/master.zip
- Install from
pypi
:
# Will be updated soon.
The usage documentation can be found here:
This guide is for users who have used ganga
before and wish to use gangaDB
( and also migrate the current jobs from xml
format to the database
).
-
Native Database: Instructions to install
-
Docker Container: Instructions to install
-
uDocker Container: Instructions to install. Make sure the update the location of the udocker binary in the config ( in case the location is not ~/udocker or the binary is not linked ) in the
.gangarc
:## UPDATE THE UDockerlocation var in the gangarc UDockerlocation = ~
Make sure the
udocker
binary is not execute restricted asganga
usessub-processes
to run commands using the binary. -
Singularity Container: Instructions to install
Once the controller of choice is installed, update the gangarc
config:
## UPDATE THE FOLLOWING SECTION OF gangarc, this example assumes docker
# Selection of database for ganga
[DatabaseConfiguration]
# Docker Image for the database
#baseImage = mongo
# Database Controller [Native, Docker, uDocker, Singularity]
controller = docker
# host
#host = localhost
# password
#password = default
# username
#username = default
Also update the repositorytype:
## LocalXML for using xml and Database for using gangaDB
repositorytype = Database
Now one last thing remains to run gangaDB
with the mentioned controller. Download the mongodb
image from the container repository ( skip in the case of native installation ).
The commands for the respective controllers are ( the controllers are listed in the order of reliability ):
-
Singularity: We use a custom image
sif
file that is hosted here. Users can manually download the sif file and store it in thegangadir
folder or letganga
do it for them. In the case of the latter, the file is downloaded and stored in thegangadir
folder mentioned in thegangarc
file. -
Docker:
docker pull mongo
-
uDocker:
udocker pull mongo
Now the user is ready for using gangaDB
. To test the installation, run a simple ganga
session
*** Welcome to Ganga ***
Version: 8.3.3 - DEV
Documentation and support: http://cern.ch/ganga
Type help() or help('index') for online help.
This is free software (GPL), and you are welcome to redistribute it
under certain conditions; type license() for details.
INFO reading config file /home/dumbmachine/work/ganga/.database.rc
INFO Docker gangaDB has started in background at 58207
[16:48:20]
Ganga In [1]: jobs
Ganga Out [1]:
Registry Slice: jobs (0 objects)
Now jobs are shown as we have none
in the database.
Previous users of ganga
who wish to port their old job files to the database can do so:
# download the migrating script
$ wget https://raw.githubusercontent.com/ganga-devs/ganga/develop/ganga/GangaCore/Core/GangaRepository/migrate.py
# run the script and all your jobs will be stored in the database
$ ganga migrate.py
Ganga will start the container with random free ports on the OS to avoid clash.