mirror of
https://github.com/getcompanion-ai/computer-host.git
synced 2026-04-15 13:03:41 +00:00
feat: config-file boot for firecracker, eliminates 10 api round-trips
This commit is contained in:
parent
2ded10a67a
commit
2cef6aace5
4 changed files with 170 additions and 25 deletions
|
|
@ -66,7 +66,7 @@ func configureMachine(ctx context.Context, client *apiClient, paths machinePaths
|
|||
return nil
|
||||
}
|
||||
|
||||
func launchJailedFirecracker(paths machinePaths, machineID MachineID, firecrackerBinaryPath string, jailerBinaryPath string, enablePCI bool) (*exec.Cmd, error) {
|
||||
func launchJailedFirecracker(paths machinePaths, machineID MachineID, firecrackerBinaryPath string, jailerBinaryPath string, enablePCI bool, configFilePath string) (*exec.Cmd, error) {
|
||||
args := []string{
|
||||
"--id", string(machineID),
|
||||
"--uid", strconv.Itoa(os.Getuid()),
|
||||
|
|
@ -78,10 +78,16 @@ func launchJailedFirecracker(paths machinePaths, machineID MachineID, firecracke
|
|||
"--new-pid-ns",
|
||||
"--",
|
||||
"--api-sock", defaultFirecrackerSocketPath,
|
||||
"--log-path", paths.JailedFirecrackerLogPath,
|
||||
"--level", defaultFirecrackerLogLevel,
|
||||
"--show-level",
|
||||
"--show-log-origin",
|
||||
}
|
||||
if configFilePath != "" {
|
||||
args = append(args, "--config-file", configFilePath)
|
||||
} else {
|
||||
args = append(args,
|
||||
"--log-path", paths.JailedFirecrackerLogPath,
|
||||
"--level", defaultFirecrackerLogLevel,
|
||||
"--show-level",
|
||||
"--show-log-origin",
|
||||
)
|
||||
}
|
||||
if enablePCI {
|
||||
args = append(args, "--enable-pci")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue