Skip to main content

ARL Infrastructure - Python SDK for Kubernetes-based Agent Runtime Layer

Project description

ARL Wrapper

High-level Python wrapper for the ARL (Agent Runtime Layer) client providing simplified sandbox session management.

Features

  • Context Manager Support: Automatic sandbox lifecycle management
  • Type-Safe API: Full type hints with Pydantic models
  • Kubernetes Integration: Direct CRD interaction
  • Error Handling: Comprehensive error reporting and retry logic

Installation

uv add arl-wrapper

Quick Start

from arl import SandboxSession

# Using context manager (recommended)
with SandboxSession(pool_ref="python-39-std", namespace="default") as session:
    result = session.execute([
        {
            "name": "hello",
            "type": "Command",
            "command": ["echo", "Hello, World!"],
        }
    ])
    
    # Access results
    status = result["status"]
    for step in status.get("steps", []):
        print(f"Step: {step['name']}")
        print(f"Exit Code: {step['exitCode']}")
        print(f"Stdout: {step['stdout']}")

Manual Lifecycle Management

For long-running operations or sandbox reuse:

session = SandboxSession(pool_ref="python-39-std", namespace="default", keep_alive=True)

try:
    session.create_sandbox()
    
    # Task 1
    result1 = session.execute([...])
    
    # Task 2 (reuses same sandbox)
    result2 = session.execute([...])
    
finally:
    session.delete_sandbox()

Task Step Types

Command Step

{
    "name": "run_script",
    "type": "Command",
    "command": ["python", "script.py"],
    "env": {"DEBUG": "1"},  # optional
    "workDir": "/workspace",  # optional
}

FilePatch Step

{
    "name": "create_config",
    "type": "FilePatch",
    "path": "/workspace/config.yaml",
    "content": "key: value",
}

Architecture

  • SandboxSession: High-level API using Kubernetes CRDs for task execution
  • Task CRD: Operator watches and executes tasks via sidecar
  • Auto-generated client: arl-client package (CRD models)

Task execution flow:

  1. Client creates Task CRD via Kubernetes API
  2. Operator watches for new tasks
  3. Operator communicates with sidecar to execute steps
  4. Client polls Task status for results

This architecture ensures tasks can be executed from anywhere with cluster access.

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

arl_env-0.1.3.tar.gz (63.0 kB view details)

Uploaded Source

Built Distribution

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

arl_env-0.1.3-py3-none-any.whl (223.7 kB view details)

Uploaded Python 3

File details

Details for the file arl_env-0.1.3.tar.gz.

File metadata

  • Download URL: arl_env-0.1.3.tar.gz
  • Upload date:
  • Size: 63.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for arl_env-0.1.3.tar.gz
Algorithm Hash digest
SHA256 102814c58d12a80b20cbe4a50eedea86a68bbbe7c5e1c750233a279ab55e72fc
MD5 bbda4d1b24861a0682cf936310c48135
BLAKE2b-256 34c1d875fe01a65557ff4fad596b8565477e068ec1dfd9314c4227c47aeb0e0b

See more details on using hashes here.

File details

Details for the file arl_env-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: arl_env-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 223.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for arl_env-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f866ccaeefd8a18ba3bb902b8db741e0f7f6ba9b54b9bf076d16f307af8e9220
MD5 83bfafc6547e3d567086c2f8a19d0656
BLAKE2b-256 c7702e57c2f61c63583fd0dde0b10a3a5ee725ff0b62a3534e2615ade0a01946

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