Configuration ============= .. note:: By default, if no configuration is provided, Lithops will use the `Localhost `_ backend to run the functions. To work with Lithops on the Cloud, you must configure at least one compute backend and one storage backend. Lithops can work both with the leading cloud providers, and using on-premise or Kubernetes platforms. You have multiple options to choose compute and storage backends based on your needs. Lithops configuration can be provided either using a **configuration file**, or in runtime via a **python dictionary.** Compute and Storage backends ---------------------------- Choose your compute and storage engines from the table below: +--------------------------------------------------------------------+--------------------------------------------------------------------+ | Compute backends | Storage Backends | +====================================================================+====================================================================+ || `Localhost `_ || `IBM Cloud Object Storage `_ | || `IBM Cloud Functions `_ || `AWS S3 `_ | || `IBM Code Engine `_ || `Google Cloud Storage `_ | || `AWS Lambda `_ || `Azure Blob Storage `_ | || `AWS Batch `_ || `Aliyun Object Storage Service `_ | || `Google Cloud Functions `_ || `Infinispan `_ | || `Google Cloud Run `_ || `Ceph `_ | || `Azure Functions `_ || `MinIO `_ | || `Azure Container Apps `_ || `Redis `_ | || `Aliyun Function Compute `_ || `OpenStack Swift `_ | || `Kubernetes Jobs `_ || | || `Knative `_ || | || `OpenWhisk `_ || | || `Remote Host / Virtual Machine `_ || | || `IBM Virtual Private Cloud `_ || | || `AWS Elastic Compute Cloud (EC2) `_ || | || `Azure Virtual Machines `_ || | +--------------------------------------------------------------------+--------------------------------------------------------------------+ Configuration File ------------------ To configure Lithops through a `configuration file `_ you have multiple options: 1. Create e new file called ``config`` in the ``~/.lithops`` folder. 2. Create a new file called ``.lithops_config`` in the root directory of your project from where you will execute your Lithops scripts. 3. Create the config file in any other location and configure the `LITHOPS_CONFIG_FILE` system environment variable indicating the absolute or relative location of the configuration file: .. code-block:: LITHOPS_CONFIG_FILE= Configuration keys in runtime ----------------------------- An alternative mode of configuration is to use a Python dictionary. This option allows to pass all the configuration details as part of the Lithops invocation in runtime. You can see an entire list of configuration keys at the :ref:`config-reference-label` section. Here is an example of providing configuration keys for IBM Cloud Functions and IBM Cloud Object Storage: .. code:: python import lithops config = {'lithops': {'backend': 'ibm_cf', 'storage': 'ibm_cos'}, 'ibm': {'region': 'REGION', 'iam_api_key': 'IAM_API_KEY', 'resource_group_id': 'RESOURCE_GROUP_ID'} 'ibm_cos': {'api_key': 'API_KEY', 'storage_bucket': 'STORAGE_BUCKET'}} def hello_world(name): return 'Hello {}!'.format(name) if __name__ == '__main__': fexec = lithops.FunctionExecutor(config=config) fexec.call_async(hello_world, 'World') print(fexec.get_result()) .. _config-reference-label: Configuration Reference ----------------------- Lithops Config Keys ~~~~~~~~~~~~~~~~~~~ .. csv-table:: :file: lithops_config_keys.csv :delim: ; :widths: 5 5 20 10 60 :header-rows: 1