Files
OpenShell/proto/datamodel.proto

89 lines
2.4 KiB
Protocol Buffer

// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
syntax = "proto3";
package openshell.datamodel.v1;
import "google/protobuf/struct.proto";
import "sandbox.proto";
// Sandbox model stored by OpenShell.
message Sandbox {
string id = 1;
string name = 2;
string namespace = 3;
SandboxSpec spec = 4;
SandboxStatus status = 5;
SandboxPhase phase = 6;
// Milliseconds since Unix epoch when the sandbox was created.
int64 created_at_ms = 7;
// Currently active policy version (updated when sandbox reports loaded).
uint32 current_policy_version = 8;
}
// OpenShell-level sandbox spec.
message SandboxSpec {
string log_level = 1;
map<string, string> environment = 5;
SandboxTemplate template = 6;
// Required sandbox policy configuration.
openshell.sandbox.v1.SandboxPolicy policy = 7;
// Provider names to attach to this sandbox.
repeated string providers = 8;
// Request NVIDIA GPU resources for this sandbox.
bool gpu = 9;
}
// Sandbox template mapped onto Kubernetes pod template inputs.
message SandboxTemplate {
string image = 1;
string runtime_class_name = 2;
string agent_socket = 3;
map<string, string> labels = 4;
map<string, string> annotations = 5;
map<string, string> environment = 6;
google.protobuf.Struct resources = 7;
google.protobuf.Struct volume_claim_templates = 9;
}
// Sandbox status captured from Kubernetes.
message SandboxStatus {
string sandbox_name = 1;
string agent_pod = 2;
string agent_fd = 3;
string sandbox_fd = 4;
repeated SandboxCondition conditions = 5;
}
// Sandbox condition mirrors Kubernetes conditions.
message SandboxCondition {
string type = 1;
string status = 2;
string reason = 3;
string message = 4;
string last_transition_time = 5;
}
// High-level sandbox lifecycle phase.
enum SandboxPhase {
SANDBOX_PHASE_UNSPECIFIED = 0;
SANDBOX_PHASE_PROVISIONING = 1;
SANDBOX_PHASE_READY = 2;
SANDBOX_PHASE_ERROR = 3;
SANDBOX_PHASE_DELETING = 4;
SANDBOX_PHASE_UNKNOWN = 5;
}
// Provider model stored by OpenShell.
message Provider {
string id = 1;
string name = 2;
// Canonical provider type slug (for example: "claude", "gitlab").
string type = 3;
// Secret values used for authentication.
map<string, string> credentials = 4;
// Non-secret provider configuration.
map<string, string> config = 5;
}