2023-10-18 17:08:53 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2024-04-09 11:20:08 +02:00
|
|
|
"fmt"
|
2023-10-18 17:08:53 +02:00
|
|
|
"os"
|
|
|
|
|
2024-07-03 10:21:17 +02:00
|
|
|
conf "oc-scheduler/conf"
|
|
|
|
|
2024-07-11 18:25:40 +02:00
|
|
|
"oc-scheduler/daemons"
|
|
|
|
"oc-scheduler/logger"
|
2023-10-18 17:08:53 +02:00
|
|
|
)
|
|
|
|
|
2024-07-11 18:25:40 +02:00
|
|
|
// var log zerolog.Logger
|
2023-10-18 17:08:53 +02:00
|
|
|
|
|
|
|
func main() {
|
2024-07-11 18:25:40 +02:00
|
|
|
// output := zerolog.ConsoleWriter{Out: os.Stdout, TimeFormat: time.RFC3339}
|
|
|
|
// log = zerolog.New(output).With().Timestamp().Logger()
|
2023-10-18 17:08:53 +02:00
|
|
|
|
2024-07-03 10:21:17 +02:00
|
|
|
app_conf := conf.GetConfig()
|
|
|
|
apiurl := app_conf.OcCatalogUrl
|
|
|
|
|
2024-07-03 10:22:22 +02:00
|
|
|
if _, err := os.Stat("./argo_workflows/"); os.IsNotExist(err) {
|
|
|
|
os.Mkdir("./argo_workflows/",0755)
|
2024-07-11 18:25:40 +02:00
|
|
|
logger.Logger.Info().Msg("Created argo_workflows/")
|
2024-07-03 10:22:22 +02:00
|
|
|
}
|
|
|
|
|
2024-07-11 18:25:40 +02:00
|
|
|
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)
|
|
|
|
// }
|
|
|
|
|
2024-04-09 11:20:08 +02:00
|
|
|
|
2024-07-11 18:25:40 +02:00
|
|
|
// g.LoadFrom(list["test-alpr"])
|
|
|
|
// g.ExportToArgo("test-alpr")
|
|
|
|
for(true){
|
2024-07-03 10:22:22 +02:00
|
|
|
fmt.Print("")
|
|
|
|
}
|
2024-04-19 16:13:41 +02:00
|
|
|
fmt.Print("stop")
|
2023-10-18 17:08:53 +02:00
|
|
|
|
|
|
|
}
|