Skip to content
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

Dependencies not being de-duplicated and deployed multiple times #1845

Closed
bforchhammer opened this issue Jan 6, 2022 · 2 comments · Fixed by #1847
Closed

Dependencies not being de-duplicated and deployed multiple times #1845

bforchhammer opened this issue Jan 6, 2022 · 2 comments · Fixed by #1847
Labels
area/config Issues related to the config kind/bug Something isn't working

Comments

@bforchhammer
Copy link

What happened?

We have some projects which have a lot of dependencies (25+ with transitive dependencies, usually one deployment per dependency), and the initial devspace deploy can take quite a bit of time (ie. a few minutes rather than less than a minute - which is what we had with our docker-compose setup). Once everything is running, devspace dev -x is working great!

Part of this increased spin-up time may be due to this: we seem to sometimes end up with the same dependencies being deployed multiple times... e.g as part of the mentioned dependency graph we have multiple services depending on the same postgres dependency (same git source/branch/vars etc.), but I still see the postgres helm chart being installed/upgraded multiple times in the logs:

❯ devspace update dependencies
[done] √ Pulled git@github.com:bforchhammer/devspace-dependency-example
[done] √ Pulled git@github.com:bforchhammer/devspace-dependency-example
[done] √ Pulled git@github.com:bforchhammer/devspace-dependency-example
[done] √ Successfully updated all dependencies
❯ kubectl delete ns test2
namespace "test2" deleted
❯ helm ls
NAME    NAMESPACE       REVISION        UPDATED STATUS  CHART   APP VERSION
❯ devspace deploy
[info]   Using namespace 'test2'
[info]   Using kube context 'docker-desktop'
[done] √ Created namespace: test2
[info]   Start resolving dependencies
[done] √ Resolved dependencies successfully

[info]   Execute 'helm upgrade postgres --namespace test2 --values /var/folders/xj/7sl84q_16fb61dqplqr193hm0000gp/T/955378123 --install /Users/benedikt.forchhammer/.devspace/component-chart/component-chart-0.8.4.tgz --kube-context docker-desktop'
[done] √ Deployed helm chart (Release revision: 1)
[done] √ Successfully deployed postgres with helm
[done] √ Deploy dependency app.app2.postgres completed
...
[info]   Execute 'helm upgrade postgres --namespace test2 --values /var/folders/xj/7sl84q_16fb61dqplqr193hm0000gp/T/3632472368 --install /Users/benedikt.forchhammer/.devspace/component-chart/component-chart-0.8.4.tgz --kube-context docker-desktop'
[done] √ Deployed helm chart (Release revision: 2)
[done] √ Successfully deployed postgres with helm
[done] √ Deploy dependency app.postgres completed
...
[done] √ Successfully deployed!

❯ helm ls
NAME            NAMESPACE       REVISION        UPDATED                                 STATUS          CHART                   APP VERSION
app             test2           1               2022-01-06 10:36:30.995718 +0100 CET    deployed        component-chart-0.8.4
app2            test2           1               2022-01-06 10:36:27.193464 +0100 CET    deployed        component-chart-0.8.4
postgres        test2           2               2022-01-06 10:36:29.015276 +0100 CET    deployed        component-chart-0.8.4

What did you expect to happen instead?

I expect postgres to only be helm install-ed once, ie. the helm revision for the postgres release should be 1. (The output above is only a simple example, in our case some helm releases seem to be upgraded 10+ times).

How can we reproduce the bug? (as minimally and precisely as possible)

I created an example to reproduce the issue here: https://github.com/bforchhammer/devspace-dependency-example

The addition of the POSTGRES_USER variable to the postgres dependency seems to be what causes the issue (bforchhammer/devspace-dependency-example@0fe3258); without it the postgres helm release is only installed once!

Local Environment:

  • DevSpace Version: 5.18.1
  • Operating System: mac
  • ARCH of the OS: AMD64
    Kubernetes Cluster:
  • Cloud Provider: docker-desktop
  • Kubernetes Version: v1.22.4

Anything else we need to know?

Happy to provide more info if needed :)

/kind bug

@FabianKramm
Copy link
Collaborator

FabianKramm commented Jan 7, 2022

@bforchhammer thanks for creating this issue! Yes you are correct, DevSpace shouldn't deploy the postgres dependency twice. We'll fix that in the next release!

@bforchhammer
Copy link
Author

@FabianKramm Thanks for fixing this and the new release! It's improved the deploy time on some of our projects immensely! 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/config Issues related to the config kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants