Application Inventory

To expose applications for serving, ForML uses the application inventory as a lightweight storage service used for application deployment. At runtime, the serving engine looks up the requested descriptors of published applications to facilitate their serving.

In order to provide the inventory service, particular inventory provider instance(s) need to be configured within the runtime platform setup.

Content Management

Content of the inventory is populated through application publishing and can be managed using the CLI as follows (see the integrated help for full synopsis):

Use case

Command

Application (re)publishing

$ forml application put

Inventory content listing

$ forml application list

API

The inventory concept is based on the following simple API:

class forml.io.asset.Inventory(*args, **kwargs)[source]

Abstract base class for application descriptor storage providers.

Important

There is no concept of versioning - individual descriptors are held in a flat namespace requiring the uniqueness of each application name.

abstract list() Iterable[str][source]

List all the application names contained within the inventory.

Returns:

List of application names.

abstract get(application: str) application.Descriptor[source]

Retrieve the descriptor for the given application name.

Attention

Only applications returned by list() can be requested.

Parameters:
application: str

Application name.

Returns:

Application descriptor.

Raises:

forml.MissingError – If the application does not exist.

abstract put(descriptor: application.Descriptor.Handle) None[source]

Store the application descriptor in the inventory.

Caution

Existing application with the same name gets overwritten.

Parameters:
descriptor: application.Descriptor.Handle

Handle of the application descriptor to be stored.

class forml.application.Descriptor.Handle(path: str | Path)

Descriptor handle referring to a module file containing the application descriptor instance.

Parameters:
path: str | Path

File system path to the descriptor module file location.

Raises:

Inventory Providers

Inventory providers can be configured within the runtime platform setup using the [INVENTORY.*] sections.

The available implementations are:

Posix

Posix inventory implementation.