Skip to content

Commit

Permalink
wip: reconcile suggestion volume if pvc override specified via Algori…
Browse files Browse the repository at this point in the history
…thmSpec.suggestion_spec (DeploymentSpec) or resumePolicy is FromVolume
  • Loading branch information
a9p committed Jun 3, 2023
1 parent 950f4c5 commit ec7b5ad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 2 additions & 3 deletions pkg/controller.v1beta1/suggestion/suggestion_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,13 @@ func (r *ReconcileSuggestion) ReconcileSuggestion(instance *suggestionsv1beta1.S
suggestionNsName := types.NamespacedName{Name: instance.GetName(), Namespace: instance.GetNamespace()}
logger := log.WithValues("Suggestion", suggestionNsName)

// Check if algorithm overrides volume reconcile policy
suggestionConfigData, err := katibconfig.GetSuggestionConfigData(instance.Spec.Algorithm.AlgorithmName, r.Client)
if err != nil {
return err
}

// If ResumePolicy = FromVolume (or overriden), volume is reconciled for suggestion
if suggestionConfigData.VolumeForceMount || instance.Spec.ResumePolicy == experimentsv1beta1.FromVolume {
// If ResumePolicy is FromVolume or persistentVolumeClaimSpec provided, volume is reconciled for suggestion
if suggestionConfigData.persistentVolumeClaimSpec != nil || instance.Spec.ResumePolicy == experimentsv1beta1.FromVolume {
pvc, pv, err := r.DesiredVolume(instance)
if err != nil {
return err
Expand Down
1 change: 0 additions & 1 deletion pkg/util/v1beta1/katibconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ type SuggestionConfig struct {
PersistentVolumeClaimSpec corev1.PersistentVolumeClaimSpec `json:"persistentVolumeClaimSpec,omitempty"`
PersistentVolumeSpec corev1.PersistentVolumeSpec `json:"persistentVolumeSpec,omitempty"`
PersistentVolumeLabels map[string]string `json:"persistentVolumeLabels,omitempty"`
VolumeForceMount bool `json:"volumeForceMount,omitempty"`
}

// EarlyStoppingConfig is the JSON early stopping structure in Katib config.
Expand Down

0 comments on commit ec7b5ad

Please sign in to comment.