syntasso / kratix-docs

1 stars 8 forks source link

feat: workshop improvements #128

Closed kirederik closed 2 weeks ago

kirederik commented 1 month ago

After running the workshop a few times in recent weeks, I found a few places where we could improve/simplify the learner's journey.

Using Compound Promises:

Too much happens at once

Outdated compound promise

Writing a Promise

Inline dependencies

Improving the Workflows

Unclear goal, complex section

Surfacing information via status

createdAt adds little value

Across sections

Can't run the pipeline script locally

shano commented 1 month ago
  1. On using Compound Promises - 100% agree, getting it spun up and the reasoning about the system as it sets itself up seems like a more natural flow, can we capture the commands explicitly to "see" the system progressing/working as expected.
  2. On writing Compound Promises - 100% agree, when I went through the workshop I felt the same confusion. It felt arbitrary I'm being shown two ways to do a thing., it then "felt" but wasn't explicitly called out that pipelines are the recommended way to do things as it's much more flexible but showing me multiple options while I'm still trying to understand everything seems strange.
  3. Improving Workflows - It would be good to know the objective of these docs, it is to get into a platform engineering loop? So make changes, deploy changes, see the changes in action? If so, there's perhaps a simple example to get a person quickly iterating on changes to get a feel for what this process is like.
  4. Surfacing info - Agreed, it's long for what it's trying to convey. This feels beyond an intro workshop and are more later stage optimisations engineers would naturally want to do and would hit docs.

Overall, very much in favour of these changes!

richcooper95 commented 1 month ago

Using Compound Promises:

Too much happens at once

Agree with the changes to explain the underlying flow after showing things working. I think we have a nice diagram somewhere (maybe in the workshop slides) for how this flow looks?

Outdated compound promise

Agree that requiredPromises does simplify the workshop by only showing one way of doing things, but just to call out that we'll need to also touch on Promise Releases earlier in the workshop if we go for this approach (since requiredPromises are versioned).

Writing a Promise

Inline dependencies

Agree that we should only add dependencies via Pipelines. Though the fact that we're not mentioning the dependencies key at all in the workshop does bring up the age-old question of whether we should remove the dependencies key altogether from Promises. If we're not removing it now, maybe we could just have a callout saying "for simple cases/small dependencies, you can use the dependencies key..."?

Improving the Workflows

Unclear goal, complex section

I've seen this section be well-received in workshops, so I'm reluctant to remove it altogether. That said, we could specify the goal more clearly (e.g. demonstrating composability and testability of Pipeline container images), and perhaps also introduce a real "test" to ./scripts/test-pipeline where we check the dependencies exist?

(I also like the idea of moving/copying some info about workflow best practices to the Kratix docs!)

Surfacing information via status

createdAt adds little value

I think we could keep this too, since it touches on (a) a concrete example of idempotency, and (b) the ability to read the status from the /kratix/input/object.yaml. It's a quick section and IMO it's useful to concretely demo these things!

Across sections

Can't run the pipeline script locally

I like this goal, though I'm not quite sure what you mean on implementation!

kirederik commented 1 month ago

@shano [on Improving Workflows ] It would be good to know the objective of these docs, it is to get into a platform engineering loop? So make changes, deploy changes, see the changes in action? If so, there's perhaps a simple example to get a person quickly iterating on changes to get a feel for what this process is like. @richcooper95 [on Improving the Workflows] I've seen this section be well-received in workshops, so I'm reluctant to remove it altogether.

Yeah, see the comment above

We originally wanted to introduce the "TDDing your Promise" concept, but it got mixed with moving the dependencies into the pipeline at the same time. Maybe moving the deps to a pipeline directly will clear this up of this "second thing we are trying to achieve" and makes it more on point...

@richcooper95 [on surfacing information] I think we could keep this too, since it touches on (a) a concrete example of idempotency, and (b) the ability to read the status from the /kratix/input/object.yaml. It's a quick section and IMO it's useful to concretely demo these things!

Yeah, there's value in the "reading from status" but, to me, it feels like a secondary concern to "surfacing information" (hence my suggestion of adding it as an extra challenge).

@richcooper95 [on running pipelines locally] I like this goal, though I'm not quite sure what you mean on implementation!

You can do things like:

#!/usr/bin/env bash

input_object="${1:/kratix/input/object.yaml}"
output_dir="${2:/kratix/output}"

name="$(yq .metadata.name "${input_object}")"

kubectl create deployment "${name}" \
  --image nginx \
  --dry-run=client -o yaml > ${output_dir}/deployment.yaml

So now you can run locally by:

$> ./pipeline.sh test-object.yaml /tmp/
ChunyiLyu commented 1 month ago

Briefly picked this up end of Oct 17. Small WIP that moves the "platform as a worker" setup (including the label) to the part-0/02-create-clusters pushed to https://github.com/syntasso/kratix-docs/pull/133

kirederik commented 2 weeks ago

closing this one since it's marked as completed 👀