From fbb29445712444a363a3800655807ce8f202add1 Mon Sep 17 00:00:00 2001 From: Dean Roehrich Date: Thu, 21 Mar 2024 13:32:29 -0500 Subject: [PATCH] Update DWS (#18) Signed-off-by: Dean Roehrich --- go.mod | 2 +- go.sum | 4 +- .../dws/api/v1alpha2/clientmount_types.go | 3 ++ .../dws/api/v1alpha2/owner_labels.go | 4 ++ .../api/v1alpha2/systemconfiguration_types.go | 48 +++++++++++++++++-- .../dws/api/v1alpha2/workflow_types.go | 3 ++ .../dws/api/v1alpha2/zz_generated.deepcopy.go | 24 +++++----- ...rkflowservices.github.io_clientmounts.yaml | 12 +++++ ...rvices.github.io_systemconfigurations.yaml | 10 ++-- .../utils/dwdparse/zz_generated.deepcopy.go | 2 +- vendor/modules.txt | 2 +- 11 files changed, 88 insertions(+), 26 deletions(-) diff --git a/go.mod b/go.mod index 4678f94..1101cdb 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/DataWorkflowServices/dws-test-driver go 1.19 require ( - github.com/DataWorkflowServices/dws v0.0.1-0.20231031201121-13a5a69a969e + github.com/DataWorkflowServices/dws v0.0.1-0.20240319151838-a7bbb79f5e4c github.com/ghodss/yaml v1.0.0 github.com/go-logr/logr v1.2.4 github.com/google/go-cmp v0.5.9 diff --git a/go.sum b/go.sum index fe69ba3..205629f 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/DataWorkflowServices/dws v0.0.1-0.20231031201121-13a5a69a969e h1:QhDrVNQ6zyJcnP0+I147Ei19QAoOL5sDvkjNTkRbELA= -github.com/DataWorkflowServices/dws v0.0.1-0.20231031201121-13a5a69a969e/go.mod h1:grHFCu0CoUK8exzS57r6cdf4qHpG1Pv5nl0n7evpaUM= +github.com/DataWorkflowServices/dws v0.0.1-0.20240319151838-a7bbb79f5e4c h1:8vziSdwPsSplJ+iLCqSm5ugOdL29iFJQe7gKRfD3PrI= +github.com/DataWorkflowServices/dws v0.0.1-0.20240319151838-a7bbb79f5e4c/go.mod h1:vSTBLWbsFjMYxx+sjMDyZpMXLY9m5Bp73cjnmAL30WU= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= diff --git a/vendor/github.com/DataWorkflowServices/dws/api/v1alpha2/clientmount_types.go b/vendor/github.com/DataWorkflowServices/dws/api/v1alpha2/clientmount_types.go index ce0f051..a7a2ea0 100644 --- a/vendor/github.com/DataWorkflowServices/dws/api/v1alpha2/clientmount_types.go +++ b/vendor/github.com/DataWorkflowServices/dws/api/v1alpha2/clientmount_types.go @@ -189,6 +189,9 @@ type ClientMountStatus struct { //+kubebuilder:object:root=true //+kubebuilder:storageversion //+kubebuilder:subresource:status +//+kubebuilder:printcolumn:name="DESIREDSTATE",type="string",JSONPath=".status.desiredState",description="mounted/unmounted" +//+kubebuilder:printcolumn:name="STATE",type="string",JSONPath=".status.state",description="mounted/unmounted" +//+kubebuilder:printcolumn:name="READY",type="boolean",JSONPath=".status.ready",description="True if current state is achieved" //+kubebuilder:printcolumn:name="ERROR",type="string",JSONPath=".status.error.severity" //+kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" diff --git a/vendor/github.com/DataWorkflowServices/dws/api/v1alpha2/owner_labels.go b/vendor/github.com/DataWorkflowServices/dws/api/v1alpha2/owner_labels.go index 7e1d52f..2af9d95 100644 --- a/vendor/github.com/DataWorkflowServices/dws/api/v1alpha2/owner_labels.go +++ b/vendor/github.com/DataWorkflowServices/dws/api/v1alpha2/owner_labels.go @@ -34,6 +34,7 @@ const ( OwnerKindLabel = "dataworkflowservices.github.io/owner.kind" OwnerNameLabel = "dataworkflowservices.github.io/owner.name" OwnerNamespaceLabel = "dataworkflowservices.github.io/owner.namespace" + OwnerUidLabel = "dataworkflowservices.github.io/owner.uid" ) // +kubebuilder:object:generate=false @@ -51,6 +52,7 @@ func AddOwnerLabels(child metav1.Object, owner metav1.Object) { labels[OwnerKindLabel] = reflect.Indirect(reflect.ValueOf(owner)).Type().Name() labels[OwnerNameLabel] = owner.GetName() labels[OwnerNamespaceLabel] = owner.GetNamespace() + labels[OwnerUidLabel] = string(owner.GetUID()) child.SetLabels(labels) } @@ -73,6 +75,7 @@ func RemoveOwnerLabels(child metav1.Object) { delete(labels, OwnerKindLabel) delete(labels, OwnerNameLabel) delete(labels, OwnerNamespaceLabel) + delete(labels, OwnerUidLabel) child.SetLabels(labels) } @@ -86,6 +89,7 @@ func AddWorkflowLabels(child metav1.Object, workflow *Workflow) { labels[WorkflowNameLabel] = workflow.Name labels[WorkflowNamespaceLabel] = workflow.Namespace + labels[WorkflowUidLabel] = string(workflow.GetUID()) child.SetLabels(labels) } diff --git a/vendor/github.com/DataWorkflowServices/dws/api/v1alpha2/systemconfiguration_types.go b/vendor/github.com/DataWorkflowServices/dws/api/v1alpha2/systemconfiguration_types.go index f9d36cf..3e4d29f 100644 --- a/vendor/github.com/DataWorkflowServices/dws/api/v1alpha2/systemconfiguration_types.go +++ b/vendor/github.com/DataWorkflowServices/dws/api/v1alpha2/systemconfiguration_types.go @@ -1,5 +1,5 @@ /* - * Copyright 2021-2023 Hewlett Packard Enterprise Development LP + * Copyright 2021-2024 Hewlett Packard Enterprise Development LP * Other additional copyright holders may be indicated within. * * The entirety of this work is licensed under the Apache License, @@ -26,8 +26,9 @@ import ( "github.com/DataWorkflowServices/dws/utils/updater" ) -// SystemConfigurationComputeNode describes a compute node in the system -type SystemConfigurationComputeNode struct { +// SystemConfigurationExternalComputeNode describes a compute node that is +// not directly matched with any of the nodes in the StorageNodes list. +type SystemConfigurationExternalComputeNode struct { // Name of the compute node Name string `json:"name"` } @@ -57,8 +58,9 @@ type SystemConfigurationStorageNode struct { // SystemConfigurationSpec describes the node layout of the system. This is filled in by // an administrator at software installation time. type SystemConfigurationSpec struct { - // ComputeNodes is the list of compute nodes on the system - ComputeNodes []SystemConfigurationComputeNode `json:"computeNodes,omitempty"` + // ExternalComputeNodes is the list of compute nodes that are not + // directly matched with any of the StorageNodes. + ExternalComputeNodes []SystemConfigurationExternalComputeNode `json:"externalComputeNodes,omitempty"` // StorageNodes is the list of storage nodes on the system StorageNodes []SystemConfigurationStorageNode `json:"storageNodes,omitempty"` @@ -113,3 +115,39 @@ type SystemConfigurationList struct { func init() { SchemeBuilder.Register(&SystemConfiguration{}, &SystemConfigurationList{}) } + +// Computes returns the names of the computes attached to Rabbit nodes +func (in *SystemConfiguration) Computes() []*string { + // We expect that there can be a large number of compute nodes and we don't + // want to duplicate all of those names. + // So we'll walk spec.storageNodes twice so we can set the + // length/capacity for the array that will hold pointers to the names. + num := 0 + for i1 := range in.Spec.StorageNodes { + num += len(in.Spec.StorageNodes[i1].ComputesAccess) + } + + computes := make([]*string, num) + idx := 0 + for i2 := range in.Spec.StorageNodes { + for i3 := range in.Spec.StorageNodes[i2].ComputesAccess { + computes[idx] = &in.Spec.StorageNodes[i2].ComputesAccess[i3].Name + idx++ + } + } + return computes +} + +// ComputesExternal returns the names of the external compute nodes in the system +func (in *SystemConfiguration) ComputesExternal() []*string { + num := len(in.Spec.ExternalComputeNodes) + computes := make([]*string, num) + idx := 0 + + // Add the external computes. + for i := range in.Spec.ExternalComputeNodes { + computes[idx] = &in.Spec.ExternalComputeNodes[i].Name + idx++ + } + return computes +} diff --git a/vendor/github.com/DataWorkflowServices/dws/api/v1alpha2/workflow_types.go b/vendor/github.com/DataWorkflowServices/dws/api/v1alpha2/workflow_types.go index 9d35b43..52970f5 100644 --- a/vendor/github.com/DataWorkflowServices/dws/api/v1alpha2/workflow_types.go +++ b/vendor/github.com/DataWorkflowServices/dws/api/v1alpha2/workflow_types.go @@ -35,6 +35,9 @@ const ( // WorkflowNamespaceLabel is defined for resources that relate to the namespace of a DWS Workflow WorkflowNamespaceLabel = "dataworkflowservices.github.io/workflow.namespace" + + // WorkflowUIDLabel holds the UID of the parent workflow resource + WorkflowUidLabel = "dataworkflowservices.github.io/workflow.uid" ) // WorkflowState is the enumeration of the state of the workflow diff --git a/vendor/github.com/DataWorkflowServices/dws/api/v1alpha2/zz_generated.deepcopy.go b/vendor/github.com/DataWorkflowServices/dws/api/v1alpha2/zz_generated.deepcopy.go index 6cd8777..ef8f0a2 100644 --- a/vendor/github.com/DataWorkflowServices/dws/api/v1alpha2/zz_generated.deepcopy.go +++ b/vendor/github.com/DataWorkflowServices/dws/api/v1alpha2/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ //go:build !ignore_autogenerated /* - * Copyright 2023 Hewlett Packard Enterprise Development LP + * Copyright 2024 Hewlett Packard Enterprise Development LP * Other additional copyright holders may be indicated within. * * The entirety of this work is licensed under the Apache License, @@ -1149,31 +1149,31 @@ func (in *SystemConfiguration) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SystemConfigurationComputeNode) DeepCopyInto(out *SystemConfigurationComputeNode) { +func (in *SystemConfigurationComputeNodeReference) DeepCopyInto(out *SystemConfigurationComputeNodeReference) { *out = *in } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SystemConfigurationComputeNode. -func (in *SystemConfigurationComputeNode) DeepCopy() *SystemConfigurationComputeNode { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SystemConfigurationComputeNodeReference. +func (in *SystemConfigurationComputeNodeReference) DeepCopy() *SystemConfigurationComputeNodeReference { if in == nil { return nil } - out := new(SystemConfigurationComputeNode) + out := new(SystemConfigurationComputeNodeReference) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SystemConfigurationComputeNodeReference) DeepCopyInto(out *SystemConfigurationComputeNodeReference) { +func (in *SystemConfigurationExternalComputeNode) DeepCopyInto(out *SystemConfigurationExternalComputeNode) { *out = *in } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SystemConfigurationComputeNodeReference. -func (in *SystemConfigurationComputeNodeReference) DeepCopy() *SystemConfigurationComputeNodeReference { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SystemConfigurationExternalComputeNode. +func (in *SystemConfigurationExternalComputeNode) DeepCopy() *SystemConfigurationExternalComputeNode { if in == nil { return nil } - out := new(SystemConfigurationComputeNodeReference) + out := new(SystemConfigurationExternalComputeNode) in.DeepCopyInto(out) return out } @@ -1213,9 +1213,9 @@ func (in *SystemConfigurationList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SystemConfigurationSpec) DeepCopyInto(out *SystemConfigurationSpec) { *out = *in - if in.ComputeNodes != nil { - in, out := &in.ComputeNodes, &out.ComputeNodes - *out = make([]SystemConfigurationComputeNode, len(*in)) + if in.ExternalComputeNodes != nil { + in, out := &in.ExternalComputeNodes, &out.ExternalComputeNodes + *out = make([]SystemConfigurationExternalComputeNode, len(*in)) copy(*out, *in) } if in.StorageNodes != nil { diff --git a/vendor/github.com/DataWorkflowServices/dws/config/crd/bases/dataworkflowservices.github.io_clientmounts.yaml b/vendor/github.com/DataWorkflowServices/dws/config/crd/bases/dataworkflowservices.github.io_clientmounts.yaml index bdbf1f0..31b2ff8 100644 --- a/vendor/github.com/DataWorkflowServices/dws/config/crd/bases/dataworkflowservices.github.io_clientmounts.yaml +++ b/vendor/github.com/DataWorkflowServices/dws/config/crd/bases/dataworkflowservices.github.io_clientmounts.yaml @@ -270,6 +270,18 @@ spec: subresources: status: {} - additionalPrinterColumns: + - description: mounted/unmounted + jsonPath: .status.desiredState + name: DESIREDSTATE + type: string + - description: mounted/unmounted + jsonPath: .status.state + name: STATE + type: string + - description: True if current state is achieved + jsonPath: .status.ready + name: READY + type: boolean - jsonPath: .status.error.severity name: ERROR type: string diff --git a/vendor/github.com/DataWorkflowServices/dws/config/crd/bases/dataworkflowservices.github.io_systemconfigurations.yaml b/vendor/github.com/DataWorkflowServices/dws/config/crd/bases/dataworkflowservices.github.io_systemconfigurations.yaml index 4b2e1f1..2add1f7 100644 --- a/vendor/github.com/DataWorkflowServices/dws/config/crd/bases/dataworkflowservices.github.io_systemconfigurations.yaml +++ b/vendor/github.com/DataWorkflowServices/dws/config/crd/bases/dataworkflowservices.github.io_systemconfigurations.yaml @@ -152,11 +152,13 @@ spec: system. This is filled in by an administrator at software installation time. properties: - computeNodes: - description: ComputeNodes is the list of compute nodes on the system + externalComputeNodes: + description: ExternalComputeNodes is the list of compute nodes that + are not directly matched with any of the StorageNodes. items: - description: SystemConfigurationComputeNode describes a compute - node in the system + description: SystemConfigurationExternalComputeNode describes a + compute node that is not directly matched with any of the nodes + in the StorageNodes list. properties: name: description: Name of the compute node diff --git a/vendor/github.com/DataWorkflowServices/dws/utils/dwdparse/zz_generated.deepcopy.go b/vendor/github.com/DataWorkflowServices/dws/utils/dwdparse/zz_generated.deepcopy.go index f0fb451..dbeaaa3 100644 --- a/vendor/github.com/DataWorkflowServices/dws/utils/dwdparse/zz_generated.deepcopy.go +++ b/vendor/github.com/DataWorkflowServices/dws/utils/dwdparse/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ //go:build !ignore_autogenerated /* - * Copyright 2023 Hewlett Packard Enterprise Development LP + * Copyright 2024 Hewlett Packard Enterprise Development LP * Other additional copyright holders may be indicated within. * * The entirety of this work is licensed under the Apache License, diff --git a/vendor/modules.txt b/vendor/modules.txt index d5356fc..c1bea88 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,4 +1,4 @@ -# github.com/DataWorkflowServices/dws v0.0.1-0.20231031201121-13a5a69a969e +# github.com/DataWorkflowServices/dws v0.0.1-0.20240319151838-a7bbb79f5e4c ## explicit; go 1.19 github.com/DataWorkflowServices/dws/api/v1alpha2 github.com/DataWorkflowServices/dws/config/crd/bases