Implement getRunner grpc endpoint

This includes refactoring the jobscheduler into the runnermanager. This
service manages runner connections and allocating them to pipelines.
These requests are done via the pipeline grpc api
This commit is contained in:
2022-12-31 17:22:00 -07:00
parent 663306c3be
commit 3cbe670bc1
5 changed files with 127 additions and 72 deletions
+4 -4
View File
@@ -5,10 +5,10 @@ import (
"os"
"git.ohea.xyz/cursorius/server/config"
"git.ohea.xyz/cursorius/server/jobscheduler"
"git.ohea.xyz/cursorius/server/listen"
"git.ohea.xyz/cursorius/server/pipeline_api"
"git.ohea.xyz/cursorius/server/poll"
"git.ohea.xyz/cursorius/server/runnermanager"
"github.com/op/go-logging"
)
@@ -33,16 +33,16 @@ func main() {
log.Errorf("Could not get configuration: %v", err)
}
runCh, registerCh, err := jobscheduler.StartJobScheduler(configData.Config.Jobs, configData.Config.Runners)
getRunnerCh, registerCh, err := runnermanager.StartRunnerManager(configData.Config.Runners)
if err != nil {
log.Errorf("Could not start runner: %v", err)
}
poll.StartPolling(configData.Config, runCh)
poll.StartPolling(configData.Config)
mux := http.NewServeMux()
pipeline_api.CreateHandler(mux, runCh)
pipeline_api.CreateHandler(mux, getRunnerCh)
listen.Listen(mux, configData.Config.Address, configData.Config.Port, registerCh, configData.Config)
}