Finished to implement admiralty onto the final argo yaml file and restructured file creation

This commit is contained in:
pb
2025-04-02 11:40:14 +02:00
parent 73e1747c91
commit 08ade1af66
5 changed files with 125 additions and 54 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) (*ArgoBuilder,string, int, error) {
func (w *WorflowDB) ExportToArgo(namespace string, timeout int) (*ArgoBuilder, int, error) {
logger := oclib.GetLogger()
fmt.Println("Exporting to Argo", w.Workflow)
if len(w.Workflow.Name) == 0 || w.Workflow.Graph == nil {
return nil, "", 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")
}
argoBuilder := ArgoBuilder{OriginWorkflow: w.Workflow, Timeout: timeout}
filename, stepMax, _, _, err := argoBuilder.CreateDAG(namespace, true)
stepMax, _, _, err := argoBuilder.CreateDAG(namespace, true)
if err != nil {
logger.Error().Msg("Could not create the argo file for " + w.Workflow.Name)
return nil, "", 0, err
return nil, 0, err
}
return &argoBuilder, filename, stepMax, nil
return &argoBuilder, stepMax, nil
}
// TODO implement this function