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
|
|
|
|
2024-07-03 10:21:17 +02:00
|
|
|
conf "oc-scheduler/conf"
|
2024-07-29 15:45:32 +02:00
|
|
|
"oc-scheduler/models"
|
2024-07-03 10:21:17 +02:00
|
|
|
|
2024-07-11 18:25:40 +02:00
|
|
|
"oc-scheduler/daemons"
|
2024-08-09 18:44:33 +02:00
|
|
|
|
|
|
|
oclib "cloud.o-forge.io/core/oc-lib"
|
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-08-09 18:44:33 +02:00
|
|
|
var bookings models.ScheduledBooking
|
|
|
|
|
|
|
|
oclib.SetConfig(conf.GetConfig().MongoUrl,"DC_myDC")
|
|
|
|
oclib.Init("oc-scheduler")
|
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-11 18:25:40 +02:00
|
|
|
|
2024-07-29 15:45:32 +02:00
|
|
|
sch_mngr := daemons.ScheduleManager{Api_url: apiurl}
|
|
|
|
sch_mngr.SetBookings(&bookings)
|
|
|
|
exe_mngr := daemons.ExecutionManager{}
|
|
|
|
exe_mngr.SetBookings(&bookings)
|
|
|
|
|
2024-08-09 18:44:33 +02:00
|
|
|
go sch_mngr.ListenForWorkflowSubmissions()
|
|
|
|
|
2024-07-29 15:45:32 +02:00
|
|
|
go sch_mngr.SchedulePolling()
|
2024-08-09 18:44:33 +02:00
|
|
|
exe_mngr.RetrieveNextExecutions()
|
2024-07-29 15:45:32 +02:00
|
|
|
|
2024-07-11 18:25:40 +02:00
|
|
|
|
|
|
|
// 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")
|
2024-07-29 15:45:32 +02:00
|
|
|
|
2024-04-19 16:13:41 +02:00
|
|
|
fmt.Print("stop")
|
2023-10-18 17:08:53 +02:00
|
|
|
|
|
|
|
}
|