-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More container fields for SuggestionConfig #2000
Changes from 6 commits
c6f87bd
427f115
7f1b284
5410bdc
92d0471
caa08c8
6cc917e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -34,9 +34,7 @@ import ( | |||
|
||||
// SuggestionConfig is the JSON suggestion structure in Katib config. | ||||
type SuggestionConfig struct { | ||||
Image string `json:"image"` | ||||
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"` | ||||
Resource corev1.ResourceRequirements `json:"resources,omitempty"` | ||||
corev1.Container `json:",inline"` | ||||
ServiceAccountName string `json:"serviceAccountName,omitempty"` | ||||
VolumeMountPath string `json:"volumeMountPath,omitempty"` | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @fischor Do we need
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The current Katib The referenced snippet kind of follows the logic:
In case the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see, that is because we set the default value name for Suggestion Volume. Please can you leave comment that we should refactor Also, I think we should modify if s.Spec.ResumePolicy == experimentsv1beta1.FromVolume {
volumeMount := corev1.VolumeMount{
Name: consts.ContainerSuggestionVolumeName,
MountPath: suggestionConfigData.VolumeMountPath,
}
suggestionContainer.VolumeMounts = append(suggestionContainer.VolumeMounts, volumeMount)
} WDYT @fischor ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @andreyvelich Have you seen that the consts.DefaultSuggestionPortName port is also just set if the Container specified in the suggestion has no ports set? See https://github.com/fischor/katib/blob/7f1b2842f87158c25c54f577da1b82ddc7a958e3/pkg/controller.v1beta1/suggestion/composer/composer.go#L194-L201 I think both ways of doing this have pros/cons. If we always append the default volume/port then the user has no option to overwrite it. If we never append the default volume/port, then the user needs to be aware that it has to specify it when setting any volumes/ports. A third option would be to check if the default volume/port is already set in the container and only append if its not. I think I would prefer that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I think that should work, but we need to make sure that volume and port name/number is correct ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @andreyvelich I have added check to only append a VolumeMount for the Suggestion Volume only in case no volume mount with that default name ("suggestion-volume") exists. And a check to only append a ContainerPort for the Suggestion API in case no port with the default suggestion api port name and/or port number exists. |
||||
PersistentVolumeClaimSpec corev1.PersistentVolumeClaimSpec `json:"persistentVolumeClaimSpec,omitempty"` | ||||
|
@@ -98,7 +96,7 @@ func GetSuggestionConfigData(algorithmName string, client client.Client) (Sugges | |||
suggestionConfigData.ImagePullPolicy = setImagePullPolicy(suggestionConfigData.ImagePullPolicy) | ||||
|
||||
// Set resource requirements for suggestion | ||||
suggestionConfigData.Resource = setResourceRequirements(suggestionConfigData.Resource) | ||||
suggestionConfigData.Resources = setResourceRequirements(suggestionConfigData.Resources) | ||||
|
||||
// Set default suggestion container volume mount path | ||||
if suggestionConfigData.VolumeMountPath == "" { | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we verify that port
name
andcontainerPort
is set together in the Katib Config ?DefaultSuggestionPortName
andDefaultSuggestionPort
is always used for the Suggestion's service.So if user set
DefaultSuggestionPortName
port with different address, the Suggestion service fails.cc @tenzen-y
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @johnugeorge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be better to prohibit setting containerPort in katibConfig.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add a validation check either ways.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fischor Do you have time to check my latest message ? We are getting closer for the Katib 0.15 release, and it would be great to include your feature in that release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andreyvelich I should have some spare time tomorrow. Do we do it as you suggested: verify that name and port are correct, otherwise return an error in
DesiredDeployment
method? Or prohibit the DefaultSuggestionPort to be set at all?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fischor Thank you! Let's prohibit to set
DefaultSuggestionPort
for now as @tenzen-y suggested. So we can avoid errors from the user side.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fischor We are planning to cut a release in a day. Do you have any update?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@johnugeorge Thanks for the reminder...you can check the latest commit now.