Skip to content

Commit f92c49e

Browse files
committed
Update docs to 3.6.0
1 parent cf819d5 commit f92c49e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+433
-205
lines changed

docs/_sources/source/cli.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,15 @@ Runtime management
151151
------------------
152152

153153
For complete instructions on how to build runtimes for Lithops, please
154-
refer to ``runtime/`` folder and choose your compute backend.
154+
refer to the ``runtime/`` folder and choose your compute backend.
155155

156156
``lithops runtime build <runtime-name>``
157157
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
158158

159159
Build a new runtime image. Depending of the compute backend, there must
160160
be a Dockerfile located in the same folder you run the command,
161161
otherwise use ``-f`` parameter. Note that this command only builds the
162-
image and puts it to a container registry. This command do not deploy
162+
image and puts it into a container registry. This command do not deploy
163163
the runtime to the compute backend.
164164

165165
+-----------------+-----------------------------------+
@@ -447,7 +447,7 @@ Deletes objects from a given bucket.
447447
``lithops storage list <bucket>``
448448
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
449449

450-
Deletes objects from a given bucket.
450+
Lists objects from a given bucket.
451451

452452
+-----------------+---------------------------------+
453453
| Parameter | Description |

docs/_sources/source/compute_config/aws_ec2.md

Lines changed: 50 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ The AWS EC2 client of Lithops can provide a truely serverless user experience on
66
The assumption that you already familiar with AWS, and you have AUTH credentials to your account (HMAC Credentials).
77

88
### Choose an operating system image for the VM
9-
Any Virtual Machine (VM) need to define the instance’s operating system and version. Lithops support both standard operating system choices provided by the VPC or using pre-defined custom images that already contains all dependencies required by Lithops.
9+
Any Virtual Machine (VM) needs to define the instance’s operating system and version. Lithops supports both standard operating system choices provided by the VPC or using pre-defined custom images that already contains all dependencies required by Lithops.
1010

11-
- Option 1: By default, Lithops uses an Ubuntu 22.04 image. In this case, no further action is required and you can continue to the next step. Lithops will install all required dependencies in the VM by itself. Notice this can consume about 3 min to complete all installations.
11+
- Option 1: By default, Lithops uses an Ubuntu 22.04 image. In this case, no further action is required and you can continue to the next step. Lithops will install all required dependencies in the VM by itself. Note this can consume about 3 min to complete all installations.
1212

1313
- Option 2: Alternatively, you can use a pre-built custom image that will greatly improve VM creation time for Lithops jobs. To benefit from this approach, navigate to [runtime/aws_ec2](https://github.com/lithops-cloud/lithops/tree/master/runtime/aws_ec2), and follow the instructions.
1414

@@ -109,13 +109,14 @@ In summary, you can use one of the following settings:
109109
|---|---|---|---|---|
110110
|aws_ec2 | region | |no | Region name, for example: `eu-west-1`. Lithops will use the `region` set under the `aws` section if it is not set here |
111111
|aws_ec2 | instance_role | | yes | EC2 Instance role name created in the configuration section above. Do not use the full ARN here; only the role name is required. For example: `ec2LithopsInstanceRole`|
112-
|aws_ec2 | vpc_id | | no | VPC id. You can find all the available VPCs in the [VPC Console page](https://console.aws.amazon.com/vpc/v2/home#vpcs:) |
113-
|aws_ec2 | subnet_id | | no | Subnet id. You can find all the available Subnets in the [VPC Console page](https://console.aws.amazon.com/vpc/v2/home#subnets:) |
114-
|aws_ec2 | security_group_id | | no | Security group ID. You can find the available security groups in the [VPC console page](https://console.aws.amazon.com/vpc/v2/home#SecurityGroups:). The security group must have ports 22 and 8080 open |
112+
|aws_ec2 | vpc_id | | no | VPC id. You can find all the available VPCs in the [VPC Console page](https://console.aws.amazon.com/vpc/v2/home#vpcs:). If not provided, Lithops will create a new VPC |
113+
|aws_ec2 | public_subnet_id | | no | Public subnet id. You can find all the available Subnets in the [VPC Console page](https://console.aws.amazon.com/vpc/v2/home#subnets:). If not provided, Lithops will create a new public subnet |
114+
|aws_ec2 | public_subnet_cidr_block | 10.0.1.0/24 | no | In case a `public_subnet_id` is not provided, Lithops will create a new subnet with this CIDR block |
115+
|aws_ec2 | security_group_id | | no | Security group ID. You can find the available security groups in the [VPC console page](https://console.aws.amazon.com/vpc/v2/home#SecurityGroups:). The security group must have ports 22, 6379, 8080 and 8081 open. If not provided, Lithops will create a new security group |
115116
|aws_ec2 | ssh_key_name | | no | SSH Key name. You can find the available keys in the [EC2 console page](https://console.aws.amazon.com/ec2/v2/home#KeyPairs:). Create a new one or upload your own key if it does not exist|
116117
|aws_ec2 | ssh_username | ubuntu |no | Username to access the VM |
117118
|aws_ec2 | ssh_password | |no | Password for accessing the worker VMs. If not provided, it is created randomly|
118-
|aws_ec2 | ssh_key_filename | ~/.ssh/id_rsa | no | Path to the ssh key file provided to access the VPC. It will use the default path if not provided |
119+
|aws_ec2 | ssh_key_filename | ~/.ssh/id_rsa | no | Path to the ssh key file provided to access the VPC. If not provided, Lithops will use the default path and create a new ssh key for the VPC |
119120
|aws_ec2 | request_spot_instances | True | no | Request spot instance for worker VMs|
120121
|aws_ec2 | target_ami | | no | Virtual machine image id. Default is Ubuntu Server 22.04 |
121122
|aws_ec2 | master_instance_type | t2.micro | no | Profile name for the master VM |
@@ -130,6 +131,47 @@ In summary, you can use one of the following settings:
130131
|aws_ec2 | exec_mode | reuse | no | One of: **consume**, **create** or **reuse**. If set to **create**, Lithops will automatically create new VMs for each map() call based on the number of elements in iterdata. If set to **reuse** will try to reuse running workers if exist |
131132

132133

134+
## Additional configuration
135+
136+
# Elastic Block Store (EBS)
137+
138+
To attach EBS volumes to an EC2 instance in Lithops, you can configure the `aws_ec2` section as follows.
139+
140+
```yaml
141+
aws_ec2:
142+
execution_role: <EXECUTION_ROLE_ARN>
143+
region: <REGION_NAME>
144+
...
145+
ebs_volumes:
146+
- device_name: /dev/xvda
147+
ebs:
148+
volume_size: 100
149+
volume_type: gp2
150+
delete_on_termination: true
151+
encrypted: false
152+
kms_key_id: <KMS_KEY_ARN>
153+
- device_name: /dev/xvdf
154+
ebs:
155+
volume_size: 50
156+
volume_type: gp3
157+
delete_on_termination: true
158+
encrypted: false
159+
iops: 3000
160+
throughput: 125
161+
...
162+
```
163+
164+
|Group|Key|Default|Mandatory|Additional info|
165+
|---|---|---|---|---|
166+
| ebs | volume_size | 8 | No | Size of the volume in GiB |
167+
| ebs | volume_type | gp2 | No | Type of volume. Options: `gp2`, `gp3`, `io1`, `io2`, `sc1`, `st1`, `standard`|
168+
| ebs | delete_on_termination| True | No | Whether the volume is deleted automatically when the instance is terminated |
169+
| ebs | encrypted | False | No | Whether the volume is encrypted |
170+
| ebs | kms_key_i | | No | ARN of the KMS key used for encryption. If not provided, the default AWS-managed key is used |
171+
| ebs | iops | | No | Provisioned IOPS for `io1`, `io2`, or `gp3` volumes |
172+
| ebs | throughput | | No | Throughput in MiB/s for `gp3` volumes |
173+
174+
133175
## Consume mode
134176

135177
In this mode, Lithops can start and stop an existing VM, and deploy an entire job to that VM. The partition logic in this scenario is different from the `create/reuse` modes, since the entire job is executed in the same VM.
@@ -188,7 +230,7 @@ In summary, you can use one of the following settings:
188230
|aws_ec2 | ssh_username | ubuntu |no | Username to access the VM |
189231
|aws_ec2 | ssh_key_filename | ~/.ssh/id_rsa | no | Path to the ssh key file provided to create the VM. It will use the default path if not provided |
190232
|aws_ec2 | worker_processes | AUTO | no | Number of parallel Lithops processes in a worker. This is used to parallelize function activations within the worker. By default it detects the amount of CPUs in the VM|
191-
|aws_ec2 | runtime | python3 | no | Runtime name to run the functions. Can be a container image name. If not set Lithops will use the defeuv python3 interpreter of the VM |
233+
|aws_ec2 | runtime | python3 | no | Runtime name to run the functions. Can be a container image name. If not set Lithops will use the default python3 interpreter of the VM |
192234
|aws_ec2 | auto_dismantle | True |no | If False then the VM is not stopped automatically.|
193235
|aws_ec2 | soft_dismantle_timeout | 300 |no| Time in seconds to stop the VM instance after a job **completed** its execution |
194236
|aws_ec2 | hard_dismantle_timeout | 3600 | no | Time in seconds to stop the VM instance after a job **started** its execution |
@@ -211,7 +253,7 @@ lithops logs poll
211253

212254
## VM Management
213255

214-
Lithops for AWS EC2 follows a Mater-Worker architecture (1:N).
256+
Lithops for AWS EC2 follows a Master-Worker architecture (1:N).
215257

216258
All the VMs, including the master VM, are automatically stopped after a configurable timeout (see hard/soft dismantle timeouts).
217259

docs/_sources/source/configuration.rst

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -71,22 +71,30 @@ Here is an example of providing configuration keys for IBM Cloud Functions and I
7171

7272
.. code:: python
7373
74-
import lithops
75-
76-
77-
config = {'lithops': {'backend': 'ibm_cf', 'storage': 'ibm_cos'},
78-
'ibm': {'region': 'REGION',
79-
'iam_api_key': 'IAM_API_KEY',
80-
'resource_group_id': 'RESOURCE_GROUP_ID'}
81-
'ibm_cos': {'storage_bucket': 'STORAGE_BUCKET'}}
82-
83-
def hello_world(name):
84-
return 'Hello {}!'.format(name)
85-
86-
if __name__ == '__main__':
87-
fexec = lithops.FunctionExecutor(config=config)
88-
fexec.call_async(hello_world, 'World')
89-
print(fexec.get_result())
74+
import lithops
75+
76+
config = {
77+
'lithops': {
78+
'backend': 'code_engine',
79+
'storage': 'ibm_cos'
80+
},
81+
'ibm': {
82+
'region': 'REGION',
83+
'iam_api_key': 'IAM_API_KEY',
84+
'resource_group_id': 'RESOURCE_GROUP_ID'
85+
},
86+
'ibm_cos': {
87+
'storage_bucket': 'STORAGE_BUCKET'
88+
}
89+
}
90+
91+
def hello_world(number):
92+
return f'Hello {number}!'
93+
94+
if __name__ == '__main__':
95+
fexec = lithops.FunctionExecutor(config=config)
96+
fexec.map(hello_world, [1, 2, 3, 4])
97+
print(fexec.get_result())
9098
9199
92100
.. _config-reference-label:

docs/_sources/source/design.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ In Lithops, each map or reduce computation is executed as a separate compute *jo
4343

4444
As mentioned above, the ``FunctionExecutor`` class is responsible for orchestrating the computation in Lithops. One ``FunctionExecutor`` object is instantiated prior to any use of Lithops. Its initialization includes these important steps: 1. It sets up the workers (depending on the specific compute backend), such as constructing docker images, defining IBM Cloud Functions, etc. This step may not include actually creating the workers, as this may be done automatically by the backend on-demand. 2. It defines a bucket in object storage (depending on the storage backend) in which each job will store job and call data (prior to computation) and results (when computation is complete). 3. It creates a ``FunctionInvoker`` object, which is responsible for executing a job as a set of independent per-worker calls.
4545

46-
Compute jobs are created in the functions of the ``job`` module (see chart above), invoked from the respective API method of ``FunctionExecutor``. Map jobs are created in ``create_map_job()`` and reduce jobs in ``create_reduce_job()``. The flow in both functions is quite similar. First, data is partitioned, with the intention of each partition be processed by one worker. For map jobs, this is done by invoking the ``create_partitions()`` function of the ``partitioner`` module, yielding a partition map.
46+
Compute jobs are created in the functions of the ``job`` module (see chart above), invoked from the respective API method of ``FunctionExecutor``. Map jobs are created in ``create_map_job()`` and reduce jobs in ``create_reduce_job()``. The flow in both functions is quite similar. First, data is partitioned, with the intention that each partition be processed by one worker. For map jobs, this is done by invoking the ``create_partitions()`` function of the ``partitioner`` module, yielding a partition map.
4747

4848
For reduce jobs, Lithops currently supports two modes: reduce per object, where each object is processed by a reduce function, and global (default) reduce, where all data is processed by a single reduce function. Respectively, data is partitioned as either one partition per storage object, or one global partition with all data. This process yields a partition map similar to map jobs. Additionally, ``create_reduce_job()`` wraps the reduce function in a special wrapper function that forces waiting for data before the actual reduce function is invoked. This is because reduce jobs follow map jobs, so the output of the map jobs needs to finish before reduce can run.
4949

@@ -58,4 +58,4 @@ Completion of a computation job in Lithops is detected in one of two techniques:
5858

5959
**RabbitMQ**: A unique RabbitMQ topic is defined for each job. combining the executor id and job id. Each worker, once completes a call, posts a notification message on that topic (code in ``function_handler()`` in ``handler`` module, called from ``entry_point`` module of the worker). The ``wait_rabbitmq()`` function from ``wait_rabbitmq`` module, which is called from ``FunctionExecutor.wait()``, consumes a number of messages on that topic equal to ``total_calls`` and determines completion.
6060

61-
**Object Storage**: As explained above, each call persists its computation results in a specific object. Determining completion of a job is by the ``FunctionExecutor.wait()`` invoking the ``wait_storage()`` function from the ``wait_storage`` module. This function repeatedly, once per fixed period (controllable), polls the executor’s bucket for status objects of a subset of calls that have still not completed. This allows control of resource usage and eventual detection of all calls.
61+
**Object Storage**: As explained above, each call persists its computation results in a specific object. Determining completion of a job is by the ``FunctionExecutor.wait()`` invoking the ``wait_storage()`` function from the ``wait_storage`` module. This function repeatedly, once per fixed period (controllable), polls the executor’s bucket for status objects of a subset of calls that have still not completed. This allows control of resource usage and eventual detection of all calls.

docs/_sources/source/worker_granularity.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ understanding the flexibility VMs provide is essential for effectively utilizing
9090
Unlike FaaS and CaaS platforms, when deploying Lithops on Virtual Machine backends, such as EC2, a master-worker architecture
9191
is adopted. In this paradigm, the master node holds a work queue containing tasks for a specific job, and workers pick up and
9292
process tasks one by one. In this sense, the chunksize parameter, which determines the number of functions allocated
93-
to each worker for parallel processing, is not applicable in this context.Consequently, the worker granularity is inherently
93+
to each worker for parallel processing, is not applicable in this context. Consequently, the worker granularity is inherently
9494
determined by the number of worker processess in the VM setup. Adjusting the number of VM instances or the configuration of
9595
each VM, such as the CPU core count, becomes crucial for optimizing performance and resource utilization in this master-worker
9696
approach.
@@ -99,7 +99,7 @@ In this scenario, specifying either the ``worker_instance_type`` or ``worker_pro
9999
the desired parallelism inside worker VMs. By default, Lithops determines the total number of worker processes based on the
100100
number of CPUs in the specified instance type. For example, an AWS EC2 instance of type ``t2.medium``, with 2 CPUs, would set
101101
``worker_processes`` to 2. Additionally, users have the flexibility to manually adjust parallelism by setting a different
102-
value for ``worker_processes``. Depenidng on the use case, it would be conveneint to set more ``worker_processes`` than CPUs,
102+
value for ``worker_processes``. Depending on the use case, it would be convenient to set more ``worker_processes`` than CPUs,
103103
or less ``worker_processes`` than CPUs. For example, we can use a ``t2.medium`` instance types that has 2 CPUs, but
104104
set ``worker_processes`` to 4:
105105

docs/api_futures.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
<script>document.write(`<img src="_static/lithops_logo_readme.png" class="logo__image only-dark" alt=""/>`);</script>
147147

148148

149-
<p class="title logo__title">Lithops v3.5.1</p>
149+
<p class="title logo__title">Lithops v3.6.0</p>
150150

151151
</a></div>
152152
<div class="sidebar-primary-item"><nav class="bd-links" id="bd-docs-nav" aria-label="Main">
@@ -184,6 +184,7 @@
184184
<li class="toctree-l2"><a class="reference internal" href="source/compute_config/vm.html">Virtual Machine</a></li>
185185
<li class="toctree-l2"><a class="reference internal" href="source/compute_config/ibm_vpc.html">IBM Virtual Private Cloud</a></li>
186186
<li class="toctree-l2"><a class="reference internal" href="source/compute_config/aws_ec2.html">AWS Elastic Compute Cloud (EC2)</a></li>
187+
187188
<li class="toctree-l2"><a class="reference internal" href="source/compute_config/azure_vms.html">Azure Virtual Machines</a></li>
188189
</ul>
189190
</li>
@@ -1227,7 +1228,7 @@ <h1>Function chaining<a class="headerlink" href="#function-chaining" title="Perm
12271228

12281229
<p class="copyright">
12291230

1230-
© Copyright 2024, The Lithops Team.
1231+
© Copyright 2025, The Lithops Team.
12311232
<br/>
12321233

12331234
</p>

docs/api_storage.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
<script>document.write(`<img src="_static/lithops_logo_readme.png" class="logo__image only-dark" alt=""/>`);</script>
147147

148148

149-
<p class="title logo__title">Lithops v3.5.1</p>
149+
<p class="title logo__title">Lithops v3.6.0</p>
150150

151151
</a></div>
152152
<div class="sidebar-primary-item"><nav class="bd-links" id="bd-docs-nav" aria-label="Main">
@@ -184,6 +184,7 @@
184184
<li class="toctree-l2"><a class="reference internal" href="source/compute_config/vm.html">Virtual Machine</a></li>
185185
<li class="toctree-l2"><a class="reference internal" href="source/compute_config/ibm_vpc.html">IBM Virtual Private Cloud</a></li>
186186
<li class="toctree-l2"><a class="reference internal" href="source/compute_config/aws_ec2.html">AWS Elastic Compute Cloud (EC2)</a></li>
187+
187188
<li class="toctree-l2"><a class="reference internal" href="source/compute_config/azure_vms.html">Azure Virtual Machines</a></li>
188189
</ul>
189190
</li>
@@ -914,7 +915,7 @@ <h3><code class="docutils literal notranslate"><span class="pre">Storage.delete_
914915

915916
<p class="copyright">
916917

917-
© Copyright 2024, The Lithops Team.
918+
© Copyright 2025, The Lithops Team.
918919
<br/>
919920

920921
</p>

docs/genindex.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
<script>document.write(`<img src="_static/lithops_logo_readme.png" class="logo__image only-dark" alt=""/>`);</script>
146146

147147

148-
<p class="title logo__title">Lithops v3.5.1</p>
148+
<p class="title logo__title">Lithops v3.6.0</p>
149149

150150
</a></div>
151151
<div class="sidebar-primary-item"><nav class="bd-links" id="bd-docs-nav" aria-label="Main">
@@ -183,6 +183,7 @@
183183
<li class="toctree-l2"><a class="reference internal" href="source/compute_config/vm.html">Virtual Machine</a></li>
184184
<li class="toctree-l2"><a class="reference internal" href="source/compute_config/ibm_vpc.html">IBM Virtual Private Cloud</a></li>
185185
<li class="toctree-l2"><a class="reference internal" href="source/compute_config/aws_ec2.html">AWS Elastic Compute Cloud (EC2)</a></li>
186+
186187
<li class="toctree-l2"><a class="reference internal" href="source/compute_config/azure_vms.html">Azure Virtual Machines</a></li>
187188
</ul>
188189
</li>
@@ -560,7 +561,7 @@ <h2 id="W">W</h2>
560561

561562
<p class="copyright">
562563

563-
© Copyright 2024, The Lithops Team.
564+
© Copyright 2025, The Lithops Team.
564565
<br/>
565566

566567
</p>

0 commit comments

Comments
 (0)