-
Notifications
You must be signed in to change notification settings - Fork 486
More container fields for SuggestionConfig #2000
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
Merged
google-oss-prow
merged 7 commits into
kubeflow:master
from
fischor:issue-1737-more-fields-in-suggestion-config
Jan 25, 2023
Merged
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c6f87bd
More container fields for SuggestionConfig
fischor 427f115
Inline corev1.Container into SuggestionConfig
fischor 7f1b284
Set default value for suggestion container name
fischor 5410bdc
Append suggestion volume and port only if not present
fischor 92d0471
Deep-Copy base suggestion container
fischor caa08c8
Check for suggestion container port number as well
fischor 6cc917e
Prohibit suggestion port to be set in suggestion config
fischor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 we need
VolumeMountPath
if that is part of Container parameters:katib/pkg/controller.v1beta1/suggestion/composer/composer.go
Line 237 in 7f1b284
Uh oh!
There was an error while loading. Please reload this page.
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.
The current Katib
SuggestionConfig
has a JSON fieldvolumeMountPath
thats just a filepath, thecorev1.Container
has a json fieldvolumeMounts
thats an array of volume mounts. SovolumeMountPath
is not part if the container fields. I think in order to not break anything, we need it.The referenced snippet kind of follows the logic:
In case the
volumeMounts
are set we prefer that, otherwise mount the default suggestion volume under the specificedvolumeMountPath
.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.
I see, that is because we set the default value name for Suggestion Volume. Please can you leave comment that we should refactor
VolumeMountPath
parameter once we allow to set Deployment spec in our Suggestion config ?Also, I think we should modify
len(suggestionContainer.VolumeMounts) == 0
check.We always should append
VolumeMount
if ResumePolicy isFromVolume
.WDYT @fischor ?
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 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
Would you also change that to always append the default port?
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
I think that should work, but we need to make sure that volume and port name/number is correct (
ContainerSuggestionVolumeName
andDefaultSuggestionPortName
/DefaultSuggestionPort
).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 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.