From 9a17623cabce7915d6c0a7d45b05c54beff37737 Mon Sep 17 00:00:00 2001 From: pb Date: Tue, 8 Apr 2025 17:22:43 +0200 Subject: [PATCH] added logging --- workflow_builder/admiralty_setter.go | 4 ++++ workflow_builder/argo_builder.go | 2 ++ 2 files changed, 6 insertions(+) diff --git a/workflow_builder/admiralty_setter.go b/workflow_builder/admiralty_setter.go index 9c1b0c7..bad8d16 100644 --- a/workflow_builder/admiralty_setter.go +++ b/workflow_builder/admiralty_setter.go @@ -7,10 +7,12 @@ import ( "time" oclib "cloud.o-forge.io/core/oc-lib" + "cloud.o-forge.io/core/oc-lib/logs" "cloud.o-forge.io/core/oc-lib/models/peer" tools "cloud.o-forge.io/core/oc-lib/tools" ) + type AdmiraltySetter struct { Id string // ID to identify the execution, correspond to workflow_executions id NodeName string // Allows to retrieve the name of the node used for this execution on each peer {"peerId": "nodeName"} @@ -18,6 +20,8 @@ type AdmiraltySetter struct { func (s *AdmiraltySetter) InitializeAdmiralty(localPeerID string,remotePeerID string) error { + logger = logs.GetLogger() + data := oclib.NewRequest(oclib.LibDataEnum(oclib.PEER),"",localPeerID,nil,nil).LoadOne(remotePeerID) if data.Code != 200 { logger.Error().Msg("Error while trying to instantiate remote peer " + remotePeerID) diff --git a/workflow_builder/argo_builder.go b/workflow_builder/argo_builder.go index f942c9d..5631c26 100644 --- a/workflow_builder/argo_builder.go +++ b/workflow_builder/argo_builder.go @@ -14,6 +14,7 @@ import ( "time" oclib "cloud.o-forge.io/core/oc-lib" + "cloud.o-forge.io/core/oc-lib/logs" "cloud.o-forge.io/core/oc-lib/models/common/enum" "cloud.o-forge.io/core/oc-lib/models/resources" w "cloud.o-forge.io/core/oc-lib/models/workflow" @@ -62,6 +63,7 @@ type Spec struct { // TODO: found on a processing instance linked to storage // add s3, gcs, azure, etc if needed on a link between processing and storage func (b *ArgoBuilder) CreateDAG(namespace string, write bool) ( int, []string, []string, error) { + logger = logs.GetLogger() fmt.Println("Creating DAG", b.OriginWorkflow.Graph.Items) // handle services by checking if there is only one processing with hostname and port firstItems, lastItems, volumes := b.createTemplates(namespace)