-
Notifications
You must be signed in to change notification settings - Fork 138
Name the .cache and kustomize directories based on the KFDef name #242
Comments
Issue-Label Bot is automatically applying the labels:
Please mark this comment with 👍 or 👎 to give our bot feedback! |
.cache
and kustomize
directories base don the KFDef name
@vpavlin say if we change the path from |
Hmm..now that I read my description, it really does not make much sense. Sorry for this. IIRC I came across this issue when I submitted a KFDef names And I combined this problem with potentially another issue where we want to submit 2 KFdefs - in case, in the future, we have the ability to enable components on namespace scope. So I would now say that there is this issue in the name - path to .cache and kustomize should be based on the resource name and then there is issue where the cache needs to be updated when the KFDef resource is updated by a user. What do you think? |
@vpavlin yes, I agree in a case when the kubeflow supports multiple instances within a namespace or a cluster (note that current operator is a cluster scoped). And based on just resource name may be solving the update partially. We can have a PR to append the KfDef name as I think it is a right thing. I also agree the bigger problem is when the configuration of a certain component gets changed, but the KfDef name remains the same. Because the kustomization regeneration is bypassed, even though the KfDef resource itself is updated, the real kubeflow deployment remains the same. Let the operator code always generate the kustomization directories and files may work for adding additional components. But what if a component is removed from the current KfDef resource? Still thinking how to handle these cases and whether the operator should have the similar behavior as command line deployment. |
My approach would be:
This way any new KFDef or update would force manifest regeneration and timed reconciliation would run from well known cache. WDYT @adrian555 |
/area kfctl |
Hey! Any progress here? |
Thanks @vpavlin for checking back. I am still working on this. Basically only when an update is detected to a KfDef will the existing cache be used, otherwise we will generate a new directory and cache for a new KfDef. |
@adrian555 we are bumping into this with our new ODH 0.6 operator see issue (opendatahub-io/opendatahub-operator#9)
|
@nakfour yes, this is expected problem with the current implementation as already mentioned in some previous comments. Therefore, we need to have different directory for each kfdef instance. |
Thanks @adrian555, it's good to know this is still on your radar:)
So what happens if the update is a new component added into the KFDef? I believe that would fail unless the kustomize dir is regenerated. |
@adrian555 I am not clear why we need to keep different kustomize folders. What are they used for? From an operator perspective, users create instances of APIs and they delete them. I don't see a need to keep the kustomize folder since I don't see a Users pattern of re-installing the same API instance over and over again. According to this issue: kubeflow/kubeflow#4368 the folder kustomize is kept to allow users to insert data into it, which is not the case with operators. |
@adrian555 there is also one use case to add, users might edit the instance yaml and change it, but this still requires a new generated Kustomize folder. |
yes @vpavlin for new application added to kfdef the cache and kustomize will be regenerated/synced. I am hoping I do not need to wipe out the whole directory, but it may come down to that approach to remove the whole directory and recreate. |
@adrian555 it still not clear to me. Your sentence "each instance will have a directory of different name. This is to support the use case you mentioned (name A and name B coexist)." What does support mean?? You can have name A and name B coexisting if you just wipe out the kustomize folder on each install. It is not clear to me why the kustomize folder is needed??? |
@nakfour the |
@adrian555 If you can provide even WIP PR, we'd be happy to test and document the potential cases. There are probably 2 seperate problems .cache - if something changes in a manifest repository, cache needs to be updated And that is the case for both apply or update, obviously delete should just clean everything The cache case could be solved by some checksums being verified if we want to avoid deleting it every time But as soon as we update the cache, we need to clean up kustomize as well, to prevent stale generated manifests The kustomize case basically means that if KFDef changes in any way, the kustomize dir needs to be regenerated, otherwise we wouldn't work with correct manifests. So the simplest (lame) solution really is to run from clean cache and kustomize every time any event is triggered. More complicated (smarter) solution is to track the manifest source and make sure the cache not outdated and make sure each change in cache or KFdef regenerates kustomize - but I am not sure if this is worth the potential implementation pain. |
@adrian555 when is the |
@adrian555 Thanks for the fix, closing the issue! |
Issue-Label Bot is automatically applying the labels:
Please mark this comment with 👍 or 👎 to give our bot feedback! |
1 similar comment
Issue-Label Bot is automatically applying the labels:
Please mark this comment with 👍 or 👎 to give our bot feedback! |
Currently Kubeflow operator will use
/tmp/.cache
and/tmp/kustomize
to store the downloaded and generated manifests.These directories should be ideally based on the KFDef resource name, since once the
/tmp/kustomize
exists, operator will skip thekustomize.Generate
step:Imagine a scenario where:
A user submits KFDef
Realizes he needs to add another manifests repo to the list
Adds the manifests repository and runs
kubectl apply -f
Operator fails with
because it did not update the
/tmp/kustomize
There are probably other scenarios - like someone adding a resource to KF manifests and the operator ignoring it, but I guess for development it is ok to just fall back to
kfctl
directlyThe text was updated successfully, but these errors were encountered: