Package com.tnsai.quality.sandbox
Record Class SandboxSpec
java.lang.Object
java.lang.Record
com.tnsai.quality.sandbox.SandboxSpec
- Record Components:
image- backend-specific image / runtime identifier ("python:3.12-slim","node:20","wasm:pyodide", or empty forProcessSandboxwhich uses the host's interpreter)env- environment variables to set inside the sandbox; the framework SCRUBS the host environment by default — only what's listed here is visible to sandboxed codefsMounts- host paths exposed inside the sandboxnetworkPolicy- network access policyresourceLimits- per-sandbox resource capsworkingDir- working directory inside the sandbox; empty = backend default (/tmp/sandboxon most backends)warmable- hint that aSandboxPoolmay keep this sandbox alive between executions to skip cold-start cost
public record SandboxSpec(String image, Map<String,String> env, List<FsMount> fsMounts, NetPolicy networkPolicy, ResourceLimits resourceLimits, Optional<String> workingDir, boolean warmable)
extends Record
Declarative specification of a sandbox instance (TNS-296). Backends
accept this record as their configuration source; consumers build
it once and reuse it across
Sandbox.execute(com.tnsai.quality.sandbox.Command) calls.- Since:
- 0.10.0 (TNS-296)
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SandboxSpec.Builderbuilder()env()Returns the value of theenvrecord component.final booleanIndicates whether some other object is "equal to" this one.fsMounts()Returns the value of thefsMountsrecord component.final inthashCode()Returns a hash code value for this object.image()Returns the value of theimagerecord component.Returns the value of thenetworkPolicyrecord component.Returns the value of theresourceLimitsrecord component.final StringtoString()Returns a string representation of this record class.booleanwarmable()Returns the value of thewarmablerecord component.Returns the value of theworkingDirrecord component.
-
Constructor Details
-
SandboxSpec
public SandboxSpec(String image, Map<String, String> env, List<FsMount> fsMounts, NetPolicy networkPolicy, ResourceLimits resourceLimits, Optional<String> workingDir, boolean warmable) Creates an instance of aSandboxSpecrecord class.- Parameters:
image- the value for theimagerecord componentenv- the value for theenvrecord componentfsMounts- the value for thefsMountsrecord componentnetworkPolicy- the value for thenetworkPolicyrecord componentresourceLimits- the value for theresourceLimitsrecord componentworkingDir- the value for theworkingDirrecord componentwarmable- the value for thewarmablerecord component
-
-
Method Details
-
builder
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
image
Returns the value of theimagerecord component.- Returns:
- the value of the
imagerecord component
-
env
Returns the value of theenvrecord component.- Returns:
- the value of the
envrecord component
-
fsMounts
Returns the value of thefsMountsrecord component.- Returns:
- the value of the
fsMountsrecord component
-
networkPolicy
Returns the value of thenetworkPolicyrecord component.- Returns:
- the value of the
networkPolicyrecord component
-
resourceLimits
Returns the value of theresourceLimitsrecord component.- Returns:
- the value of the
resourceLimitsrecord component
-
workingDir
Returns the value of theworkingDirrecord component.- Returns:
- the value of the
workingDirrecord component
-
warmable
public boolean warmable()Returns the value of thewarmablerecord component.- Returns:
- the value of the
warmablerecord component
-