-
Notifications
You must be signed in to change notification settings - Fork 921
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
katib: Add per component packages #1141
katib: Add per component packages #1141
Conversation
Can't reproduce the error locally. It would be great if we could get kubeflow/kfctl#264 merged so kfctl returns why it "couldn't generate kustomization file for component katib-controller-standalone" @jlewi: That being said, is this in general how you imaging it? |
Thanks @discordianfish. A couple suggestions
|
2b340f0
to
b4ea4c6
Compare
To support both katib deployment with bundled mysql and external databases, split the katib-controller package into individual components. As suggested by @jlewi, this preserves backwards compatibility by creating new packages that refence the existing manifests.
9b81109
to
46c9044
Compare
This design lgtm /cc @johnugeorge @gaocegege. @jlewi What do you think about katib-crds: https://github.com/kubeflow/manifests/tree/master/katib/katib-crds ? |
@discordianfish Thanks for doing this! |
@jlewi / @andreyvelich Like this? The remaining question is how to test this if it's not referred by any kfdef yet. Should I create a new one? |
app.kubernetes.io/name: katib-controller | ||
app.kubernetes.io/part-of: kubeflow | ||
configurations: | ||
- ../../katib-controller/v3/params.yaml |
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.
Maybe take param.yaml
from here: https://github.com/kubeflow/manifests/blob/master/katib/katib-controller/overlays/istio/params.yaml, since it is not v3 package yet?
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.
Yeah wasn't sure about how to deal with the v3 stuff or not. I've changed it.
- ../../../components/katib-db-manager | ||
patchesStrategicMerge: | ||
- katib-db-manager-deployment.yaml | ||
secretGenerator: |
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 use secretGenerator
or configMapGenerator
, like here https://github.com/kubeflow/manifests/blob/master/katib/katib-controller/base/kustomization.yaml#L18?
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 contains secrets, so I used the secretGenerator. We could use a configmap for everything except the password but I usually prefer keeping everything in a secret in such case.
secretKeyRef: | ||
name: katib-mysql-secrets | ||
key: KATIB_MYSQL_DB_DATABASE | ||
- name: KATIB_MYSQL_DB_HOST |
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.
Also, you can specify KATIB_MYSQL_DB_PORT
, take a look here: https://www.kubeflow.org/docs/components/hyperparameter-tuning/env-variables/#katib-db-manager
valueFrom: | ||
secretKeyRef: | ||
name: katib-mysql-secrets | ||
key: DB_USER |
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 it be DB_PASSWORD
?
valueFrom: | ||
secretKeyRef: | ||
name: katib-mysql-secrets | ||
key: MYSQL_HOST |
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.
Maybe name it KATIB_MYSQL_DB_HOST
to be consistent?
@andreyvelich ok, addressed your comments. Any thoughts about tests? |
Just my oppinion so take it or leave it but I might suggest that instead of doing base and overlays in installs structure it as
Nesting things in "/base" and "/overlays" just seems like it makes things harder to find. Just my 2 cents though. For the tests add to search-dirs The directory whose kustomizations you want to test. So in this case that's probably the "installs" directory or just specific subdirectories. The test will generate and check in the expected YAML. This way during PR review inspecting the diff of the expected output will tell the reviewer whether anything changed. |
As requested, this PR doesn't move any existing manifests, so I don't think there is any TODO for the crds. Beside that @jlewi already said it looks good from his POV. It would be great if we could minimalize the back and forth where possible, given we're all in different timezones. |
@discordianfish Alright, overall /lgtm. |
/lgtm |
/approved Thanks @discordianfish! @andreyvelich could you please create an OWNERs file under /katib so you can approve changes? |
/lgtm |
@jlewi I've just tried to test this on our cluster (by using this branch and katib-controller's repoRef/path set to
I believe that's because kfctl's "unrolling" of the manifests. Not sure about the specifics but it copies the manifests from the source to /etc/kubeflow/manifests and flattens the structure, so if I specify |
I think that can be because of kfctl design. @jlewi Will we use this structure for kfctl in current version or we will use it only for v3 version? |
/approve @discordianfish and @andreyvelich I added logic to short circuit the logic in kfctl to create kustomize files. I think there are two cases we want to support
In particular, I don't think we want to mix the two; i.e. use a mix of kustomize packages. The logic to decide which mode to use is defined here Its a bit of a hack. We look for an application with a specific name. This is intended to be a "stack" which is a kustomize package which combines all the kustomize applications you want to install. And associated KFDef. So we would add the katib package to the stack kustomization.yaml and not to the KFDef. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jlewi The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Thank you for your clarification @jlewi, I agree with this approach. |
@jlewi So to use this, I need to migrate my kfdef to a stacks manifest? In general, I agree that this is better than having this custom kfdef but it's not trivial to migrate this. To migrate to this, I'd like to generate all manifests both from the existing kfdef and from a new stack manifests. I assume for the new stack based approach I can just run |
This reverts commit e172590.
@discordianfish looks like we are going to have to roll this back because of test breakages. #1159 is tracking rolling it forward.
I guess that depends on your KFDef. There's an example KFDef for stacks here I wouldn't expect that to be too different from other KFDefs (E.g. just remove the GCP plugin).
Not quite. kfctl build is still creating the kustomization packages and not actually hydrating the manifests. We don't currently have a command to recourse of all the directories in "${KFAPP}/kustomize". Or you could try running
I think that will create a kustomization.yaml file that combines all the subdirectories but I haven't tried it. I didn't go that route because
|
This was reverted in a03973b due to test failures. This re-introduces the packages with the issues fixed. See kubeflow#1141 for more context.
Description of your changes:
katib: Add per component packages
To support both katib deployment with bundled mysql and external
databases, split the katib-controller package into individual components.
As suggested by @jlewi, this preserves backwards compatibility by
creating new packages that reference the existing manifests
Checklist:
cd manifests/tests
make generate-changed-only
make test