loft-sh / devpod

Codespaces but open-source, client-only and unopinionated: Works with any IDE and lets you use any cloud, kubernetes or just localhost docker.
https://devpod.sh
Mozilla Public License 2.0
8.58k stars 314 forks source link

Introduce "devpod machine describe" #1152

Open dubinsky opened 1 month ago

dubinsky commented 1 month ago

Is your feature request related to a problem?

Yes: there is currently no way to find out, using devpod, what options set by devpod are in effect for a virtual machine instance created by devpod.

Which solution do you suggest?

Introduce devpod machine describe <name> sub-command that retrieves and displays all the data about the virtual machine instance that the cloud provider makes available.

Which alternative solutions exist?

None that I am aware of; current work-around is: use cloud provider-specific command to retrieve the data in question; this requires installing that cloud provider-specific command, guessing some parameters it requires and reverse-engineering devpod's machine naming strategy - not ideal ;)

Additional context

Neither devpod machine list nor devpod machine status output even the options that can be set using devpod, for instance DISK_SIZE, DISK_IMAGE, SERVICE_ACCOUNT; the only way to verify what values are actually used by a virtual machine instance is to use a non-devpod command specific to the provider, for instance, for GCloud:

$ gcloud compute instances describe devpod-<machine name> --project=<project> --zone=<zone>

where:

This is the only place that I know where abstraction provided by DevPod is insufficient, and the need to know provider-specific details (and install provider-specific commands) leak through...

I think devpod command should provide an ability to retrieve and display various options of the virtual machine instances that it created: at a minimum, the ones that devpod set; it would be better to make all the data returned by the provider-specific command available ;)

Natural place to put such functionality seems to me to be new sub-command: devpod machine describe`.

I see that the data needed to implement this functionality - the data needed to identify the machine to the cloud provider (in case of GCloud, PROJECT and ZONE) - is already being captured in .devpod/contexts/.../machines/<machine name>/machine.json at the machine creation time, which allows the provider options to change without losing track of the machine.

(This captured data should be used by devpod machine status, but does not seem to be, which, if true, is a bug...)

It would be really nice if this data was made available in devpod also - via yet another sub-command or via an option to devpod machine describe...

Thank you!

pascalbreuninger commented 1 month ago

Hi @dubinsky, fair enough! The first step imo is a devpod machine describe (or inspect because of docker) that just dumps the machine.json file to stdout and obfuscates credentials.

Afterwards we can think about providing even more information about the VM like you suggested but this will require changes in all of the first-party cloud providers so it'll be slower to roll out.

dubinsky commented 1 month ago

Thank you @pascalbreuninger!

dubinsky commented 1 month ago

@pascalbreuninger Thank you for adding the ability to dump the machine.json file! The main ask here is the ability to retrieve and display the machine data from the cloud provider. Please reopen :)