devspace-sh / devspace

DevSpace - The Fastest Developer Tool for Kubernetes ⚡ Automate your deployment workflow with DevSpace and develop software directly inside Kubernetes.
https://devspace.sh
Apache License 2.0
4.37k stars 361 forks source link

devspace deploy stuck waiting for dependency due to circular dependency #2480

Closed Andrioden closed 1 year ago

Andrioden commented 1 year ago

What happened?

A complex dependency chain is stucking devspace deploy. Running devspace deploy --sequential-dependencies works. My guess is your dependency resolving code has a bug.

What did you expect to happen instead?

Everything is deployed in any order devspace chooses. We dont care about the order, just that i happens.

How can we reproduce the bug?

We have a rather complex dependency hierarchy, i will try my best to simplify it. We have multiple code repos, which depend on each other through their respective devspace.yaml files.

Files

name: hn-oppsett

# no dependencies
...
name: hn-configuration

dependencies:
  hn-oppsett:
  hn-sts:
...
name: hn-sts

dependencies:
  hn-oppsett:
  hn-configuration:
  hn-personvern:
...
name: hn-personvern

dependencies:
  hn-oppsett:
  hn-configuration: # <- If i remove this dependency it works
  hn-sts:
...

I run devspace deploy in the context of hn-personvern:

PS C:\...\HN-Personvern> devspace deploy
info Using namespace 'dev'
info Using kube context 'kind-kind'
hn-configuration Skipping dependency hn-oppsett as it was already deployed
hn-sts Skipping dependency hn-configuration as it was already deployed
hn-sts Waiting for dependency 'hn-configuration' to finish...                        # <- Problem1
hn-configuration Waiting for dependency 'hn-oppsett' to finish...
hn-oppsett <do a lot of custom powershell/bash stuff>
hn-oppsett <do pullsecret stuff>
hn-oppsett <deploys a lot of stuff>
hn-configuration Skipping dependency hn-sts as it was already deployed
hn-configuration Waiting for dependency 'hn-sts' to finish...                        # <- Problem2 waiting for Problem1

Local Environment:

Anything else we need to know?

the devspace deploy flag --sequential-dependencies is not documented here, i found it watching your release notes. I suggest you update the docs.

Andrioden commented 1 year ago

For similar dependency hierarchies (not the one above), changing the order to having hn-sts last also solves the problem.

FabianKramm commented 1 year ago

Hello @Andrioden ! Thanks for reporting this issue, we fixed the problem with PR #2492 and this will be released in the next patch release for DevSpace