isolate-proto

0.30.9 · active · verified Tue Apr 14

isolate-proto provides the internal gRPC definitions for the Isolate Controller, a system designed for building, managing, and using isolated execution environments (e.g., virtualenv, conda, remote). As a protocol buffer library, it contains the generated Python code necessary for client-server communication within the 'Isolate Cloud' ecosystem. The current version is 0.30.9, and it appears to be under active development with recent updates.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates a typical client-side interaction with an Isolate Controller gRPC service. It assumes the necessary Python protobuf and gRPC stub files (`_pb2.py` and `_pb2_grpc.py`) have been generated from the official `.proto` definitions. Users would then import the specific service stubs and message types to make RPC calls to a running Isolate Controller gRPC server.

import grpc
# Assuming you have generated isolate_controller_pb2.py and isolate_controller_pb2_grpc.py
# from the official .proto definitions. These files would typically be
# created by running 'python -m grpc_tools.protoc ...' against the .proto files.

# Placeholder imports - replace with actual generated module names and symbols
# based on the Isolate Controller's .proto files.
try:
    from isolate_controller_pb2 import IsolateRequest, IsolateResponse
    from isolate_controller_pb2_grpc import IsolateServiceStub
except ImportError:
    print("Generated protobuf files (e.g., isolate_controller_pb2.py) not found.")
    print("Please ensure you have generated them from the official .proto definitions using grpc_tools.protoc.")
    exit(1)

def run_client():
    # Replace 'localhost:50051' with the actual Isolate Controller gRPC server address
    with grpc.insecure_channel('localhost:50051') as channel:
        stub = IsolateServiceStub(channel)
        try:
            # Example request - replace with actual fields from IsolateRequest
            request = IsolateRequest(name="example_task", payload=b"some_data")
            response = stub.ExecuteTask(request)
            print(f"Isolate Controller Response: {response.status}")
        except grpc.RpcError as e:
            print(f"Error communicating with Isolate Controller: {e.details}")

if __name__ == '__main__':
    # This quickstart demonstrates client-side usage of the generated stubs.
    # To run this, you'd also need a running gRPC server implementing the
    # IsolateService as defined in the .proto files.
    print("This is a placeholder quickstart. Actual usage requires generated")
    print("protobuf files and a running Isolate Controller gRPC server.")
    run_client()

view raw JSON →