3. References

damona.common

Image and Binary handlers.

damona.config

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.

get_image()[source]

Return the container used by the binary

is_image_available()[source]

Return True if the image used by the binary does exist

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).

find_orphan_images()[source]

Get images that have no binaries in any environments

get_all_binaries()[source]

Return list of all binaries in all environments

get_all_images()[source]

Return list of all images

get_environments()[source]

return the list of environments names

property images_directory

Get the Damona images directory location

is_image_used(name)[source]

Return True if this image is used

The image name has no ".img" extension and uses _ instead of : character

# get images used
from damona import Damona
d = Damona()
d.get_all_images()

# Note that names are encoded as NAME_X.Y.Z

d.is_image_used("fastqc_0.11.9")
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'
delete()[source]
property guessed_executable

Guess the executable from the filename

is_installed()[source]

Return True is the file exists in the DAMONA_PATH

is_orphan()[source]
is_valid_name()[source]

Check whether the name is valid.

Must be in the form NAME_X.Y.Z.img

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')[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


[urls]
damona=https://..../registry.txt
url1=https://..../registry.txt

[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 --from 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.

add_bash()[source]
add_fish()[source]
add_zsh()[source]
read()[source]

Reads the config file

get_damona_commands()[source]

Print commands available in Damona if not hidden.

This function is used for the fish completion

3.5. environ module

3.6. install module

3.7. registry module

3.8. zenodo module

3.9. DAMONA standalone (script module)