From 0331727bfd05577adbfe828bf8a3010db9753891 Mon Sep 17 00:00:00 2001 From: mr Date: Tue, 12 Nov 2024 09:10:33 +0100 Subject: [PATCH] Building --- workflow_builder/argo_builder.go | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/workflow_builder/argo_builder.go b/workflow_builder/argo_builder.go index c775c80..a49a51f 100644 --- a/workflow_builder/argo_builder.go +++ b/workflow_builder/argo_builder.go @@ -13,7 +13,6 @@ import ( "time" oclib "cloud.o-forge.io/core/oc-lib" - "cloud.o-forge.io/core/oc-lib/models/resources/compute" "cloud.o-forge.io/core/oc-lib/models/resources/processing" "cloud.o-forge.io/core/oc-lib/models/resources/workflow/graph" w "cloud.o-forge.io/core/oc-lib/models/workflow" @@ -181,18 +180,6 @@ func (b *ArgoBuilder) createTemplates() ([]string, []string, []VolumeMount) { return firstItems, lastItems, volumes } -func (b *ArgoBuilder) getAllComputeFromProcessing(p *processing.ProcessingResource) []*compute.ComputeResource { - computeResources := []*compute.ComputeResource{} - for _, link := range b.OriginWorkflow.Graph.Links { - if link.Source.ID == p.GetID() && b.OriginWorkflow.Graph.Items[link.Destination.ID].Compute != nil { - computeResources = append(computeResources, b.OriginWorkflow.Graph.Items[link.Destination.ID].Compute) - } else if link.Destination.ID == p.GetID() && b.OriginWorkflow.Graph.Items[link.Source.ID].Compute != nil { - computeResources = append(computeResources, b.OriginWorkflow.Graph.Items[link.Source.ID].Compute) - } - } - return computeResources -} - func (b *ArgoBuilder) createArgoTemplates(id string, processing *processing.ProcessingResource, volumes []VolumeMount, @@ -202,11 +189,10 @@ func (b *ArgoBuilder) createArgoTemplates(id string, template := &Template{Name: getArgoName(processing.GetName(), id)} template.CreateContainer(processing, b.Workflow.getDag()) // get datacenter from the processing - computes := b.getAllComputeFromProcessing(processing) - for _, compute := range computes { + if processing.IsService { b.CreateService(id, processing) template.Metadata.Labels = make(map[string]string) - template.Metadata.Labels["app"] = "oc-service-" + processing.GetName() + "-" + compute.GetName() // Construct the template for the k8s service and add a link in graph between k8s service and processing + template.Metadata.Labels["app"] = "oc-service-" + processing.GetName() // Construct the template for the k8s service and add a link in graph between k8s service and processing } storages := b.OriginWorkflow.GetStoragesByRelatedProcessing(id) for _, storage := range storages {