Skip to content

Conversation

@lance
Copy link
Contributor

@lance lance commented Jun 1, 2023

This is a work in progress to document the process for using pipelines as code with a function.

lance added 2 commits June 1, 2023 11:22
Includes instructions for using pipelines as code to build and deploy a
function on the cluster.

Signed-off-by: Lance Ball <lball@redhat.com>
Signed-off-by: Lance Ball <lball@redhat.com>
@knative-prow knative-prow bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 1, 2023
@lance lance requested a review from zroubalik June 1, 2023 20:14
@knative-prow knative-prow bot requested review from jrangelramos and rhuss June 1, 2023 20:14
@knative-prow
Copy link

knative-prow bot commented Jun 1, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lance

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:

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

@knative-prow knative-prow bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jun 1, 2023
@codecov
Copy link

codecov bot commented Jun 1, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 62.24%. Comparing base (fea4a72) to head (6c1ef0c).
Report is 318 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1770      +/-   ##
==========================================
+ Coverage   62.04%   62.24%   +0.19%     
==========================================
  Files         100      100              
  Lines       13311    13311              
==========================================
+ Hits         8259     8285      +26     
+ Misses       4253     4230      -23     
+ Partials      799      796       -3     
Flag Coverage Δ
e2e-test 37.95% <ø> (ø)
e2e-test-oncluster 33.51% <ø> (ø)
e2e-test-oncluster-runtime 28.81% <ø> (?)
e2e-test-runtime-go 27.37% <ø> (?)
e2e-test-runtime-node 28.53% <ø> (?)
e2e-test-runtime-python 28.53% <ø> (?)
e2e-test-runtime-quarkus 28.66% <ø> (?)
e2e-test-runtime-springboot 27.61% <ø> (?)
e2e-test-runtime-typescript 28.57% <ø> (?)
integration-tests 47.97% <ø> (+0.13%) ⬆️
unit-tests-ubuntu-latest 50.10% <ø> (ø)
unit-tests-windows-latest 49.34% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

4. Configure the function to enable on cluster builds for the Git repository:
```yaml
build: git # required, specify `git` build type
func config git set
Copy link
Contributor

Choose a reason for hiding this comment

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

minor nit just to match other commands

Suggested change
func config git set
kn func config git set

Copy link
Contributor

Choose a reason for hiding this comment

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

Might be wort to add a link down below to ## Building a Function on the Cluster with Pipelines as Code if PAC is used with a details.

Copy link
Contributor

@zroubalik zroubalik Jun 6, 2023

Choose a reason for hiding this comment

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

Actually I would move this step 4. (and git push) directly to ## Building a Function on the Cluster with Pipelines as Code section. It is confusing atm.
And then add another note on adding the git url manually in ## Building and Deploying a Function on Cluster Using the CLI - when this approach is used.

The `func` CLI can generate the Tekton resources for you, adding them to a `.tekton` directory in your project. Commit these files to your project and use them to build your function on the cluster.
1. When you ran `func config git set` earlier, this command also generated a `.tekton/pipeline.yaml` and a `.tekton/pipeline-run.yaml` file in your project directory. If you have not run this command, run it now.
Copy link
Contributor

Choose a reason for hiding this comment

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

Hey Lance.. just a sugestion.. what about add a note that the user needs to make sure to include Webhook? and for that he needs handy a valid GitHub token with write permission to Webhooks.

kn func config git set
...
? Do you want to configure webhook trigger? Yes
? Please enter the GitHub Personal Access Token:

Copy link
Contributor

@zroubalik zroubalik Jun 6, 2023

Choose a reason for hiding this comment

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

Yeah, adding more details is good. We can mention that this command creates resources on the cluster (PVC, Secrets with credentials), local resources (Tekton templates, that can be edited by users) and also resources on the remote git platform (GitHub & incoming GitLab support). For that users need to provide info:

  • GitHub GitHub Personal Access Token. For public repositories the scope is 'public_repo', for private is 'repo', then user needs to create the Webhook on GH side on his own. If you want to configure the webhook automatically, 'admin:repo_hook' is needed as well. Get more details: https://pipelines-as-code.pages.dev/docs/install/github_webhook/.
  • Similar stuff for GitLab - once the PR is merged

Copy link
Contributor

Choose a reason for hiding this comment

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

Would be also nice to print example output, that you can see if you run kn func config git set.

Copy link
Contributor

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

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

Looking good!

The `func` CLI can generate the Tekton resources for you, adding them to a `.tekton` directory in your project. Commit these files to your project and use them to build your function on the cluster.
1. When you ran `func config git set` earlier, this command also generated a `.tekton/pipeline.yaml` and a `.tekton/pipeline-run.yaml` file in your project directory. If you have not run this command, run it now.
Copy link
Contributor

@zroubalik zroubalik Jun 6, 2023

Choose a reason for hiding this comment

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

Yeah, adding more details is good. We can mention that this command creates resources on the cluster (PVC, Secrets with credentials), local resources (Tekton templates, that can be edited by users) and also resources on the remote git platform (GitHub & incoming GitLab support). For that users need to provide info:

  • GitHub GitHub Personal Access Token. For public repositories the scope is 'public_repo', for private is 'repo', then user needs to create the Webhook on GH side on his own. If you want to configure the webhook automatically, 'admin:repo_hook' is needed as well. Get more details: https://pipelines-as-code.pages.dev/docs/install/github_webhook/.
  • Similar stuff for GitLab - once the PR is merged

4. Configure the function to enable on cluster builds for the Git repository:
```yaml
build: git # required, specify `git` build type
func config git set
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be wort to add a link down below to ## Building a Function on the Cluster with Pipelines as Code if PAC is used with a details.

The `func` CLI can generate the Tekton resources for you, adding them to a `.tekton` directory in your project. Commit these files to your project and use them to build your function on the cluster.
1. When you ran `func config git set` earlier, this command also generated a `.tekton/pipeline.yaml` and a `.tekton/pipeline-run.yaml` file in your project directory. If you have not run this command, run it now.
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be also nice to print example output, that you can see if you run kn func config git set.

4. Configure the function to enable on cluster builds for the Git repository:
```yaml
build: git # required, specify `git` build type
func config git set
Copy link
Contributor

@zroubalik zroubalik Jun 6, 2023

Choose a reason for hiding this comment

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

Actually I would move this step 4. (and git push) directly to ## Building a Function on the Cluster with Pipelines as Code section. It is confusing atm.
And then add another note on adding the git url manually in ## Building and Deploying a Function on Cluster Using the CLI - when this approach is used.

@lance lance added this to the Release 1.11 milestone Jul 12, 2023
@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 30, 2023
@knative-prow-robot
Copy link

PR needs rebase.

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.

@matejvasek
Copy link
Contributor

/override Func Build / Build (1.18.x, ubuntu-latest)

@knative-prow
Copy link

knative-prow bot commented Jul 31, 2023

@matejvasek: matejvasek unauthorized: /override is restricted to Repo administrators.

In response to this:

/override Func Build / Build (1.18.x, ubuntu-latest)

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.

@github-actions
Copy link
Contributor

This Pull Request is stale because it has been open for 90 days with
no activity. It will automatically close after 30 more days of
inactivity. Reopen with /reopen. Mark as fresh by adding the
comment /remove-lifecycle stale.

@github-actions github-actions bot added lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Oct 30, 2023
@github-actions
Copy link
Contributor

This Pull Request is stale because it has been open for 90 days with
no activity. It will automatically close after 30 more days of
inactivity. Reopen with /reopen. Mark as fresh by adding the
comment /remove-lifecycle stale.

@github-actions github-actions bot added lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jan 30, 2024
@github-actions
Copy link
Contributor

github-actions bot commented May 1, 2024

This Pull Request is stale because it has been open for 90 days with
no activity. It will automatically close after 30 more days of
inactivity. Reopen with /reopen. Mark as fresh by adding the
comment /remove-lifecycle stale.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 1, 2024
@github-actions github-actions bot closed this Jun 1, 2024
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. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

5 participants