This class is used to specify both resource requests and resource limits.
.. code-block:: python
Resources(cpu=“1”, mem=“2048”) # This is 1 CPU and 2 KB of memory
Resources(cpu=“100m”, mem=“2Gi”) # This is 1/10th of a CPU and 2 gigabytes of memory
Resources(cpu=0.5, mem=1024) # This is 500m CPU and 1 KB of memory
For Kubernetes-based tasks, pods use ephemeral local storage for scratch space, caching, and for logs.
This allocates 1Gi of such local storage.
Resources(ephemeral_storage=“1Gi”)
When used together with @task(resources=), you a specific the request and limits with one object.
When the value is set to a tuple or list, the first value is the request and the
second value is the limit. If the value is a single value, then both the requests and limit is
set to that value. For example, the Resource(cpu=("1", "2"), mem=1024) will set the cpu request to 1, cpu limit to 2,
mem limit and request to 1024.
.. note::
Persistent storage is not currently supported on the Flyte backend.
Please see the :std:ref:User Guide <cookbook:customizing task resources> for detailed examples.
Also refer to the K8s conventions. <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes>__