55 lines
1.1 KiB
Go
55 lines
1.1 KiB
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
conf "oc-scheduler/conf"
|
|
|
|
"oc-scheduler/daemons"
|
|
"oc-scheduler/logger"
|
|
)
|
|
|
|
// var log zerolog.Logger
|
|
|
|
func main() {
|
|
// output := zerolog.ConsoleWriter{Out: os.Stdout, TimeFormat: time.RFC3339}
|
|
// log = zerolog.New(output).With().Timestamp().Logger()
|
|
|
|
app_conf := conf.GetConfig()
|
|
apiurl := app_conf.OcCatalogUrl
|
|
|
|
if _, err := os.Stat("./argo_workflows/"); os.IsNotExist(err) {
|
|
os.Mkdir("./argo_workflows/",0755)
|
|
logger.Logger.Info().Msg("Created argo_workflows/")
|
|
}
|
|
|
|
mngr := daemons.ScheduleManager{Api_url: apiurl}
|
|
|
|
go mngr.RetrieveScheduling()
|
|
go mngr.ListenWorkflowSubmissions()
|
|
|
|
// method in Schedule manager that checks the first Schedule object for its start date and exe
|
|
|
|
// var g Graph
|
|
|
|
// list, err := g.GetGraphList(apiurl)
|
|
// if err != nil {
|
|
// log.Fatal().Msg("Failed to get the workspaces list, check api url and that api server is up : " + apiurl)
|
|
// }
|
|
|
|
// println("Available workspaces :")
|
|
// for workspace, _ := range list {
|
|
// println(workspace)
|
|
// }
|
|
|
|
|
|
// g.LoadFrom(list["test-alpr"])
|
|
// g.ExportToArgo("test-alpr")
|
|
for(true){
|
|
fmt.Print("")
|
|
}
|
|
fmt.Print("stop")
|
|
|
|
}
|