Code reference#
fastrpi
Package#
checks
Module#
- class fastrpi.checks.MacroNodePackageChecks(package: MacroNodePackage)#
Bases:
ToolPackageChecks
Checks to assure proper formatting and functionality of the tool packages. These checks are run before publishing and in the CI/CD pipeline.
- class fastrpi.checks.NetworkPackageChecks(package: NetworkPackage)#
Bases:
PackageChecks
Checks to assure proper formatting and functionality of the network packages. These checks are run before publishing and in the CI/CD pipeline.
- class fastrpi.checks.PackageChecks(package: Package)#
Bases:
object
Checks to assure proper formatting and functionality of the packages. These checks are run before publishing and in the CI/CD pipeline.
This class can be subclassed to implement specific checks for different package types.
- class fastrpi.checks.ToolPackageChecks(package: ToolPackage)#
Bases:
PackageChecks
Checks to assure proper formatting and functionality of the tool packages. These checks are run before publishing and in the CI/CD pipeline.
config
Module#
exceptions
Module#
- exception fastrpi.exceptions.FastrPIAlreadyInstalled(*args, **kwargs)#
Bases:
FastrPIInstallError
- exception fastrpi.exceptions.FastrPICreateError(*args, **kwargs)#
Bases:
FastrPIError
- exception fastrpi.exceptions.FastrPIDockerError(*args, **kwargs)#
Bases:
FastrPIError
- exception fastrpi.exceptions.FastrPIError(*args, **kwargs)#
Bases:
Exception
This is the base class for all FastrPI related exceptions. Catching this class of exceptions should ensure a proper execution of FastrPI.
- excerpt()#
Return an excerpt of the Error as a tuple.
- exception fastrpi.exceptions.FastrPIGitError(*args, **kwargs)#
Bases:
FastrPIError
- exception fastrpi.exceptions.FastrPIInputError(*args, **kwargs)#
Bases:
FastrPIError
- exception fastrpi.exceptions.FastrPIInstallError(*args, **kwargs)#
Bases:
FastrPIError
- exception fastrpi.exceptions.FastrPIManifestError(*args, **kwargs)#
Bases:
FastrPIError
- exception fastrpi.exceptions.FastrPINotInstalled(*args, **kwargs)#
Bases:
FastrPIInstallError
- exception fastrpi.exceptions.FastrPIPublishError(*args, **kwargs)#
Bases:
FastrPIError
- exception fastrpi.exceptions.FastrPIPublishTestError(*args, **kwargs)#
Bases:
FastrPIPublishError
- exception fastrpi.exceptions.FastrPIRunError(*args, **kwargs)#
Bases:
FastrPIError
helpers
Module#
- fastrpi.helpers.check_valid_yaml(path: Path) bool #
Check if the YAML file at path is valid YAML and can be loaded.
- Parameters:
path – Path to a YAML file.
- Returns:
True if valid, False if not.
- fastrpi.helpers.load_module_from_file(filepath: Path, module_name: str)#
Loads Python file as module. Used in the run command.
- Parameters:
filepath – Python file
module_name – Name to give the module.
- Return mymodule:
Loaded module.
- fastrpi.helpers.read_yaml(yaml_path: Path) dict #
Read in a YAML file.
- Parameters:
yaml_path – Path to the YAML file.
- Return data:
Dictionary.
- fastrpi.helpers.walk_dict_list(d)#
manifest
Module#
- class fastrpi.manifest.Manifest(manifest_path: Path | str, **kwargs)#
Bases:
UserDict
Manifest object
Contains the content of the package manifest. After the manifest YAML file is loaded, the data is stored in this object as if it were a dictionary. Derivative variables are accessed through property methods.
- property container: Dict[str, str] | None#
Information on the associated Docker container for the appropriate package_type. Returns None when package_type has no associated container.
- Returns:
Dictionary with keys name, version, image and dockerurl or None
- property files: List[Path]#
List of files which are part of the package. Predominantly used for moving and copying these files.
- subclasses = {'macronode': <class 'fastrpi.manifest.MacroNodeManifest'>, 'network': <class 'fastrpi.manifest.NetworkManifest'>, 'tool': <class 'fastrpi.manifest.ToolManifest'>}#
package
Module#
- class fastrpi.package.MacroNodePackage(manifest: Manifest)#
Bases:
ToolPackage
- package_type = 'MacroNode'#
- class fastrpi.package.NetworkPackage(manifest: Manifest)#
Bases:
Package
- copy_source_sink(dest_folder)#
- package_type = 'Network'#
- class fastrpi.package.Package(manifest: Manifest)#
Bases:
object
- copy_files(dest_folder)#
- classmethod make_tag(info: PackageInfo) str #
- package_type = 'Package'#
- run_checks()#
- subclasses = {'macronode': <class 'fastrpi.package.MacroNodePackage'>, 'network': <class 'fastrpi.package.NetworkPackage'>, 'tool': <class 'fastrpi.package.ToolPackage'>}#
packageinfo
Module#
record
Module#
- class fastrpi.record.InstallRecord(config: Config)#
Bases:
object
Install Record
The InstallRecord object keeps track of the installed packages.
- check_installed(package_info: PackageInfo) bool #
- property installed_packages: List[PackageInfo]#
- load_package(package_info: PackageInfo) Package #
- class fastrpi.record.NetworkInstallRecord(config: Config)#
Bases:
InstallRecord
- class fastrpi.record.ToolInstallRecord(config: Config)#
Bases:
InstallRecord
- add(package: ToolPackage) None #
repository
Module#
- class fastrpi.repository.NetworkPackageRepository(config: Config)#
Bases:
PackageRepository
- property avail_packages: List[PackageInfo]#
- install(package_info: PackageInfo) None #
- class fastrpi.repository.PackageRepository(config: Config)#
Bases:
object
Package repository API
To encapsulate the technical implementation of the package storage, the PackageRepository objects are used to form a facade.
- property avail_packages_info: List[PackageInfo]#
- check_available(package_info: PackageInfo) bool #
- abstract install(package_info: PackageInfo) Package #
- class fastrpi.repository.ToolPackageRepository(config: Config)#
Bases:
PackageRepository
- property avail_packages: List[PackageInfo]#
- install(package_info: PackageInfo) None #
repositorybackend
Module#
- class fastrpi.repositorybackend.ContainerRepository(config: Config)#
Bases:
RepositoryBackEnd
- class fastrpi.repositorybackend.DockerRepositoryBackEnd(config: Config)#
Bases:
ContainerRepository
- class fastrpi.repositorybackend.GitRepository(config: Config)#
Bases:
RepositoryBackEnd
- checkout_tag(tag: str) None #
Checks out a tagged commit. This process is canceled when the tag cannot be found locally. Raises an exception when the checkout process fails.
- Parameters:
tag – Tag to checkout.
- fetch_origin() None #
Fetches the remote repository at origin. Raises an exception when the remote repository cannot be fetched.
- abstract folder_path(package_info: PackageInfo) Path #
- property git_direct#
Produces an object to directly access Git functionality.
- pull(package_info: PackageInfo) Manifest #
Retrieves a package from the repository by checking out the corresponding folder using sparse checkout.
- Parameters:
package_info – Package info
- pull_origin() None #
Pulls the remote repository at origin. Raises an exception when the remote repository cannot be pulled.
- remove_sparse_checkout(name: str) None #
Removes folder from sparse checkout if present.
- Parameters:
name – Folder to be removed from sparse checkout.
- property repository#
- class fastrpi.repositorybackend.NetworkGitRepository(config: Config)#
Bases:
GitRepository
- folder_path(package_info: PackageInfo) Path #
- property installed_list: List[PackageInfo] | List[Any]#
- class fastrpi.repositorybackend.RepositoryBackEnd(config: Config)#
Bases:
object
Package repository back-end
All RepositoryBackEnd objects currently contain the implementation of the local and remote storage of the packages.
- class fastrpi.repositorybackend.SingularityRepositoryBackEnd(config: Config)#
Bases:
ContainerRepository
- class fastrpi.repositorybackend.SingularitySlurmRepositoryBackEnd(config: Config)#
Bases:
SingularityRepositoryBackEnd
- class fastrpi.repositorybackend.ToolGitRepository(config: Config)#
Bases:
GitRepository
- folder_path(package_info: PackageInfo) Path #
- property installed_list: List[PackageInfo] | List[Any]#