Add cmd_stop configuration to better support docker (#35)

Add `cmd_stop` to model configuration to run a command instead of sending a SIGTERM to shutdown a process before swapping.
This commit is contained in:
Benson Wong
2025-01-30 16:59:57 -08:00
committed by GitHub
parent 2833517eef
commit baeb0c4e7f
6 changed files with 125 additions and 22 deletions

View File

@@ -11,6 +11,7 @@ import (
type ModelConfig struct {
Cmd string `yaml:"cmd"`
CmdStop string `yaml:"cmd_stop"`
Proxy string `yaml:"proxy"`
Aliases []string `yaml:"aliases"`
Env []string `yaml:"env"`
@@ -22,6 +23,9 @@ type ModelConfig struct {
func (m *ModelConfig) SanitizedCommand() ([]string, error) {
return SanitizeCommand(m.Cmd)
}
func (m *ModelConfig) SanitizeCommandStop() ([]string, error) {
return SanitizeCommand(m.CmdStop)
}
type Config struct {
HealthCheckTimeout int `yaml:"healthCheckTimeout"`