Package: orka-sdk
orka-python-sdkAn SDK for interacting with Orka clusters and the macOS VMs they run.ContentsInstallationAuthenticationVM ManagementVM InstancesPropertiesMethodsImagesNodesk8sCI/CD IntegrationsGitHub ActionsInstallationpipinstallorka_sdkAuthenticationGet tokenfromorka_sdk.orka_sdkimportOrkaSDKorka=OrkaSDK()orka.login(user='user@email.com',password='password',license_key='license-key')Revoke tokenorka.revoke_token()VM ManagementDefine and create a VM# Define a VMvm_data={'vm_name':'fake-name','orka_base_image':'my-image.img','core_count':'3','vcpu_count':'3'}# Create a VMr=orka.create_vm(vm_data)vm=r.dataGet VM by idr=orka.get_vm_by_id('<vm_id>')vm=r.dataGet VM by namer=orka.get_vm_by_name('<vm_name>')vm=r.dataIterate over all VMs in system and execute a remote command on eachr=orka.list_system_vms()forvminr.data:r=vm.exec('printenv')Commit current state of deployed VM to base image and clean uporka.commit_vm_state_to_base_image(vm)orka.purge_vm(vm)Save a deployed VM's state as an Imager=orka.save_vm_as_image('new-image.img',vm)Commit VM state to base imager=orka.commit_vm_state_to_base_image()Purge VMr=orka.purge_vm(vm)Delete VMr=orka.delete_vm(vm)Start VMr=orka.start_vm(vm)Stop VMr=orka.stop_vm(vm)Suspend VMr=orka.suspend_vm(vm)Resume VMr=orka.resume_vm(vm)Revert VMr=orka.revert_vm(vm)Get VM statusr=orka.get_vm_status(vm)VM InstancesVM PropertiesNameDescriptionipThe ip address of the deployed VMnameThe VM's namessh_portThe VM's ssh portidThe VM's unique idramAvailable RAMvcpuVirtual CPU countcpuCPU countio_boostI/O boost enableduse_saved_stateUsed saved VM state at bootgpu_passthroughGPU passthrough to host Node GPU enabledscreen_share_portThe VM's screen share portvnc_portThe VM's vnc portssh_clientParamikossh client associated with the VMsftp_clientParamikossh client associated with the VMssh_userThe SSH user associated with the VMssh_passThe SSH password associated with the VMVM Methodsupload()Upload a file to a deployed VMlocal_path='/local/file/path'dest_path='/remote/file/path'# Upload filer=vm.upload(local_path,dest_path)# Confirm successr=vm.exec(f'cat{dest_path}')print(r.data['stdout'])download()Download a file from a deployed VMremote_path='/remote/file/path'local_path='/local/file/path'r=vm.download(remote_path,local_path)exec()Execute a remote command on a deployed VMr=vm.exec('printenv')print(r.data['stdout'])write_persistent_env_var()Write an env var export statement to a deployed VM's.zshenvor elsewheredata={'FOO':'bar'}r=vm.write_persistent_env_var(data)Alternatively, you can also pass a destination filepath, like so:dest='/Users/admin/.bash_profile'data={'foo':'bar'}r=vm.write_persistent_env_var(data=data,dest=dest)enable_auto_login()Enable auto-login on a deployed VMr=vm.enable_auto_login()create_launch_daemon()Create a launch daemon that calls an executable at machine startupdata={'name':'my_launch_daemon','path_to_executable':'/path/to/executable'}r=vm.create_launch_daemon(data)install_brew_packages()Install Homebrew packages listed in a Brewfile.NOTE: Homebrew must be installed on the VMfile_path='/path/to/Brewfile'r=vm.install_brew_packages(file_path)K8s ManagementDeploy a k8s serviceorka.k8s.create_service('<path/to/yaml/definition>')Delete a k8s serviceorka.k8s.delete_service('<service_name>')Create a k8s deploymentorka.k8s.create_deployment('<path/to/yaml/definition>')Delete a k8s deploymentorka.k8s.delete_deployment('<deployment_name>')Image ManagementList imagesr=orka.images.list()Get image by namer=orka.images.get('<image_name>')Delete imager=orka.images.delete('<image_name>')Node ManagementList nodesr=orka.nodes.list()Get node statusr=orka.nodes.get_status('<node_name>')CI/CD IntegrationsGitHub Actions Controllerfromorka_sdk.gha_controllerimportGHAControllercontroller=GHAController()controller.spin_up()controller.check_runner_status()controller.tear_down()