Skip to content

PURISTA API


PURISTA API / @purista/sandbox / PodmanSandboxDriver

Class: PodmanSandboxDriver

Defined in: sandbox-service/src/driver/PodmanSandboxDriver/PodmanSandboxDriver.ts:26

PodmanSandboxDriver - A driver for Podman (daemonless, rootless containers). Podman is Docker-CLI compatible but has nuances in connection management and user-mode networking.

Implements

Constructors

Constructor

new PodmanSandboxDriver(config): PodmanSandboxDriver

Defined in: sandbox-service/src/driver/PodmanSandboxDriver/PodmanSandboxDriver.ts:30

Parameters

config

PodmanSandboxDriverConfig

Returns

PodmanSandboxDriver

Properties

name

name: string = 'PodmanSandboxDriver'

Defined in: sandbox-service/src/driver/PodmanSandboxDriver/PodmanSandboxDriver.ts:27

The unique name of the driver implementation

Implementation of

SandboxDriver.name

Methods

createSandbox()

createSandbox(params): Promise<{ containerName: string; sandboxId: string; }>

Defined in: sandbox-service/src/driver/PodmanSandboxDriver/PodmanSandboxDriver.ts:38

Provisions and starts a new sandbox environment.

Parameters

params

Configuration for the new sandbox

gitConfig?

{ email: string; token?: string; username: string; }

gitConfig.email

string

gitConfig.token?

string

gitConfig.username

string

organizationId

string

projectId

string

sandboxId

string

userId

string

Returns

Promise<{ containerName: string; sandboxId: string; }>

The sandbox ID and underlying container name

Implementation of

SandboxDriver.createSandbox


destroySandbox()

destroySandbox(params): Promise<void>

Defined in: sandbox-service/src/driver/PodmanSandboxDriver/PodmanSandboxDriver.ts:124

Permanently removes a sandbox and its resources.

Parameters

params

Reference to the sandbox to destroy

sandboxId

string

Returns

Promise<void>

Implementation of

SandboxDriver.destroySandbox


executeBash()

executeBash(params): Promise<{ exitCode: number; stderr: string; stdout: string; }>

Defined in: sandbox-service/src/driver/PodmanSandboxDriver/PodmanSandboxDriver.ts:135

Executes a bash command within the specified sandbox.

Parameters

params

Command and execution context

command

string

cwd?

string

sandboxId

string

Returns

Promise<{ exitCode: number; stderr: string; stdout: string; }>

The result of the command execution

Implementation of

SandboxDriver.executeBash


readFile()

readFile(params): Promise<string>

Defined in: sandbox-service/src/driver/PodmanSandboxDriver/PodmanSandboxDriver.ts:157

Reads the content of a file from the sandbox.

Parameters

params

Path to the file

path

string

sandboxId

string

Returns

Promise<string>

Implementation of

SandboxDriver.readFile


scanRunningSandboxes()

scanRunningSandboxes(): Promise<object[]>

Defined in: sandbox-service/src/driver/PodmanSandboxDriver/PodmanSandboxDriver.ts:173

Scans the underlying system for running sandboxes and recovers their metadata. This is used for self-healing and service restarts.

Returns

Promise<object[]>

Implementation of

SandboxDriver.scanRunningSandboxes


writeFiles()

writeFiles(params): Promise<void>

Defined in: sandbox-service/src/driver/PodmanSandboxDriver/PodmanSandboxDriver.ts:163

Writes one or more files to the sandbox workspace.

Parameters

params

Map of file paths to their contents

files

Record<string, string>

sandboxId

string

Returns

Promise<void>

Implementation of

SandboxDriver.writeFiles