Documentation
¶
Index ¶
Constants ¶
View Source
const (
CaBundlePath = "/etc/ssl/certs/ca-certificates.crt"
)
View Source
const (
E2BRunDir = "/run/e2b" // store sandbox metadata files here
)
Variables ¶
This section is empty.
Functions ¶
func GetAccessTokenHashFromMMDS ¶
GetAccessTokenHashFromMMDS reads the access token hash from MMDS. This is used to validate that /init requests come from the orchestrator.
Types ¶
type CACertInstaller ¶
type CACertInstaller struct {
// contains filtered or unexported fields
}
CACertInstaller manages installation of a CA certificate into the VM's system trust bundle.
/etc/ssl/certs/ is bind-mounted from tmpfs at VM boot (see envd.service ExecStartPre), so all reads and writes bypass the NBD-backed filesystem and atomic cert rotation via os.Rename works within the same device.
func NewCACertInstaller ¶
func NewCACertInstaller(logger *zerolog.Logger) *CACertInstaller
type MMDSOpts ¶
type MMDSOpts struct {
SandboxID string `json:"instanceID"`
TemplateID string `json:"envID"`
LogsCollectorAddress string `json:"address"`
AccessTokenHash string `json:"accessTokenHash"`
}
func (*MMDSOpts) AddOptsToJSON ¶
type Metrics ¶
type Metrics struct {
Timestamp int64 `json:"ts"` // Unix Timestamp in UTC
CPUCount uint32 `json:"cpu_count"` // Total CPU cores
CPUUsedPercent float32 `json:"cpu_used_pct"` // Percent rounded to 2 decimal places
// Deprecated
// TODO: Remove when they are no longer used in orchestrator (https://linear.app/e2b/issue/E2B-2998/remove-envd-deprecated-metrics-when-not-used)
MemTotalMiB uint64 `json:"mem_total_mib"` // Total virtual memory in MiB
// Deprecated
// TODO: Remove when no longer used in orchestrator
MemUsedMiB uint64 `json:"mem_used_mib"` // Used virtual memory in MiB
MemTotal uint64 `json:"mem_total"` // Total virtual memory in bytes
MemUsed uint64 `json:"mem_used"` // Used virtual memory in bytes
MemCache uint64 `json:"mem_cache"` // Cached memory (page cache) in bytes
DiskUsed uint64 `json:"disk_used"` // Used disk space in bytes
DiskTotal uint64 `json:"disk_total"` // Total disk space in bytes
}
func GetMetrics ¶
Click to show internal directories.
Click to hide internal directories.