Added methods to verify if workflow contains compute on other peers before setting up admiralty
This commit is contained in:
29
main.go
29
main.go
@@ -87,7 +87,7 @@ func main() {
|
||||
logger.Error().Msg("Could not retrieve workflow " + conf.GetConfig().WorkflowID + " from oc-catalog API")
|
||||
}
|
||||
|
||||
argo_file_path, stepMax, err := new_wf.ExportToArgo(exec.ExecutionsID, conf.GetConfig().Timeout)
|
||||
builder, argo_file_path, stepMax, err := new_wf.ExportToArgo(exec.ExecutionsID, conf.GetConfig().Timeout)
|
||||
if err != nil {
|
||||
logger.Error().Msg("Could not create the Argo file for " + conf.GetConfig().WorkflowID)
|
||||
logger.Error().Msg(err.Error())
|
||||
@@ -99,15 +99,20 @@ func main() {
|
||||
wf_logger = logger.With().Str("argo_name", workflowName).Str("workflow_id", conf.GetConfig().WorkflowID).Str("workflow_execution_id", conf.GetConfig().ExecutionID).Logger()
|
||||
wf_logger.Debug().Msg("Testing argo name")
|
||||
|
||||
if conf.GetConfig().KubeHost == "" {
|
||||
// Not in a k8s environment, get conf from parameters
|
||||
fmt.Println("Executes outside of k8s")
|
||||
executeOutside(argo_file_path, stepMax)
|
||||
} else {
|
||||
// Executed in a k8s environment
|
||||
fmt.Println("Executes inside a k8s")
|
||||
executeInside(exec.GetID(), "argo", argo_file_path, stepMax)
|
||||
err = builder.CompleteBuild(exec.ExecutionsID)
|
||||
if err != nil {
|
||||
logger.Error().Msg(err.Error())
|
||||
}
|
||||
_ = stepMax
|
||||
// if conf.GetConfig().KubeHost == "" {
|
||||
// // Not in a k8s environment, get conf from parameters
|
||||
// fmt.Println("Executes outside of k8s")
|
||||
// executeOutside(argo_file_path, stepMax)
|
||||
// } else {
|
||||
// // Executed in a k8s environment
|
||||
// fmt.Println("Executes inside a k8s")
|
||||
// executeInside(exec.GetID(), "argo", argo_file_path, stepMax)
|
||||
// }
|
||||
}
|
||||
|
||||
// So far we only log the output from
|
||||
@@ -224,9 +229,9 @@ func loadConfig(is_k8s bool, parser *argparse.Parser) {
|
||||
o = initOnion(o)
|
||||
setConf(is_k8s, o, parser)
|
||||
|
||||
if !IsValidUUID(conf.GetConfig().ExecutionID) {
|
||||
logger.Fatal().Msg("Provided ID is not an UUID")
|
||||
}
|
||||
// if !IsValidUUID(conf.GetConfig().ExecutionID) {
|
||||
// logger.Fatal().Msg("Provided ID is not an UUID")
|
||||
// }
|
||||
}
|
||||
|
||||
func setConf(is_k8s bool, o *onion.Onion, parser *argparse.Parser) {
|
||||
|
||||
Reference in New Issue
Block a user