docssdk-compute-unit
Last edit August 05, 2024

Manage Compute Units in dxflow SDK

How to Manage Compute Units

Compute-Unit is a fundamental concept in DiPhyx. It is a logical entity that represents a single compute resource in the cloud, whether it's from third-party providers or self-hosted. In order to see all the Compute-Units, use ComputeManager class. The following display the user's compute-units:

bash
import dxflow

dxs = dxflow.Session() ## it will use the credential stored in ~/.diphyx/config.yaml

compute_manager = dxs.get_compute_manager()
compute_manager.list()
bash
Name | Status | IP             | Cluster Type | CPU | Memory(GB) | Disk
-----+--------+----------------+--------------+-----+------------+-----
Demo | READY  | 52.207.227.207 | AWS:T2 Micro | 1   | 1          | 8

Now dive into one of the available compute-unit name

bash
name = compute_manager.get_unit(name='name') ## or use ip
print(name.detail())

Components of Compute-Unit

Every compute-unit has differnt parts:

Storage: This class manages the working storage of the compute-unit. See Unit Storage for more details.

bash
name.storage.ls()

Projects: This class manages the projects associated to this compute-unit.

bash
name.projects.list()

Containers: This class manages the containers currently available on the compute-unit. Keep in mind that containers are associated with the projects.

bash
name.containers.list()