Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a Quickstart to run a Tekton task with Minikube #298

Merged
merged 1 commit into from
Apr 13, 2022

Conversation

geriom
Copy link
Contributor

@geriom geriom commented Sep 24, 2021

Changes

Introductory guide friendly for newcomers. The approach in this doc is to be
easier to follow by providing prescriptive instructions about the tools
to use. After installing the prerequisites, doing copy/paste of the code
samples should work.

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide
for more details.

@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 24, 2021
@geriom geriom changed the title Crete a Quickstart to run a Tekton task with Kind Create a Quickstart to run a Tekton task with Kind Sep 24, 2021
@jjasghar
Copy link
Member

Taking a look today, give me a bit of time to read over this.

@jjasghar
Copy link
Member

My only question, is this to show off Tekton inside of KiND? Otherwise I'm not seeing the advantage of this over https://tekton.dev/docs/getting-started/pipelines/

Copy link
Collaborator

@bobcatfish bobcatfish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool!! I was able to run through it myself so easily (i might be not quite the target audience tho haha - BUT ive never really used KIND before so that was pretty cool for me!)

Couple of thoughts:

  • This is kind of a nit but I'm wondering if we want to have this repo as the source of truth for this quickstart - it seems like it's only using Tekton Pipelines, would it make sense to store it (and potentially version and update it) alongside the Tekton Pipelines docs? (maybe it could even replace the tutorial over there?)
  • What do you think about updating or maybe replacing the existing getting started landing page? (https://tekton.dev/docs/getting-started/) (seems like this kind tutorial would be a good replacement?)


## Create and run a basic Task

A **Taks** defines a series of **steps** that run sequentially to perform some
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo taks -> task

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

command:
- echo
args:
- "Hello World"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's something odd about the indentation here - i think it's way to deep (2 spaces would probably be good, or 4 at most?) and it shows up as red in the preview 🤔

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these were tabs instead of spaces (?). This looked fine on my computer :). I made sure they were converted to spaces, I think it's fixed now.

spec:
taskRef:
name: echo-hello-world
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably makes sense to use TaskRuns explicitly but just so you know there's one other option that might be a nice user experience - but the user would have to also install tkn (https://github.com/tektoncd/cli) so maybe it's not worth the extra setup - but if it wasn't too much trouble, instead of making a TaskRun here the user could do tkn task start echo-hello-world

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about it, same to check the task status. The trade-off of using a simpler command but having to install something extra, if this is your first ever experience with tekton, may not be worth it in my opinion. For the longer tutorial covering pipelines in more detail it's definitely a good idea to ask for the tkn client prerequisite.

...
</pre>

The line `Status: Succeeded` confirms that TaskRun completed with no errors.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of showing them the pod, it might be a bit nicer to show them the taskrun, e.g. kubectl --context kind-tektoncd get taskrun echo-hello-world-task-run would show something simple like:

NAME                               SUCCEEDED    REASON       STARTTIME   COMPLETIONTIME
echo-hello-world-task-run          True         Succeeded    22h         22h

plus the pods are (kind of) an implementation detail of tekton anyway 🤞 (tho in reality is not like ppl can really ignore them...)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@bobcatfish
Copy link
Collaborator

@jjasghar i think what's really nice about using kind is that it's very easy to setup and lets us have getting started instructions that are pretty cloud agnostic (but still tell you how to setup the cluster in the first place!)

my understanding is that this tutorial would replace at least 1 (if not more - we have some duplication going on) of our existing tutorials. the one you linked to (https://tekton.dev/docs/getting-started/pipelines/) i think is meant to build on a previous task based tutorial and add pipelines? (presumably it would work on the kind cluster as well? maybe needs a few updates to flow nicely from the kind tutorial). i think this tutorial would probably replace https://tekton.dev/docs/getting-started/ (maybe we go back to our old approach and have a tab or something for the openshift specific instructions?)

@bobcatfish bobcatfish self-assigned this Sep 24, 2021
@geriom
Copy link
Contributor Author

geriom commented Sep 27, 2021

@jjasghar This is intended to be the very first Tekton doc for someone with no prior experience. A 5-minute task that is easy to complete so you get that "feels good" moment that you need to explore further. That's why it's prescriptive about Kind, it's an effort to guarantee the task can be completed successfully with minimal effort. The existing getting started requires some cognitive work to follow.

@bobcatfish You are correct, my intention is to consolidate the doc in the pipelines repo (https://github.com/tektoncd/pipeline/blob/main/docs/tutorial.md), the 2 getting started docs from tekton.dev (getting-started and getting-started/pipelines), and the Katacoda tuto (https://github.com/tektoncd/website/tree/main/tutorials/katacoda/getting-started) in to a single doc that we can link from everywhere. The quickstart in his PR being the entry point and a further more in-depth doc as the natural follow-up.

I'm going to take a look at the other comments and apply the fixes later this week. Thanks for the feedback.

@afrittoli
Copy link
Member

Thanks @geriom - I haven't reviewed the instructions in details yet - but I definitely support using kind - that's what I use for my development work and POCs anyways. We have a script for that so perhaps we could include a link to it? https://github.com/tektoncd/plumbing/blob/main/hack/tekton_in_kind.sh

@geriom
Copy link
Contributor Author

geriom commented Oct 4, 2021

  • This is kind of a nit but I'm wondering if we want to have this repo as the source of truth for this quickstart - it seems like it's only using Tekton Pipelines, would it make sense to store it (and potentially version and update it) alongside the Tekton Pipelines docs? (maybe it could even replace the tutorial over there?)

If we move it to that repo it would be harder to make it a landing page because of how the sync script works.

  • What do you think about updating or maybe replacing the existing getting started landing page? (https://tekton.dev/docs/getting-started/) (seems like this kind tutorial would be a good replacement?)

I like the idea. Should I proceed and move the current content to a different file?

@bobcatfish
Copy link
Collaborator

If we move it to that repo it would be harder to make it a landing page because of how the sync script works.

😨 well maybe in the meantime we could link directly to the page on tekton.dev from the pipelines repo :S

Should I proceed and move the current content to a different file?

I'd remove the existing file entirely - in the end I think our docs at tekton.dev should be pretty authorative vs. kind of a grab bag of different tutorials. The tutorial will also still be in version control if someone wants to resurrect it later.

@bobcatfish bobcatfish closed this Oct 6, 2021
@bobcatfish
Copy link
Collaborator

... did not mean to hit that button

@bobcatfish bobcatfish reopened this Oct 6, 2021
@bobcatfish
Copy link
Collaborator

TOO MUCH POWER

@bobcatfish
Copy link
Collaborator

/approve

also going to ping @jjasghar and @afrittoli to make sure they have no objections

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 12, 2021
@geriom
Copy link
Contributor Author

geriom commented Oct 12, 2021

Thanks @geriom - I haven't reviewed the instructions in details yet - but I definitely support using kind - that's what I use for my development work and POCs anyways. We have a script for that so perhaps we could include a link to it? https://github.com/tektoncd/plumbing/blob/main/hack/tekton_in_kind.sh

That's very cool! I will add this to the longer tutorial as a quick way to set everything up.

Copy link
Member

@afrittoli afrittoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this.

The quickstart looks fine, but it overlaps with the existing "getting started" home page quite a bit. So we would have two pages giving slightly different version of the same basic information:

  • install kind
  • installed tekton via the release file and wait for completion
  • install a task and run it

Can we converge the two pages into one? Could we change this PR into updating the existing page instead of adding a new one?

The existing one includes out of date versions of k8s which needs to be updated.

If you'd like to keep the page simple, we could replace the "persistent volumes" section with a link to https://tekton.dev/docs/pipelines/install/ for details info about configuring Tekton.

The info about installing the CLI, while valuable, is duplicated from https://tekton.dev/docs/cli/, so we could include a link to that instead.

@geriom
Copy link
Contributor Author

geriom commented Oct 20, 2021

Can we converge the two pages into one? Could we change this PR into updating the existing page instead of adding a new one?

I already thought about this for some time, I have a couple of ideas. I will write a draft and update the PR in the next couple of days so you can take a look.

Thanks for the feedback.

@afrittoli
Copy link
Member

/hold

@tekton-robot tekton-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 17, 2021
@afrittoli
Copy link
Member

Waiting for the doc plan to be agreed on, then we can resume this one and get it merged

@tekton-robot tekton-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 9, 2022
@geriom
Copy link
Contributor Author

geriom commented Feb 9, 2022

@afrittoli This PR is ready to be merged after a a second round of reviews.

Updates:

I switched from Kind to Minikube because of the recent changes in the Docker licence. With Minikube the users can pick a different engine and are not forced to use docker to follow the instructions.

I also added a second page, this is now a two-part tutorial, somewhat mirroring the content we had before:

  • Create a task
  • Create a second task and a pipeline.

I also deleted the original tutorial that we had in _index and made it a simple landing page.

@AlanGreene
Copy link
Member

Looks like this removes reference to the nightly releases. It would be good to restore that as we do want to make them more visible. Ref: #344 (comment)

@geriom
Copy link
Contributor Author

geriom commented Feb 14, 2022

In the spirit of the new guidelines for tutorials, I think we should pick just one path and go with it throughout the entire doc, don't cover alternatives in the getting started. Instead, I would prefer to create an installation doc, that covers all the available installation options.

Edit: Just opened an issue to track this.

Copy link
Collaborator

@bobcatfish bobcatfish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice!!! just some minor comments from me, that was very smooth for me (and the first time ive used minikube in... years XD might do it more often now!)

(i'm going to hold off on doing an approve or lgtm and defer to folks that have been attending the docs WG but lemme know if I need to)

content/en/docs/Getting Started/tasks.md Outdated Show resolved Hide resolved
content/en/docs/Getting Started/tasks.md Outdated Show resolved Hide resolved
content/en/docs/Getting Started/pipelines.md Outdated Show resolved Hide resolved
content/en/docs/Getting Started/pipelines.md Outdated Show resolved Hide resolved
@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 17, 2022
@tekton-robot tekton-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 2, 2022
Copy link
Member

@afrittoli afrittoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this - I added some cosmetic comments that needs to be fixed before this is merged, but the content looks great.

Historically with always been starting our Tekton guides with writing your own Task and Pipeline... I wonder however if we could rethink that as an "advanced" step - and start with using Tasks from the catalog instead? Not something for this PR, but I wanted to bring up the idea. @tektoncd/core-maintainers thoughts?

content/en/docs/Getting Started/tasks.md Outdated Show resolved Hide resolved
content/en/docs/Getting Started/tasks.md Outdated Show resolved Hide resolved
content/en/docs/Getting Started/tasks.md Show resolved Hide resolved
content/en/docs/Getting Started/pipelines.md Outdated Show resolved Hide resolved
content/en/docs/Getting Started/pipelines.md Outdated Show resolved Hide resolved
@bobcatfish
Copy link
Collaborator

Historically with always been starting our Tekton guides with writing your own Task and Pipeline... I wonder however if we could rethink that as an "advanced" step - and start with using Tasks from the catalog instead? Not something for this PR, but I wanted to bring up the idea. https://github.com/orgs/tektoncd/teams/core-maintainers thoughts?

that could make a lot of sense @afrittoli - could get users much more quickly to the satisfaction of running something and having it work :D

@geriom
Copy link
Contributor Author

geriom commented Mar 16, 2022

Completely agree with both of you @bobcatfish and @afrittoli . I'm going to give it some thought and share my ideas in either the WG or the mailing list.

@afrittoli
Copy link
Member

@geriom @AlanGreene I kicked off a re-deploy now, but it did not help - I still see the same cosmetic glitches in the rendering. I think this needs to be rebased so we can preview the actual result.

Apart from that the content looks good to me, so feel free to merge once the cosmetic issues are fixed

@geriom
Copy link
Contributor Author

geriom commented Apr 12, 2022

@afrittoli I rebased the branch, the preview looks fine now.

@AlanGreene I think we can merge it.

Copy link
Member

@AlanGreene AlanGreene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor issues, main one being a rogue kind command

content/en/docs/Getting Started/tasks.md Outdated Show resolved Hide resolved
content/en/docs/Getting Started/tasks.md Outdated Show resolved Hide resolved
content/en/docs/Getting Started/tasks.md Outdated Show resolved Hide resolved
content/en/docs/Getting Started/tasks.md Outdated Show resolved Hide resolved
Introductory guide for newcomers. This is a two-file quickstart that
shows a simple example to create a task and a pipeline.

These tutorials do not include new information. The information here is
reorganized to be easier to understand for newcomers. Including
prescritpive steps that the user just has to copy/paste .
Copy link
Member

@AlanGreene AlanGreene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks @geriom

/lgtm
/hold cancel
/meow

@tekton-robot
Copy link

@AlanGreene: cat image

In response to this:

Looks good, thanks @geriom

/lgtm
/hold cancel
/meow

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tekton-robot tekton-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 13, 2022
@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 13, 2022
@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AlanGreene, bobcatfish

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [AlanGreene,bobcatfish]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot merged commit d420395 into tektoncd:main Apr 13, 2022
@geriom geriom deleted the quickstart branch May 26, 2022 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants