Job exection logic now runs pipeline in container

This container's network is configured based on parameters in the config
file. If configured correctly, this will allow the pipeline script to
speak to the cursorius server over the pipeline api.
This commit is contained in:
2022-12-24 22:12:30 -07:00
parent e25ac0c01e
commit 8e4e45047d
9 changed files with 256 additions and 24 deletions
+34 -4
View File
@@ -28,20 +28,50 @@ type Runner struct {
Secret string
}
type MountType string
const (
Bind MountType = "bind"
Volume = "volume"
)
type MountConf struct {
Type MountType
Source string
}
type PipelineConf struct {
AccessURL string // URL that the pipeline runner can access the server at
DockerNetwork *string // Name of the docker network that should be assigned to the pipeline script runner
WorkingDir string
MountConf MountConf // This script describes how to mount WorkingDir into the pipeline executor container
}
type Config struct {
Address string
Port int
Jobs map[string]Job
Runners map[string]Runner
Address string
Port int
PipelineConf PipelineConf
Jobs map[string]Job
Runners map[string]Runner
}
func GetConfig() (config.Config[Config], error) {
defaultNetworkName := "cursorius"
configData := config.Config[Config]{
Name: "cursorius",
Filename: "server",
Config: Config{
Address: "127.0.0.1",
Port: 45420,
PipelineConf: PipelineConf{
AccessURL: "cursorius-server:45420",
DockerNetwork: &defaultNetworkName,
WorkingDir: "/opt/cursorius/working",
MountConf: MountConf{
Type: Bind,
Source: "/opt/cursorius/working",
},
},
Jobs: make(map[string]Job),
Runners: make(map[string]Runner),
},