Updated argo build to use minio

This commit is contained in:
pb
2025-07-28 15:52:27 +02:00
parent 0b652f5dfc
commit 6bacf44f2f
4 changed files with 49 additions and 35 deletions

View File

@@ -55,7 +55,7 @@ func (b *Workflow) getDag() *Dag {
}
type Spec struct {
ServiceAccountName string `yaml:"serviceAccountName"`
ServiceAccountName string `yaml:"serviceAccountName,omitempty"`
Entrypoint string `yaml:"entrypoint"`
Arguments []Parameter `yaml:"arguments,omitempty"`
Volumes []VolumeClaimTemplate `yaml:"volumeClaimTemplates,omitempty"`
@@ -75,7 +75,7 @@ func (b *ArgoBuilder) CreateDAG(namespace string, write bool) ( int, []string, [
if b.Timeout > 0 {
b.Workflow.Spec.Timeout = b.Timeout
}
// b.Workflow.Spec.ServiceAccountName = "sa-"+namespace
b.Workflow.Spec.ServiceAccountName = "sa-" + namespace
b.Workflow.Spec.Entrypoint = "dag"
b.Workflow.ApiVersion = "argoproj.io/v1alpha1"
b.Workflow.Kind = "Workflow"
@@ -86,7 +86,7 @@ func (b *ArgoBuilder) CreateDAG(namespace string, write bool) ( int, []string, [
return len(b.Workflow.getDag().Tasks), firstItems, lastItems, nil
}
func (b *ArgoBuilder) createTemplates(namespace string) ([]string, []string, []VolumeMount) {
volumes := []VolumeMount{}
firstItems := []string{}
@@ -260,7 +260,7 @@ func (b *ArgoBuilder) addS3annotations(art *Artifact, template *Template, rw gra
// v1 : v0.2 + if doesn't exist edit/create the configMap with the response from API call
if sel != nil {
b.addAuthInformation(storage, namespace, art)
art.S3.Bucket = "oc-bucket" // DEFAULT : will need to update this to create an unique
art.S3.Bucket = namespace // DEFAULT : will need to update this to create an unique
art.S3.EndPoint = sel.(*resources.StorageResourceInstance).Source
}
}
@@ -490,21 +490,21 @@ func (b *ArgoBuilder) retrieveProcessingCompute(graphID string) *resources.Compu
// Execute the last actions once the YAML file for the Argo Workflow is created
func (b *ArgoBuilder) CompleteBuild(executionsId string) (string, error) {
logger.Info().Msg(fmt.Sprint("DEV :: Completing build"))
// setter := AdmiraltySetter{Id: executionsId}
// // Setup admiralty for each node
// for _, peer := range b.RemotePeers {
// logger.Info().Msg(fmt.Sprint("DEV :: Launching Admiralty Setup for ", peer))
// setter.InitializeAdmiralty(conf.GetConfig().PeerID,peer)
// }
setter := AdmiraltySetter{Id: executionsId}
// Setup admiralty for each node
for _, peer := range b.RemotePeers {
logger.Info().Msg(fmt.Sprint("DEV :: Launching Admiralty Setup for ", peer))
setter.InitializeAdmiralty(conf.GetConfig().PeerID,peer)
}
// // Update the name of the admiralty node to use
// for _, template := range b.Workflow.Spec.Templates {
// if len(template.Metadata.Annotations) > 0 {
// if peerId, ok := template.Metadata.Annotations["multicluster.admiralty.io/clustername"]; ok {
// template.Metadata.Annotations["multicluster.admiralty.io/clustername"] = "target-" + peerId + "-" + conf.GetConfig().ExecutionID
// }
// }
// }
// Update the name of the admiralty node to use
for _, template := range b.Workflow.Spec.Templates {
if len(template.Metadata.Annotations) > 0 {
if peerId, ok := template.Metadata.Annotations["multicluster.admiralty.io/clustername"]; ok {
template.Metadata.Annotations["multicluster.admiralty.io/clustername"] = "target-" + oclib.GetConcatenatedName(peerId, executionsId)
}
}
}
// Generate the YAML file
random_name := fakelish.GenerateFakeWord(5, 8) + "-" + fakelish.GenerateFakeWord(5, 8)