syntasso / kratix

Kratix is an open-source framework for building platforms
https://kratix.io
Apache License 2.0
482 stars 30 forks source link

Feat: Provide support for multiple configure workflows #90

Closed SaphMB closed 7 months ago

SaphMB commented 8 months ago

At present, Promise writers can only write a single configure workflow for their Promise or Resource Request. The workflows.configure key already takes a list of Pipelines to execute but at present, Kratix only selects the first one and executes it.

Expectation: The Pipelines run in the order they are specified

Given a Promise or Resource Request has the following specification:

workflows:
    resource/promise:
      configure:
      - apiVersion: platform.kratix.io/v1alpha1
        kind: Pipeline
        metadata:
          name: configure-a
          namespace: default
        spec:
          containers:
          - image: ghcr.io/syntasso/kratix-marketplace/a-configure-pipeline:v0.1.0
            name: configure-a-pipeline
      - apiVersion: platform.kratix.io/v1alpha1
        kind: Pipeline
        metadata:
          name: configure-b
          namespace: default
        spec:
          containers:
          - image: ghcr.io/syntasso/kratix-marketplace/b-configure-pipeline:v0.1.0
            name: configure-b-pipeline

When the Configure Workflow runs, the configure-a Pipeline will run and upon it's completion (as indicated by the status), the configure-b Pipeline will run.

Expectation: The Pipelines infer completion from the Pipeline status

Given the above Configure Workflow When configure-a runs, configure-b will identify that it has completed via the Pipeline status

aclevername commented 8 months ago

Once finishd lets look into replace all references to kratix-promise-id to kratix.io/promise-name

aclevername commented 8 months ago

We are changing the behaviour so that only scheduling specified in the promise.yaml is applied to both the promise and resource requests. Dynamic scheduling within the promise configure workflow is not also passed onto the resource configure workflow.

aclevername commented 8 months ago

main branch is multiple-workflows, which ATM just contains the nice commit for https://github.com/syntasso/kratix-docs/issues/51. There is another WIP branch based from this branch with a dirty commit history that contains the next steps of implementing multiple workflows https://github.com/syntasso/kratix/tree/multiple-workflows-for-reals

aclevername commented 8 months ago

WIP Task:

richcooper95 commented 8 months ago

Context dump for Monday...

Where we stand today

TODO

kirederik commented 8 months ago

Promise Workflow

kirederik commented 8 months ago

Resources

SaphMB commented 7 months ago

Implementation complete with system tests updated and passing. Remaining task:

richcooper95 commented 7 months ago

Docs PR here: https://github.com/syntasso/kratix-docs/pull/47