Praqma / helmsman

Helm Charts as Code
MIT License
1.39k stars 172 forks source link

plan results and executed actions are not deterministic in v3.0.0-beta3 #354

Closed sami-alajrami closed 4 years ago

sami-alajrami commented 4 years ago

When testing v3.0.0-beta3, one of the releases get skipped. In the output below, consul never get installed:

2019-12-30 17:53:24 NOTICE: -------- PLAN starts here --------------
2019-12-30 17:53:24 NOTICE: Release [ consul ] will be installed in [ dependencies ] namespace -- priority: -10
2019-12-30 17:53:24 NOTICE: Release [ postgres ] will be installed in [ dependencies ] namespace -- priority: -9
2019-12-30 17:53:24 NOTICE: Release [ cassandra ] will be installed in [ dependencies ] namespace -- priority: -8
2019-12-30 17:53:24 NOTICE: Release [ kafka ] will be installed in [ dependencies ] namespace -- priority: -7
2019-12-30 17:53:24 NOTICE: Release [ weavescope ] will be installed in [ kube-system ] namespace -- priority: -6
2019-12-30 17:53:24 NOTICE: -------- PLAN ends here --------------
2019-12-30 17:53:24 INFO: Sorting the commands in the plan based on priorities (order flags) ... 
2019-12-30 17:53:24 INFO: Executing plan... 
2019-12-30 17:53:24 NOTICE: Installing release [ postgres ] in namespace [ dependencies ]

Here is the DSF apps stanza:

...
apps:
    consul:
      namespace: "dependencies" 
      enabled: true 
      chart: "consul-helm" 
      version: "0.10.0" 
      priority: -10
      wait: true
      protected: true
    postgres:
      namespace: "dependencies" 
      enabled: true 
      chart: "stable/postgresql" 
      version: "7.7.2" 
      priority: -9
      wait: true 
      protected: true
      set:
        postgresqlUsername: postgres
        postgresqlPassword: password 
        initdbScriptsConfigMap: db-init
        extraEnv[0].name: POSTGRES_USER
        extraEnv[0].value: postgres
        extraEnv[1].name: POSTGRES_PASSWORD
        extraEnv[1].value: password
        extraEnv[2].name: POSTGRES_DB
        extraEnv[2].value: postgres
    cassandra:
      namespace: "dependencies" 
      enabled: true 
      chart: "bitnami/cassandra" 
      version: "4.1.0" 
      priority: -8
      wait: true 
      protected: true
    kafka:
      namespace: "dependencies" 
      enabled: true 
      chart: "bitnami/kafka" 
      version: "6.0.1" 
      priority: -7
      wait: true 
      protected: true 
    weavescope:
      namespace: kube-system
      enabled: true
      chart: "stable/weave-scope"
      version: "1.1.7"
      priority: -6
      wait: true
      protected: true
      setString:
        global.image.tag: 1.12.0

On the next run, I get the following (2 releases [cassandra and postgres] disappear from the plan):

2019-12-30 18:08:04 NOTICE: -------- PLAN starts here --------------
2019-12-30 18:08:04 NOTICE: Release [ consul ] will be installed in [ dependencies ] namespace -- priority: -10
2019-12-30 18:08:04 INFO: Release [ kafka ] in namespace [ dependencies ] is PROTECTED. Operations are not allowed on this release until you remove its protection. -- priority: -7
2019-12-30 18:08:04 INFO: Release [ weavescope ] in namespace [ kube-system ] is PROTECTED. Operations are not allowed on this release until you remove its protection. -- priority: -6
2019-12-30 18:08:04 NOTICE: -------- PLAN ends here --------------
luisdavim commented 4 years ago

I'll take a look.

luisdavim commented 4 years ago

@sami-alajrami can you try a build from #353 ? I think the lack of mutexes was the issue. Didn't you get the same issue with beta2? The parallelism was added there.

sami-alajrami commented 4 years ago

I haven't tried beta2 but I guess it has the same problem. I will try #353 and get back to you.

sami-alajrami commented 4 years ago

thanks @luisdavim .. I can confirm this is fixed in #353. This issue can be closed once its merged.