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

[KOGITO-7278][KSW-Guides] Building Workflow Images with Tekton Pipelines #333

Closed
wants to merge 4 commits into from

Conversation

desmax74
Copy link
Contributor

JIRA: https://issues.redhat.com/browse/KOGITO-7278

Description:
Building Workflow Images with Tekton Pipelines

Please make sure that your PR meets the following requirements:

  • You have read the contributions doc
  • Pull Request title is properly formatted: KOGITO-XYZ Subject
  • Pull Request title contains the target branch if not targeting main: [0.9.x] KOGITO-XYZ Subject
  • The nav.adoc file has a link to this guide in the proper category
  • The index.adoc file has a card to this guide in the proper category, with a meaningful description
How to backport a pull request to a different branch?

In order to automatically create a backporting pull request please add one or more labels having the following format backport-<branch-name>, where <branch-name> is the name of the branch where the pull request must be backported to (e.g., backport-7.67.x to backport the original PR to the 7.67.x branch).

NOTE: backporting is an action aiming to move a change (usually a commit) from a branch (usually the main one) to another one, which is generally referring to a still maintained release branch. Keeping it simple: it is about to move a specific change or a set of them from one branch to another.

Once the original pull request is successfully merged, the automated action will create one backporting pull request per each label (with the previous format) that has been added.

If something goes wrong, the author will be notified and at this point a manual backporting is needed.

NOTE: this automated backporting is triggered whenever a pull request on main branch is labeled or closed, but both conditions must be satisfied to get the new PR created.

@netlify
Copy link

netlify bot commented Apr 27, 2023

Deploy Preview for tangerine-crostata-04a6bf ready!

Name Link
🔨 Latest commit 92d4c2c
🔍 Latest deploy log https://app.netlify.com/sites/tangerine-crostata-04a6bf/deploys/647090dfd58f02000832e1f1
😎 Deploy Preview https://deploy-preview-333--tangerine-crostata-04a6bf.netlify.app/serverlessworkflow/latest/cloud/quarkus/build-workflow-images-with-tekton
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@desmax74 desmax74 force-pushed the kogito-7278 branch 2 times, most recently from 8b5090a to 43067a5 Compare April 27, 2023 09:38
@desmax74 desmax74 requested a review from ricardozanini April 27, 2023 09:38
@desmax74 desmax74 changed the title Kogito 7278 [Kogito 7278][KSW-Guides] Building Workflow Images with Tekton Pipelines Apr 27, 2023
Copy link
Member

@ricardozanini ricardozanini left a comment

Choose a reason for hiding this comment

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

This is nice, but this is not an Operator use case. It can me moved under "Quarkus" section, so users can use this guide to deploy their local projects to k8s via Tekton.

@desmax74 desmax74 force-pushed the kogito-7278 branch 2 times, most recently from 20fa022 to 62ebf0b Compare April 28, 2023 08:42
On OCP in the Pipeline menu, in the item PipelineRun, copy the following custom-workflow-image-pipeline-run.yaml file replacing the placeholder with your values.

i.e. `image registry available at image-registry.openshift-image-registry.svc:5000/`
Copy link
Contributor

Choose a reason for hiding this comment

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

what does it mean ? is that the placeholder ?

Copy link
Contributor Author

@desmax74 desmax74 May 10, 2023

Choose a reason for hiding this comment

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

The idea is to indicate the the section to be replaced with the user values

- name: IMAGE value: "image-registry.openshift-image-registry.svc:5000/custom-namespace/<your-image-name>:latest"

== Create the pipeline

In the `custom-namespace` namespace, in the pipelines menu on Openshift UI, open the pipeline item, create it, and copy the following `custom-workflow-image-pipeline.yaml` file.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
In the `custom-namespace` namespace, in the pipelines menu on Openshift UI, open the pipeline item, create it, and copy the following `custom-workflow-image-pipeline.yaml` file.
In the `custom-namespace` namespace, in the pipelines menu on OpenShift UI, open the pipeline item, create it, and copy the following `custom-workflow-image-pipeline.yaml` file.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe rephrase: "open the pipeline item, create it"
isn't these both options basically the same thing?


In the `custom-namespace` namespace, in the pipelines menu on Openshift UI, open the pipeline item, create it, and copy the following `custom-workflow-image-pipeline.yaml` file.
It contains a pipeline to clone your git repo, build the image and push it to the local image registry.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
It contains a pipeline to clone your git repo, build the image and push it to the local image registry.
It contains a pipeline that will clone your Git repository, build the Container Image and push it to the local image registry.

name: deployment-name
type: string
- description: url of the git repo for the code of deployment
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- description: url of the git repo for the code of deployment
- description: Git repository url.

name: git-revision
type: string
- description: image to be built from the code
Copy link
Member

Choose a reason for hiding this comment

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

Maybe, "name of the built image"?


If you use the Tekton Dashboard on Minikube, Kind or on a Kubernetes cluster, copy the content of the yaml in the pipeline section.
If you don't want to use the UI, replace the placeholder in the `custom-workflow-image-pipeline.yaml` (the previous yaml) and execute:
Copy link
Member

Choose a reason for hiding this comment

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

instead using "replace placeholder", imho, it is better to use something like, "fill the required fields in the example file above and..."

== Create a PipelineRun to execute the pipeline

The next step is to create a pipeline run with the details of your git repository and the desired name of the image.
Copy link
Member

Choose a reason for hiding this comment

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

Is it PipelineRun or pipeline run?

The next step is to create a pipeline run with the details of your git repository and the desired name of the image.

On OCP -> Pipeline menu -> PipelineRun, copy the following yaml file and replace the placeholders with your values.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
On OCP -> Pipeline menu -> PipelineRun, copy the following yaml file and replace the placeholders with your values.
On OpenShift -> Pipeline menu -> PipelineRun, copy the following yaml file and replace the placeholders with your values.

image-registry.openshift-image-registry.svc:5000/custom-namespace/<your-image-name>:latest

On Minikube, Kind or plain Kubernetes cluster you can install the
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
On Minikube, Kind or plain Kubernetes cluster you can install the
On Minikube, Kind or Kubernetes cluster you can install the

Copy link
Member

Choose a reason for hiding this comment

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

or Vanilla Kubernetes

link:{https://tekton.dev/docs/dashboard/}[Tekton Dashboard]

Otherwise replace the in the custom-workflow-image-pipeline-run.yaml and execute
Copy link
Member

Choose a reason for hiding this comment

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

replace the...?
what is meant to be replaced?

If you have installed the Tekton CLI, you can run the pipeline with the following command:

----
Copy link
Member

@spolti spolti May 15, 2023

Choose a reason for hiding this comment

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

please take a look in the other adocs and use the same patter for yamls, shell commands, etc..


This command returns an id to check the execution with the cli in this way
----
Copy link
Member

Choose a reason for hiding this comment

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

same here.


At the end your image will be cluster's internal registry, like this example:
----
Copy link
Member

Choose a reason for hiding this comment

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

same here.

Copy link
Member

@spolti spolti left a comment

Choose a reason for hiding this comment

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

made a few comments, please take a look.

@spolti spolti changed the title [Kogito 7278][KSW-Guides] Building Workflow Images with Tekton Pipelines [KOGITO-7278][KSW-Guides] Building Workflow Images with Tekton Pipelines May 15, 2023
@desmax74 desmax74 requested a review from krisv as a code owner May 26, 2023 10:58
= Building Workflows Images with Tekton
Copy link
Member

Choose a reason for hiding this comment

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

Just to keep it consistent.

Suggested change
= Building Workflows Images with Tekton
= Building Workflow Images with Tekton



.Prerequisites
Copy link
Member

@MarianMacik MarianMacik Jun 7, 2023

Choose a reason for hiding this comment

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

For some reason this is not in bold. Likely because the next line is not a list.

and a namespace where you can install Tekton i.e. `custom-namespace`.

.OptionalPrerequisites
Copy link
Member

Choose a reason for hiding this comment

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

Same here.

Tekton CLI:

- On Openshift in the Operator pipelines is available a link to download the correct cli from the operaotr
Copy link
Member

Choose a reason for hiding this comment

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

Maybe add a screenshot?


If you are using OpenShift, you can install the Red Hat Pipeline Operator.
If you are using Minikube, you can follow this link: {tekton_minikube}[[tekton guide for Minikube].
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
If you are using Minikube, you can follow this link: {tekton_minikube}[[tekton guide for Minikube].
If you are using Minikube, you can follow this link: {tekton_minikube}[Tekton guide for Minikube].

If you are using Minikube, you can follow this link: {tekton_minikube}[[tekton guide for Minikube].
If you are using Kind you can follow this {tekton_kind}[Tekton guide for Kind].
If you want to use it on a plain kubernetes cluster, you can follow this {tekton_k8s}[Tekton guide for kubernetes].
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
If you want to use it on a plain kubernetes cluster, you can follow this {tekton_k8s}[Tekton guide for kubernetes].
If you want to use it on a plain Kubernetes cluster, you can follow this {tekton_k8s}[Tekton guide for Kubernetes].


If you use the Tekton Dashboard on Minikube, Kind or on a Kubernetes cluster, copy the content of the yaml in the pipeline section.
If you don't want to use the UI, replace the placeholder in the `custom-workflow-image-pipeline.yaml` (the previous yaml) and execute:
Copy link
Member

Choose a reason for hiding this comment

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

I don't see any explicit placeholders in that yaml.

On OCP -> Pipeline menu -> PipelineRun, copy the following yaml file and replace the placeholders with your values.

i.e. `image registry available at image-registry.openshift-image-registry.svc:5000/`
Copy link
Member

Choose a reason for hiding this comment

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

Maybe clarify what is meant by this line.


On Minikube, Kind or plain Kubernetes cluster you can install the
{tekton_dashboard}[Tekton Dashboard]
Copy link
Member

Choose a reason for hiding this comment

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

I think this should be mentioned and linked earlier.

----

At the end your image will be cluster's internal registry, like this example:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
At the end your image will be cluster's internal registry, like this example:
At the end your image will be in the cluster's internal registry, like this example:

@desmax74 desmax74 closed this Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants