microsoft / bedrock

Automation for Production Kubernetes Clusters with a GitOps Workflow
MIT License
129 stars 12 forks source link

Map different ring names to git branches #1313

Open bnookala opened 4 years ago

bnookala commented 4 years ago

As a:

SPK User

I want:

To map different ring names to git branches

So that:

My ring names don't have to be the same as the git branch names

Describe the solution you'd like:

Perhaps some sort of mapping in bedrock.yaml that allows a ring name to target a git branch name, allowing a user to specify a git branch to use for a ring ie

rings:
  prod:
    targetBranch: "master"
  develop:
    targetBranch: "develop"
  qa:
    targetBranch: "test"
etc.

Though perhaps the ideal schema should be inverted to be branch name as the key, and the target ring name as the value ie - we should spend some time figuring out what makes sense here

rings:
  master:
    targetRing "prod" 
  develop:
    targetRing: "develop"
  test:
    targetRing: "qa"

Acceptance Criteria:

Describe alternatives you've considered:

This is a preliminary investigation into how we might map different rings to branches - there may exist other methods of solving this.

Additional context:

Customer request

Does this require updates to documentation?:

Yes

andrebriggs commented 4 years ago

@samiyaakhtar if the branch name is now different from the ring name you would need to look at bedrock.yaml to retrieve

@bnookala @evanlouie The customer said this is low priority. I think so too at the moment so we can take our time to think about this. I would put other refactoring and testing ahead of this.

samiyaakhtar commented 4 years ago

@evanlouie @andrebriggs Just created https://github.com/microsoft/bedrock/issues/1396 as a follow up task

evanlouie commented 4 years ago

After deeper investigation and attempts at a not too intrusive solution, I believe this cannot be completed without very heavy refactoring of the service build-update pipeline.

Looking for feedback to see if this feature is worth such refactoring.

Notes on what would need to be done captured in: https://github.com/microsoft/bedrock-cli/pull/36

Problems: The build-update pipeline has no way to map its trigger branch back to a ring. It doesn't know which directory it needs to cd into prior to calling fab set to update the image tag. Multiple rings can map to the same branch. Meaning that the build-update pipeline would need to be able to update multiple rings -- requiring parsing of bedrock.yaml. To get around this problems, we would need to the ability to parse the bedrock.yaml file in the build-update pipeline. To do so, we would need to implement a pseudo hld reconcile-like function which would be called in the pipeline -- meaning the build-update pipeline would require the bedrock-cli as well (just like the lifecycle pipeline).

I'm leaning towards such refactoring and increase in complexity of the pipeline not being worth the feature -- @andrebriggs @bnookala @mtarng

evanlouie commented 4 years ago

Putting this back in the backlog it becomes a higher priority. Requires deeper design review to come up with solution to address whats mentioned above