Skip to main content

Python client for the Arker virtual computer platform.

Project description

Arker Python SDK

A small wrapper around the Arker VM API: fork a machine, run commands, sync files.

Install

pip install arker

Python 3.10+, no runtime dependencies. The client reads your key from ARKER_API_KEY — get one in the console.

Quickstart

from arker import Arker

ar = Arker(region="us-west-2")

# Fork a public golden, run a command, read/write a file.
vm = ar.fork("ubuntu-full")  # public golden — org inferred

print(vm.run("python3 -c 'print(2 + 2)'").stdout.decode())

vm.sync("/tmp/data.txt", "hello\n")   # write
data = vm.sync("/tmp/data.txt")       # read -> bytes

vm.delete()

Core API

ar = Arker(region=..., api_key=None, base_url=None, retry=None)

# VMs
ar.fork("ubuntu-full")                        # public golden by name (org inferred)
ar.fork(vm, name="child")                     # an existing VM (uses its id)
ar.fork(source_vm_name=..., source_org_id=..., name=None, durable=False)
ar.list_vms(state=None)
ar.vm(vm_id)                                  # bare handle
ar.vm(vm_id).run(command, **options)
ar.vm(vm_id).resize(vcpu_count=..., memory_mib=...)
ar.vm(vm_id).delete()

# Files inside a VM
vm.sync(path)                                 # read  -> bytes
vm.sync(path, data)                           # write

# Filesystems — standalone, persistent volumes
ar.create_filesystem(name=...)
ar.list_filesystems()
ar.delete_filesystem(filesystem_id)

# Syncs — mount a filesystem into a VM at a path
vm.create_sync(filesystem_id=..., path=...)
vm.list_syncs()
vm.delete_sync(sync_id)

api_key falls back to ARKER_API_KEY; region to ARKER_REGION. Pass base_url for dev targets. Configure retries with RetryOptions(...), or retry=False to disable.

Durability

For long-running or non-idempotent work, fork with durable=True and pass an idempotency key when retrying a run:

import uuid

vm = ar.fork("ubuntu-full", durable=True)
vm.run("python3 train.py", background=True, idempotency_key=str(uuid.uuid4()))

If the host fails mid-run, the run resumes on a healthy host with the VM's filesystem state preserved. Backends without durability raise ArkerError(code="unsupported_operation").

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

arker-0.5.2.tar.gz (29.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

arker-0.5.2-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file arker-0.5.2.tar.gz.

File metadata

  • Download URL: arker-0.5.2.tar.gz
  • Upload date:
  • Size: 29.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for arker-0.5.2.tar.gz
Algorithm Hash digest
SHA256 e404ee1610d8f6e6b6b8c6684074b5ca30eac7b2730358b6dfcabe1e87a5c381
MD5 bbf4051f38cd774bf0913419c7726eb2
BLAKE2b-256 9db4a1a4ad78a7cb2ad838365cbe3dbd7e0e109809973138a1b8f301e251abf8

See more details on using hashes here.

File details

Details for the file arker-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: arker-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for arker-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 411d868f9da1d3a0f0d88778904f239eed864d853f4d70e41d760841216be114
MD5 83c8ddc31c0c48be9928831d142cf72c
BLAKE2b-256 e38cd0c802b284d63a39eed86214c5b34d128647bf81b04a951bfb29397c0639

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page