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.1.tar.gz (26.8 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.1-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: arker-0.5.1.tar.gz
  • Upload date:
  • Size: 26.8 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.1.tar.gz
Algorithm Hash digest
SHA256 53b31520043ffbe1f52ddaa357cd68a42dbe2f0b66c9ec0d54cb135ac320900c
MD5 3423da80f15bfcbe3638647a31fcb3b8
BLAKE2b-256 e47553eac15716f158e0fd6bd0927e73a6e09eb6112efb6a583e38b577debfe1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: arker-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 12.8 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7f2a1bdc7503db13b11b330908dde22b90963f751327d8381d74970815f8982c
MD5 72c4c4d0f6347f3b29c061a9326cde0e
BLAKE2b-256 cc71b1b0829ff7b29dd67188cc0588b02a72c9fa124e8cf6b402c2a581dcaa89

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