flytekit.Resources

class flytekit.Resources(cpu: Optional[str] = None, mem: Optional[str] = None, gpu: Optional[str] = None, storage: Optional[str] = None)[source]

This class is used to specify both resource requests and resource limits.

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

Note

Storage is not currently supported on the Flyte backend.

Please see Customizing task resources like mem/cpu for detailed examples. Also refer to the K8s conventions.

__init__(cpu: Optional[str] = None, mem: Optional[str] = None, gpu: Optional[str] = None, storage: Optional[str] = None)None

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__([cpu, mem, gpu, storage])

Initialize self.

Attributes

cpu

gpu

mem

storage