Documentation
¶
Overview ¶
Package docker implements driver.ComputeDriver via the Docker Engine API.
Index ¶
- func DeviceRequestsForGPU(spec driver.Spec) []container.DeviceRequest
- func ParseMemoryBytes(s string) (int64, error)
- func SeccompNote() string
- type Driver
- func (d *Driver) Close() error
- func (d *Driver) ContainerIP(ctx context.Context, containerID, networkName string) (string, error)
- func (d *Driver) CopyFrom(ctx context.Context, id core.ID, srcPath, destHost string) error
- func (d *Driver) CopyTo(ctx context.Context, id core.ID, srcHost, destPath string) error
- func (d *Driver) Create(ctx context.Context, spec driver.Spec) (driver.Handle, error)
- func (d *Driver) Delete(ctx context.Context, id core.ID) error
- func (d *Driver) EnsureSSHDaemon(ctx context.Context, id core.ID, authorizedKey string) error
- func (d *Driver) Exec(ctx context.Context, id core.ID, req driver.ExecRequest) (driver.ExecResult, error)
- func (d *Driver) Health(ctx context.Context) Probe
- func (d *Driver) ImagePresent(ctx context.Context, ref string) bool
- func (d *Driver) Inspect(ctx context.Context, nameOrID string) (driver.Info, error)
- func (d *Driver) List(ctx context.Context) ([]driver.Info, error)
- func (d *Driver) Logs(ctx context.Context, id core.ID, follow bool, w io.Writer) error
- func (d *Driver) PolicyHostPath(ctx context.Context, nameOrID string) (string, error)
- func (d *Driver) RunProbe(ctx context.Context, initBin string) (string, error)
- func (d *Driver) SSHPort(ctx context.Context, id core.ID) (int, error)
- func (d *Driver) Start(ctx context.Context, id core.ID) error
- func (d *Driver) Stop(ctx context.Context, id core.ID) error
- type Probe
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeviceRequestsForGPU ¶
func DeviceRequestsForGPU(spec driver.Spec) []container.DeviceRequest
DeviceRequestsForGPU builds Docker CDI DeviceRequests for a Spec (nil if GPU off).
func ParseMemoryBytes ¶
ParseMemoryBytes parses Docker-style memory strings (512m, 4g, …).
func SeccompNote ¶
func SeccompNote() string
SeccompNote documents the MVP harden posture for health / spike notes.
Types ¶
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver talks to a local Docker Engine / Desktop daemon.
func NewFromClient ¶
NewFromClient wraps an existing client (tests).
func (*Driver) ContainerIP ¶
ContainerIP returns the sandbox container IP on its osg network.
func (*Driver) CopyFrom ¶
CopyFrom reads a container path as tar and writes into destHost. If destHost exists as a directory (or ends with a path separator), entries are extracted under it. Otherwise a single regular file is written to destHost.
func (*Driver) CopyTo ¶
CopyTo tars srcHost and extracts at destPath inside the container. For a single file, destPath is the full guest path (basename used in the tar). For a directory, destPath is the guest parent directory under which src's basename appears.
func (*Driver) Create ¶
Create ensures network + optional proxy sidecar + sandbox container (not started).
func (*Driver) Delete ¶
Delete removes sandbox container, proxy sidecar, osg network, and data volume.
func (*Driver) EnsureSSHDaemon ¶
EnsureSSHDaemon starts /osg/osg-sshd inside the guest if labeled for SSH.
func (*Driver) Exec ¶
func (d *Driver) Exec(ctx context.Context, id core.ID, req driver.ExecRequest) (driver.ExecResult, error)
Exec runs a command in the container. With TTY, attaches stdin/stdout in raw mode. When the sandbox was created with osg-init, argv is wrapped: osg-init -- <cmd>.
Docker ContainerExecCreate Env replaces the process environment when non-empty. We always merge the container's Config.Env first so HTTP_PROXY / CA / HOME from create survive (otherwise `osg exec` / create `-- agent` cannot reach the sidecar).
func (*Driver) ImagePresent ¶
ImagePresent reports whether ref exists locally (no pull).
func (*Driver) Logs ¶
Logs streams stdout/stderr from the sandbox container and, when present, the egress proxy sidecar (where OCSF agent-observation events are emitted). When follow is true, starts from the last 500 lines per container.
func (*Driver) PolicyHostPath ¶
PolicyHostPath returns the host path of the sandbox policy bind (label osg.policy_path).
func (*Driver) RunProbe ¶
RunProbe runs osg-init --probe in a one-shot helper container (Landlock ABI).