3. References¶
Image and Binary handlers. |
|
The Damona configuration |
3.1. admin module¶
3.2. builders module¶
3.3. common module¶
Image and Binary handlers. Provide also a Damona manager
- class BinaryReader(filename)[source]¶
Manage a single binary
>>> from damona.common import BinaryReader >>> br = BinaryReader("~/.config/damona/envs/base/bin/fastqc") >>> br.get_image() 'fastqc:0.11.9' >>> br.is_image_available() True
constructor
- Parameters:
filename (str) -- the input name of the binary file
Can be use to check whether the binary is not orphan and its image is still available.
- class Damona[source]¶
Global manager to get information about environments, binaries, images.
- property config_path¶
Get the Damona config file location
- damona_path¶
This attribute stored the path where images and environments are stored
- property environments_path¶
Get the Damona environments directory location
- find_orphan_binaries()[source]¶
Find binaries in all environments that are orphans
By orphans, we mean that their image is not present anymore for some reasons (e.g., users delete it manually).
- property images_directory¶
Get the Damona images directory location
- class DamonaInit[source]¶
Class to create images/bin directory for DAMONA
This is called each time damona is started to make sure the required config file are present.
This class simply create the ~/.config/damona/envs and images directories. It also checks whether DAMONA_PATH and DAMONA_SINGULARITY_OPTIONS variables are defined in the environment.
- class ImageReader(name)[source]¶
Manage a single Singularity image
Constructor
- Parameters:
name -- the input name of the image (fullpath)
>>> from damona.common import ImageReader >>> ir = ImageReader("~/.config/damona/images/fastqc_0.11.9.img") >>> ir.md5 >>> ir.is_orphan() >>> ir.name >>> print(ir.shortname) 'fastqc_0.11.9.img' >>> print(ir.version) '0.11.9'
- property guessed_executable¶
Guess the executable from the filename
- property md5¶
compute and return the md5 of the file
- property shortname¶
Get the filename (NAME_X.Y.Z.img)
- property version¶
Get the version
3.4. config module¶
The Damona configuration
- class Config(name='damona', urls={'damona': 'https://biomics.pasteur.fr/salsa/damona/registry.txt'})[source]¶
A place holder to store our configuration file and shell scripts
This class is called each time damona is started. The config file, if not present is created, otherwise nothing happens. Same for the bash and fish shell configuration files
The damona configuration file looks like:
[general] quiet=False [zenodo] token=APmm6p.... orcid=0000-0001 name='Cokelaer, Thomas' affiliation='Institut Pasteur' [sandbox.zenodo] token=FFmbAEhQbb... orcid=0000-0001 name='Cokelaer, Thomas' affiliation='Institut Pasteur'
Where the urls section can be used to store aliases to external registry. When installing software using:
damona install example --url damona
if the alias damona is in the [urls] section, it is replaced by its real value (https://...) the URL must end with the expected registry name registry.txt
The zenodo section is not save by default since it is for developpers only.