Skip to content

Commit

Permalink
Move DataMovementManager from nnf-dm and rename to NnfDataMovementMan…
Browse files Browse the repository at this point in the history
…ager

* NnfDataMovementManager is now defined in nnf-sos so the resource can
  be retrieved by nnf-sos code (similar to NnfDataMovement)
* Renamed it to be consistent with NnfDataMovement
* Fixed and renamed RBAC roles
* Fix some references to DataMovement where it should be NnfDataMovement

Signed-off-by: Blake Devcich <[email protected]>
  • Loading branch information
bdevcich committed Nov 8, 2023
1 parent ff88eaf commit f0cdea1
Show file tree
Hide file tree
Showing 21 changed files with 7,971 additions and 117 deletions.
10 changes: 5 additions & 5 deletions api/v1alpha1/nnf_datamovement_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const (
DataMovementNamespace = "nnf-dm-system"
)

// NnfDataMovementSpec defines the desired state of DataMovement
// NnfDataMovementSpec defines the desired state of NnfDataMovement
type NnfDataMovementSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
Expand Down Expand Up @@ -66,7 +66,7 @@ type NnfDataMovementSpec struct {
UserConfig *NnfDataMovementConfig `json:"userConfig,omitempty"`
}

// DataMovementSpecSourceDestination defines the desired source or destination of data movement
// NnfDataMovementSpecSourceDestination defines the desired source or destination of data movement
type NnfDataMovementSpecSourceDestination struct {

// Path describes the location of the user data relative to the storage instance
Expand Down Expand Up @@ -110,7 +110,7 @@ type NnfDataMovementConfig struct {
MaxSlots *int `json:"maxSlots,omitempty"`
}

// DataMovementCommandStatus defines the observed status of the underlying data movement
// NnfDataMovementCommandStatus defines the observed status of the underlying data movement
// command (MPI File Utils' `dcp` command).
type NnfDataMovementCommandStatus struct {
// The command that was executed during data movement.
Expand All @@ -134,7 +134,7 @@ type NnfDataMovementCommandStatus struct {
LastMessageTime metav1.MicroTime `json:"lastMessageTime,omitempty"`
}

// DataMovementStatus defines the observed state of DataMovement
// NnfDataMovementStatus defines the observed state of NnfDataMovement
type NnfDataMovementStatus struct {
// Current state of data movement.
// +kubebuilder:validation:Enum=Starting;Running;Finished
Expand Down Expand Up @@ -188,7 +188,7 @@ const (
//+kubebuilder:printcolumn:name="ERROR",type="string",JSONPath=".status.error.severity"
//+kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp"

// NnfDataMovement is the Schema for the datamovements API
// NnfDataMovement is the Schema for the nnfdatamovements API
type NnfDataMovement struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
89 changes: 89 additions & 0 deletions api/v1alpha1/nnf_datamovementmanager_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/*
* Copyright 2022 Hewlett Packard Enterprise Development LP
* Other additional copyright holders may be indicated within.
*
* The entirety of this work is licensed under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
*
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package v1alpha1

import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

const (
DataMovementWorkerLabel = "dm.cray.hpe.com/worker"
)

// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

// NnfDataMovementManagerSpec defines the desired state of NnfDataMovementManager
type NnfDataMovementManagerSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file

// Selector defines the pod selector used in scheduling the worker nodes. This value is duplicated
// to the template.spec.metadata.labels to satisfy the requirements of the worker's Daemon Set.
Selector metav1.LabelSelector `json:"selector"`

// Template defines the pod template that is used for the basis of the worker Daemon Set that
// manages the per node data movement operations.
Template corev1.PodTemplateSpec `json:"template"`

// Host Path defines the directory location of shared mounts on an individual worker node.
HostPath string `json:"hostPath"`

// Mount Path defines the location within the container at which the Host Path volume should be mounted.
MountPath string `json:"mountPath"`
}

// NnfDataMovementManagerStatus defines the observed state of NnfDataMovementManager
type NnfDataMovementManagerStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file

// Ready indicates that the Data Movement Manager has achieved the desired readiness state
// and all managed resources are initialized.
Ready bool `json:"ready,omitempty"`
}

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:printcolumn:name="READY",type="boolean",JSONPath=".status.ready",description="True if manager readied all resoures"
//+kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp"

// NnfDataMovementManager is the Schema for the nnfdatamovementmanagers API
type NnfDataMovementManager struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec NnfDataMovementManagerSpec `json:"spec,omitempty"`
Status NnfDataMovementManagerStatus `json:"status,omitempty"`
}

//+kubebuilder:object:root=true

// NnfDataMovementManagerList contains a list of NnfDataMovementManager
type NnfDataMovementManagerList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []NnfDataMovementManager `json:"items"`
}

func init() {
SchemeBuilder.Register(&NnfDataMovementManager{}, &NnfDataMovementManagerList{})
}
91 changes: 91 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f0cdea1

Please sign in to comment.