Add an option which builds recursively the dependent charts#4468
Add an option which builds recursively the dependent charts#4468ccojocar wants to merge 6 commits intohelm:masterfrom
Conversation
|
Hey @ccojocar. Thanks for the PR! I'll try to take a look at this tomorrow |
|
Is there something I can do to help this PR make it into 2.11.0 ? I was going to implement this feature when I found the PR. Thanks @ccojocar 👍 Maybe adding some information about this feature on Complex Charts with Many Dependencies section might be useful for others looking into this kind of charts that might need recursive builds. |
|
Tested and worked like a charm. Thanks @ccojocar |
thomastaylor312
left a comment
There was a problem hiding this comment.
The logic here is looking pretty good! I just have one concern about a breaking change of the API
pkg/downloader/manager.go
Outdated
| // | ||
| // If SkipUpdate is set, this will not update the repository. | ||
| func (m *Manager) Build() error { | ||
| func (m *Manager) Build() ([]*chartutil.Dependency, error) { |
There was a problem hiding this comment.
This is breaking a publicly exposed API. Anyway you can change this to avoid the breaking change?
| return err | ||
| } | ||
|
|
||
| m.SkipUpdate = true |
There was a problem hiding this comment.
Nit: I would recommend adding a comment here for anyone else who edits this code in the future about why SkipUpdate is set to true
There was a problem hiding this comment.
I would also set SkipUpdate back to its original value at the end of this function. I am afraid of weird side effects down the road
|
@thomastaylor312 Thanks for review! I addressed all the issues. Please have a look again. Thanks |
|
@ccojocar So I was doing some manual validation on this and it wouldn't work for me. I used the nginx chart found in dependencies:
- name: redis
version: "3.6.4"
repository: "@stable"
- name: alpine
version: "0.1.0"
repository: "file://../alpine"This includes the alpine chart from the same directory, where I had also added a requirements file with a chart from the stable repo. This failed with the following output: It looks like the |
8be3d43 to
1904353
Compare
@thomastaylor312 Thanks for catching the issue. It is fixed now. The dependencies are also resolved for charts which are downloaded from a local repository. |
1904353 to
d15db06
Compare
|
/check-cla |
|
I think I found a bug, but I'm not completely sure. I have a complex chart, with a dependency that i want to disable. Although my subchart:
values: …
subsubchart:
enabled: falseI'm happy to share more details if you think this might be a bug. |
|
After doing a I also notice that the lockfile only shows child dependencies but not subchart dependencies. Is that intentional? |
| dep.Version = ver | ||
| if m.Recursive { | ||
| fmt.Fprintln(m.Out, "Unpacking:", archiveFile) | ||
| err := chartutil.ExpandFile(destPath, archiveFile) |
There was a problem hiding this comment.
this is probably where we'd want to os.Remove the archiveFile here.
This actually poses another interesting design question though: if the design of helm dep build is to store the tarballed charts in charts/, wouldn't the user also expect the same from helm dep build --recursive? If so, would it be convenient if we parsed the tree, but laid it out as a flat file structure like
><> ls -p charts/
alpine-0.1.0.tgz
wordpress-2.1.0.tgz
mariadb-4.3.1.tgz
That way, it'd be simpler overall to manage these resources in the umbrella chart, as you could reference mariadb configuration as --set mariadb.foo=bar. It would also mean that there's only one version of any given chart as part of the dependency tree rather than subtree A installing mariadb 4.3.1 and subtree B installing mariadb 4.4.0.
What do you think?
There was a problem hiding this comment.
I think, it's a good idea to flatten the tree but then there is the limitation which you just described.
Maybe after building the tree, it can be traversed again to delete all the source files and just keep the Charts with the archive files. Something like:
alpine-0.1.0.tgz
charts/
wordpress-2.1.0.tgz
mariadb-4.3.1.tgz
|
due to ongoing discussion/design questions around this feature, we're going to bump this off the 2.11 milestone. |
You were right about that @bacongobbler ! thanks for the tip |
@bacongobbler It's not. Isn't enough to have the first level of dependencies in the lockfile? They will have their own lockfile anyhow. I don't think, it would make a difference to keep the entire dependency tree in the lockfile. |
|
@ccojocar @thomastaylor312 a friendly ping to don't let this stale. May I help somehow, please let me know. |
|
@thomastaylor312 @merqurio @bacongobbler Please could you clarify which issue is preventing to get this merged? Thanks |
5790469 to
a99adb5
Compare
|
@bacongobbler @thomastaylor312 I pushed a fix to keep only the packed dependencies in the charts folder as suggested in your comment. Also now the dependencies tree is flatten. The lock file right now keeps track only of the child dependencies. Should we add the entire dependencies tree? I think, this is not really required because they can be deduced when traversing the tree starting from the first dependencies level, if each of these dependencies has a lock file. |
Yes. The entire point of a lockfile is to lock down what the package manager determined as the right dependency tree at a particular point in time. In our case, it was the last time the user ran An example use case: Chart A has a lockfile that depends on Charts B and C. When I call Therefore, once you call |
Signed-off-by: Cosmin Cojocar <cosmin.cojocar@gmx.ch>
…he recursive build and also add some comments Signed-off-by: Cosmin Cojocar <cosmin.cojocar@gmx.ch>
Signed-off-by: Cosmin Cojocar <cosmin.cojocar@gmx.ch>
Signed-off-by: Cosmin Cojocar <cosmin.cojocar@gmx.ch>
… dependencies tree Signed-off-by: Cosmin Cojocar <cosmin.cojocar@gmx.ch>
Signed-off-by: Cosmin Cojocar <cosmin.cojocar@gmx.ch>
a99adb5 to
5ff384b
Compare
|
It looks like @thomastaylor312 had requested changes - are these now resolved and can this be released for the community to use? Thank you all for your efforts with this! |
@bacongobbler After looking at the install code, I am a bit confused. It seems that only I think, the entire dependency tree has to be also updated in the The current implementation is downloading all charts from dependency tree, without reflecting this flatten hierarchy in the requirements file. What is your opinion on this? |
|
Any updates? Really must-have feature. |
|
I am wait for feedback to be able to rework the PR. |
|
Closing this due to lack of feedback from Helm's maintainers. It seems to be stuck in this state since quite a long time. Thanks |
|
@bacongobbler @thomastaylor312 @merqurio |
|
Waiting for this too... The workaround to manually(or to automate) |
|
Prod, can we bring this back to life and consider it or at least get a reason why it can't be merged? |
|
Adding interest on this issue, is there a change it might actually be merged? |
This is based on PR #2278.
The recursive build is now implemented iteratively and also some tests are added.
It was also tested manually on a more complex chart https://github.com/ccojocar/environment-scalewalnut-staging/tree/master/env.
fixes #2247
cc @jstrachan