orka-python-sdk
An SDK for interacting with Orka clusters and the macOS VMs they run.
Contents
Installation
pip install orka_sdk
Authentication
Get token
from orka_sdk.orka_sdk import OrkaSDK
orka = OrkaSDK()
orka.login(user='user@email.com', password='password',license_key='license-key')
Revoke token
orka.revoke_token()
VM Management
Define and create a VM
# Define a VM
vm_data = {
'vm_name': 'fake-name',
'orka_base_image': 'my-image.img',
'core_count': '3',
'vcpu_count': '3'
}
# Create a VM
r = orka.create_vm(vm_data)
vm = r.data
Get VM by id
r = orka.get_vm_by_id('<vm_id>')
vm = r.data
Get VM by name
r = orka.get_vm_by_name('<vm_name>')
vm = r.data
Iterate over all VMs in system and execute a remote command on each
r = orka.list_system_vms()
for vm in r.data:
r = vm.exec('printenv')
Commit current state of deployed VM to base image and clean up
orka.commit_vm_state_to_base_image(vm)
orka.purge_vm(vm)
Save a deployed VM's state as an Image
r = orka.save_vm_as_image('new-image.img', vm)
Commit VM state to base image
r = orka.commit_vm_state_to_base_image()
Purge VM
r = orka.purge_vm(vm)
Delete VM
r = orka.delete_vm(vm)
Start VM
r = orka.start_vm(vm)
Stop VM
r = orka.stop_vm(vm)
Suspend VM
r = orka.suspend_vm(vm)
Resume VM
r = orka.resume_vm(vm)
Revert VM
r = orka.revert_vm(vm)
Get VM status
r = orka.get_vm_status(vm)
VM Instances
VM Properties
| Name | Description |
|---|---|
ip |
The ip address of the deployed VM |
name |
The VM's name |
ssh_port |
The VM's ssh port |
id |
The VM's unique id |
ram |
Available RAM |
vcpu |
Virtual CPU count |
cpu |
CPU count |
io_boost |
I/O boost enabled |
use_saved_state |
Used saved VM state at boot |
gpu_passthrough |
GPU passthrough to host Node GPU enabled |
screen_share_port |
The VM's screen share port |
vnc_port |
The VM's vnc port |
ssh_client |
Paramiko ssh client associated with the VM |
sftp_client |
Paramiko ssh client associated with the VM |
ssh_user |
The SSH user associated with the VM |
ssh_pass |
The SSH password associated with the VM |
VM Methods
upload()
Upload a file to a deployed VM
local_path = '/local/file/path'
dest_path = '/remote/file/path'
# Upload file
r = vm.upload(local_path, dest_path)
# Confirm success
r = vm.exec(f'cat {dest_path}')
print(r.data['stdout'])
download()
Download a file from a deployed VM
remote_path = '/remote/file/path'
local_path = '/local/file/path'
r = vm.download(remote_path, local_path)
exec()
Execute a remote command on a deployed VM
r = vm.exec('printenv')
print(r.data['stdout'])
write_persistent_env_var()
Write an env var export statement to a deployed VM's .zshenv or elsewhere
data = {'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 VM
r = vm.enable_auto_login()
create_launch_daemon()
Create a launch daemon that calls an executable at machine startup
data = {'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 VM
file_path = '/path/to/Brewfile'
r = vm.install_brew_packages(file_path)
K8s Management
Deploy a k8s service
orka.k8s.create_service('<path/to/yaml/definition>')
Delete a k8s service
orka.k8s.delete_service('<service_name>')
Create a k8s deployment
orka.k8s.create_deployment('<path/to/yaml/definition>')
Delete a k8s deployment
orka.k8s.delete_deployment('<deployment_name>')
Image Management
List images
r = orka.images.list()
Get image by name
r = orka.images.get('<image_name>')
Delete image
r = orka.images.delete('<image_name>')
Node Management
List nodes
r = orka.nodes.list()
Get node status
r = orka.nodes.get_status('<node_name>')
CI/CD Integrations
GitHub Actions Controller
from orka_sdk.gha_controller import GHAController
controller = GHAController()
controller.spin_up()
controller.check_runner_status()
controller.tear_down()
Metadata
Release files for orka-sdk 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| orka-sdk-1.0.3.tar.gz | 10.8 kB | Without provenance | Details for orka-sdk-1.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| orka_sdk-1.0.3-py3-none-any.whl | Python 3 | none | any | Details for orka_sdk-1.0.3-py3-none-any.whl |
Total release size: 22.3 kB
Release files / orka-sdk-1.0.3.tar.gz
| Download URL | orka-sdk-1.0.3.tar.gz |
|---|---|
| Size | 10.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d5c928458d3349b8f0e9918a2b92e5e40d1cb12467842d95cbfe8983ed87f821
|
|
BLAKE2b-256 checksum How to use checksums |
4bbdcff6bd06c33fb36fb8c3200f64d061babe49f40fba00a8e6cf78939fbb1c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.63.0 importlib-metadata/4.8.2 keyring/17.1.1 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.3
|
Release files / orka_sdk-1.0.3-py3-none-any.whl
| Download URL | orka_sdk-1.0.3-py3-none-any.whl |
|---|---|
| Size | 11.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
49ff46a9e5b0d70c6bf134643cc9e0adf98fe3c9ebed73a28531bd42a63a3273
|
|
BLAKE2b-256 checksum How to use checksums |
3fc1c9422dca786af9ce18aebfc60b23ad7ab7892c9c0e2f894c9010e71e6780
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.63.0 importlib-metadata/4.8.2 keyring/17.1.1 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.3
|
Security for orka-sdk 1.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.