* Initailize aws support * Add README for the VM server * Refactor OSWorld for supporting more cloud services. * Initialize vmware and aws implementation v1, waiting for verification * Initlize files for azure, gcp and virtualbox support * Debug on the VMware provider * Fix on aws interface mapping * Fix instance type * Refactor * Clean * hk region; debug * Fix lock * Remove print * Remove key_name requirements when allocating aws vm * Clean README --------- Co-authored-by: XinyuanWangCS <xywang626@gmail.com>
19 lines
841 B
Python
19 lines
841 B
Python
from desktop_env.providers.base import VMManager, Provider
|
|
from desktop_env.providers.vmware.manager import VMwareVMManager
|
|
from desktop_env.providers.vmware.provider import VMwareProvider
|
|
from desktop_env.providers.aws.manager import AWSVMManager
|
|
from desktop_env.providers.aws.provider import AWSProvider
|
|
|
|
|
|
def create_vm_manager_and_provider(provider_name: str, region: str):
|
|
"""
|
|
Factory function to get the Virtual Machine Manager and Provider instances based on the provided provider name.
|
|
"""
|
|
provider_name = provider_name.lower().strip()
|
|
if provider_name == "vmware":
|
|
return VMwareVMManager(), VMwareProvider(region)
|
|
elif provider_name in ["aws", "amazon web services"]:
|
|
return AWSVMManager(), AWSProvider(region)
|
|
else:
|
|
raise NotImplementedError(f"{provider_name} not implemented!")
|