Skip to content

lithops-cloud/lithops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4,422 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lithops

   PyPI - Downloads Ask DeepWiki

Lithops is a Python multi-cloud distributed computing framework that lets you run unmodified Python code at massive scale across cloud, HPC, and on-premise platforms. It supports major cloud providers and Kubernetes platforms, running your code transparently without requiring you to manage deployment or infrastructure.

Lithops is ideal for highly parallel workloads—such as Monte Carlo simulations, machine learning, metabolomics, or geospatial analytics—and lets you tailor execution to your priorities: you can optimize for performance using AWS Lambda to launch hundreds of functions in milliseconds, or reduce costs by running the same code on AWS Batch with Spot Instances.

Installation

  1. Install Lithops from the PyPI repository:

    pip install lithops
  2. Execute a Hello World function:

    lithops hello

Configuration

Lithops provides an extensible backend architecture for compute and storage, designed to work with various cloud providers and on-premise platforms. You can write your code in Python and run it unmodified across major cloud providers and Kubernetes environments.

📁 Follow these instructions to configure your compute and storage backends

Supported backends by platform:

Platform Compute Storage
Localhost
Localhost
Localhost Localhost
IBM Cloud IBM Code Engine
IBM Virtual Private Cloud
IBM Cloud Object Storage
AWS AWS Lambda
AWS Batch
AWS Elastic Compute Cloud (EC2)
AWS S3
Google Cloud Google Cloud Run functions
Google Cloud Run
Google Compute Engine
Google Cloud Storage
Microsoft Azure Azure Functions
Azure Container Apps
Azure Virtual Machines
Azure Blob Storage
Alibaba Cloud Aliyun Functions Compute Aliyun Object Storage Service
Oracle Cloud Oracle Functions Oracle Object Storage
Kubernetes
OpenShift
Kubernetes Jobs
Knative
Singularity
OpenWhisk
Virtual Machine
OpenStack Swift
Redis
Ceph
MinIO
Infinispan

High-level API

Lithops provides two high-level compute APIs and two high-level storage APIs.

from lithops import FunctionExecutor

def double(i):
    return i * 2

with FunctionExecutor() as fexec:
    f = fexec.map(double, [1, 2, 3, 4])
    print(f.result())
from lithops.multiprocessing import Pool

def double(i):
    return i * 2

with Pool() as pool:
    result = pool.map(double, [1, 2, 3, 4])
    print(result)
from lithops import Storage

if __name__ == "__main__":
    st = Storage()
    st.put_object(bucket='mybucket', key='test.txt', body='Hello World')
    print(st.get_object(bucket='mybucket', key='test.txt'))
from lithops.storage.cloud_proxy import os

if __name__ == "__main__":
    filepath = 'bar/foo.txt'
    with os.open(filepath, 'w') as f:
        f.write('Hello world!')

    dirname = os.path.dirname(filepath)
    print(os.listdir(dirname))
    os.remove(filepath)

You can find more usage examples in the examples folder.

Documentation

For documentation on using Lithops, see the latest release documentation.

If you are interested in contributing, see CONTRIBUTING.md.

Additional resources

Blogs and Talks

Papers

Acknowledgements

This project has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreement No. 825184 (CloudButton).

About

A multi-cloud framework for big data analytics and embarrassingly parallel jobs, that provides an universal API for building parallel applications in the cloud ☁️🚀

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages