Added methods to verify if workflow contains compute on other peers before setting up admiralty

This commit is contained in:
pb
2025-03-07 16:19:26 +01:00
parent def56e5822
commit 32ce70da6e
5 changed files with 116 additions and 105 deletions

View File

@@ -41,20 +41,20 @@ func (w *WorflowDB) getWorkflow(workflow_id string, peerID string) (workflow *wo
return new_wf, nil
}
func (w *WorflowDB) ExportToArgo(namespace string, timeout int) (string, int, error) {
func (w *WorflowDB) ExportToArgo(namespace string, timeout int) (*ArgoBuilder,string, int, error) {
logger := oclib.GetLogger()
fmt.Println("Exporting to Argo", w.Workflow)
if len(w.Workflow.Name) == 0 || w.Workflow.Graph == nil {
return "", 0, fmt.Errorf("can't export a graph that has not been loaded yet")
return nil, "", 0, fmt.Errorf("can't export a graph that has not been loaded yet")
}
argo_builder := ArgoBuilder{OriginWorkflow: w.Workflow, Timeout: timeout}
filename, stepMax, _, _, err := argo_builder.CreateDAG(namespace, true)
argoBuilder := ArgoBuilder{OriginWorkflow: w.Workflow, Timeout: timeout}
filename, stepMax, _, _, err := argoBuilder.CreateDAG(namespace, true)
if err != nil {
logger.Error().Msg("Could not create the argo file for " + w.Workflow.Name)
return "", 0, err
return nil, "", 0, err
}
return filename, stepMax, nil
return &argoBuilder, filename, stepMax, nil
}
// TODO implement this function