Class DockerSandboxClient
java.lang.Object
io.agentscope.harness.agent.sandbox.impl.docker.DockerSandboxClient
- All Implemented Interfaces:
SandboxClient<DockerSandboxClientOptions>
public class DockerSandboxClient
extends Object
implements SandboxClient<DockerSandboxClientOptions>
SandboxClient implementation for the Docker sandbox store.
Creates and manages Docker containers via the docker CLI. The Docker daemon must
be accessible from the host's PATH.
-
Constructor Summary
ConstructorsConstructorDescriptionDockerSandboxClient(com.fasterxml.jackson.databind.ObjectMapper objectMapper) Uses the given mapper as-is. -
Method Summary
Modifier and TypeMethodDescriptioncreate(WorkspaceSpec workspaceSpec, SandboxSnapshotSpec snapshotSpec, DockerSandboxClientOptions options) Creates a new sandbox with the given workspace spec and snapshot spec.voiddeserializeState(String json) deserializeState(String json, SandboxSnapshotSpec snapshotSpec) resume(SandboxState state) Resumes a sandbox from previously serializedSandboxState.serializeState(SandboxState state)
-
Constructor Details
-
DockerSandboxClient
public DockerSandboxClient() -
DockerSandboxClient
public DockerSandboxClient(com.fasterxml.jackson.databind.ObjectMapper objectMapper) Uses the given mapper as-is. ForSandboxStateJSON round-trip, registerHarnessSandboxJacksonModule(and any extraNamedTypefor custom state subclasses) on this mapper before callingdeserializeState(java.lang.String).
-
-
Method Details
-
create
public Sandbox create(WorkspaceSpec workspaceSpec, SandboxSnapshotSpec snapshotSpec, DockerSandboxClientOptions options) Description copied from interface:SandboxClientCreates a new sandbox with the given workspace spec and snapshot spec.Returned in a pre-start state; call
Sandbox.start()before use.- Specified by:
createin interfaceSandboxClient<DockerSandboxClientOptions>
-
resume
Description copied from interface:SandboxClientResumes a sandbox from previously serializedSandboxState.- Specified by:
resumein interfaceSandboxClient<DockerSandboxClientOptions>
-
delete
- Specified by:
deletein interfaceSandboxClient<DockerSandboxClientOptions>
-
serializeState
- Specified by:
serializeStatein interfaceSandboxClient<DockerSandboxClientOptions>
-
deserializeState
- Specified by:
deserializeStatein interfaceSandboxClient<DockerSandboxClientOptions>
-
deserializeState
- Specified by:
deserializeStatein interfaceSandboxClient<DockerSandboxClientOptions>
-