class_docstr: Configure the cloud runtime for a lightning work or flow.
  
  Arguments:
      name: The name of the hardware to use. A full list of supported options can be found in
          :doc:`/core_api/lightning_work/compute`. If you have a request for more hardware options, please contact
          `onprem@lightning.ai <mailto:onprem@lightning.ai>`_.
  
      disk_size: The disk size in Gigabytes.
          The value you set here will be allocated to the /home folder.
  
      idle_timeout: The number of seconds to wait before pausing the compute when the work is running and idle.
          This timeout starts whenever your run() method succeeds (or fails).
          If the timeout is reached, the instance pauses until the next run() call happens.
  
      shm_size: Shared memory size in MiB, backed by RAM. min 512, max 8192, it will auto update in steps of 512.
          For example 1100 will become 1024. If set to zero (the default) will get the default 64MiB inside docker.
  
      mounts: External data sources which should be mounted into a work as a filesystem at runtime.
  
      colocation_group_id: Identifier for groups of works to be colocated in the same datacenter.
          Set this to a string of max. 64 characters and all works with this group id will run in the same datacenter.
          If not set, the works are not guaranteed to be colocated.
  
      interruptible: Whether to run on a interruptible machine e.g the machine can be stopped
          at any time by the providers. This is also known as spot or preemptible machines.
          Compared to on-demand machines, they tend to be cheaper.
class_docstr_tok: ["Configure","the","cloud","runtime","for","a","lightning","work","or","flow",".","Arguments",":","name",":","The","name","of","the","hardware","to","use",".","A","full","list","of","supported","options","can","be","found","in",":","doc",":","`","\/core_api\/lightning_work\/compute","`",".","If","you","have","a","request","for","more","hardware","options",",","please","contact","`","onprem","@","lightning.ai","<","mailto",":","onprem","@","lightning.ai",">","`","_",".","disk_size",":","The","disk","size","in","Gigabytes",".","The","value","you","set","here","will","be","allocated","to","the","\/home","folder",".","idle_timeout",":","The","number","of","seconds","to","wait","before","pausing","the","compute","when","the","work","is","running","and","idle",".","This","timeout","starts","whenever","your","run","(",")","method","succeeds","(","or","fails",")",".","If","the","timeout","is","reached",",","the","instance","pauses","until","the","next","run","(",")","call","happens",".","shm_size",":","Shared","memory","size","in","MiB",",","backed","by","RAM",".","min","512",",","max","8192",",","it","will","auto","update","in","steps","of","512",".","For","example","1100","will","become","1024",".","If","set","to","zero","(","the","default",")","will","get","the","default","64MiB","inside","docker",".","mounts",":","External","data","sources","which","should","be","mounted","into","a","work","as","a","filesystem","at","runtime",".","colocation_group_id",":","Identifier","for","groups","of","works","to","be","colocated","in","the","same","datacenter",".","Set","this","to","a","string","of","max",".","64","characters","and","all","works","with","this","group","id","will","run","in","the","same","datacenter",".","If","not","set",",","the","works","are","not","guaranteed","to","be","colocated",".","interruptible",":","Whether","to","run","on","a","interruptible","machine","e.g","the","machine","can","be","stopped","at","any","time","by","the","providers",".","This","is","also","known","as","spot","or","preemptible","machines",".","Compared","to","on-demand","machines",",","they","tend","to","be","cheaper","."]
code: def __post_init__(self) -> None:
      _verify_mount_root_dirs_are_unique(self.mounts)
  
      self.name = self.name.lower()
  
      if self.shm_size is None:
          if "gpu" in self.name:
              self.shm_size = 1024
          else:
              self.shm_size = 0
  
      if self.interruptible:
          if not enable_interruptible_works():
              raise ValueError(
                  "CloudCompute with `interruptible=True` isn't supported yet."
              )
          if "gpu" not in self.name:
              raise ValueError(
                  "CloudCompute `interruptible=True` is supported only with GPU."
              )
  
      # FIXME: Clean the mess on the platform side
      if self.name == "default" or self.name == "cpu":
          self.name = "cpu-small"
          self._internal_id = "default"
  
      # TODO: Remove from the platform first.
      self.preemptible = self.interruptible
  
      # All `default` CloudCompute are identified in the same way.
      if self._internal_id is None:
          self._internal_id = self._generate_id()
  
      if self.colocation_group_id is not None and (
          not isinstance(self.colocation_group_id, str)
          or (
              isinstance(self.colocation_group_id, str)
              and len(self.colocation_group_id) > 64
          )
      ):
          raise ValueError(
              "colocation_group_id can only be a string of maximum 64 characters."
          )
  
file_path: pytorch-lightning/src/lightning/app/utilities/packaging/cloud_compute.py
imports: from dataclasses import asdict, dataclass
  from typing import Dict, List, Optional, Tuple, Union
  from uuid import uuid4
  from lightning.app.core.constants import ENABLE_MULTIPLE_WORKS_IN_NON_DEFAULT_CONTAINER, enable_interruptible_works
  from lightning.app.storage.mount import Mount
label_desc: Use image node_id 1 for calling the CloudCompute obj's underlying member method code with example usage: obj.__post_init__() without return types