// SPDX-License-Identifier: MIT package sandbox import ( "os" "bnema.dev/ermite-runner/internal/cachesvc" ) // The host/guest contract shared by the drivers and the guest side // (internal/guest). Changing a value here changes both sides at once because // the host always attaches its own executable to the sandbox. const ( // VsockPort is the vsock port the executor connects to on the host (CID 2). VsockPort = 1024 // CacheVsockPort is the vsock port of the cache streams of a VM: each TCP // connection the guest relay accepts on its loopback opens one connection to // the host (CID 2) on this port. It is also the loopback port of the cache in // the guest. CacheVsockPort = cachesvc.DefaultPort // CacheSocket is the cache stream socket of a container, next to the // executor socket in ContainerRunDir; one connection per relayed TCP // connection. CacheSocket = "cache.sock" // GuestExecDir and GuestExecName locate the runner executable inside the // sandbox (read-only), in both modes. GuestExecDir = "/opt/ermite" GuestExecName = "ermite-runner" // ContainerRunDir is the per-job directory bind-mounted into containers; // ContainerSocket is the executor stream socket inside it. ContainerRunDir = "/run/ermite" ContainerSocket = "exec.sock" // GuestExternalsDir is where the host's external tools (Node.js) appear in // the sandbox, read-only, in GitHub's layout: