cirruslabs / orchard

Orchestrator for running Tart Virtual Machines on a cluster of Apple Silicon devices
Other
189 stars 13 forks source link

Provide the hash of the image when VMs is queried #164

Closed eecsmap closed 3 months ago

eecsmap commented 3 months ago

Right now if we query the VMs via v1/vms, we get

{
    "image": "repo_name/image_name:latest",
    "imagePullPolicy": "Always",
    "cpu": 4,
    "memory": 8192,
    "status": "running",
    "status_message": "",
    "worker": "mac-studio-003.local",
    "restart_policy": "OnFailure",
    "restarted_at": "0001-01-01T00:00:00Z",
    "restart_count": 0,
    "uid": "600c086e-ee87-451c-a7f8-9438eea232c1"
    ...
    }

It is not straightforward to answer question which exactly the image/template it is based on. Manually I can go to the worker node, and run tart list to show OCI caches. And if lucky enough, I can tell by the size of the image. If we provide this hash in the VM json response as some field image_hash, it will be useful to associate VM instance with according template in the runtime.

sudo tart list
Source Name                                                                                                                                                         Disk Size State
local image_name-600c086e-ee87-451c-a7f8-9438eea232c1                                               100  48   running
oci    repo_name/image_name:12.0                                                                    100  34   stopped
oci    repo_name/image_name:14.3.1                                                                  100  38   stopped
oci    repo_name/image_name:latest                                                                  100  48   stopped
oci    repo_name/image_name@sha256:9cbb76c349b461568a4e85c4bbf868689677aff734b5018e4954b6efcbdc3661 100  38   stopped
oci    repo_name/image_name@sha256:9cbbf5b2025ba204a8f4d9740963be6d2b7f94984e8020fc03bb22e00e4e8f7d 100  48   stopped
oci    repo_name/image_name@sha256:a828e0dfa1472336ef3e069757d19f432e6cd492f463dae868f9f5113e31bf1d 100  34   stopped
eecsmap commented 3 months ago

It works. Thanks!