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

On cluster build: Don't reference tasks from knative/func git repo #1858

Closed
Tracked by #620
zroubalik opened this issue Jul 11, 2023 · 12 comments
Closed
Tracked by #620

On cluster build: Don't reference tasks from knative/func git repo #1858

zroubalik opened this issue Jul 11, 2023 · 12 comments
Labels
kind/feature-request pipelines issues related to on-cluster builds via Tekton Pipelines

Comments

@zroubalik
Copy link
Contributor

zroubalik commented Jul 11, 2023

Pipelines used by the on cluster build implemented by Standard Tekton approach reference func related tasks hosted on this repo. The only approach that we can use with the Standard Tekton is the Git resolver - it fetches the whole repo and then use tasks in this repo:

taskFuncBuildpacksTaskRef = `taskRef:
resolver: git
params:
- name: url
value: https://github.com/%s.git
- name: revision
value: %s
- name: pathInRepo
value: pkg/pipelines/resources/tekton/task/func-buildpacks/0.1/func-buildpacks.yaml`
taskFuncBuildpacksPACTaskRef = `taskRef:
kind: Task
name: func-buildpacks`
taskFuncS2iTaskRef = `taskRef:
resolver: git
params:
- name: url
value: https://github.com/%s.git
- name: revision
value: %s
- name: pathInRepo
value: pkg/pipelines/resources/tekton/task/func-s2i/0.1/func-s2i.yaml`
taskFuncS2iPACTaskRef = `taskRef:
kind: Task
name: func-s2i`
taskFuncDeployTaskRef = `taskRef:
resolver: git
params:
- name: url
value: https://github.com/%s.git
- name: revision
value: %s
- name: pathInRepo
value: pkg/pipelines/resources/tekton/task/func-deploy/0.1/func-deploy.yaml`

On the other hand, Pipelines as Code apporach that we use for a part of on cluster build also supports URL resolver - then we can just reference a single file hosted in some repo and the whole resolving is much faster:

taskFuncS2iPACPipelineRunRef = "https://raw.githubusercontent.com/%s/%s/pkg/pipelines/resources/tekton/task/func-s2i/0.1/func-s2i.yaml"
taskFuncBuildpacksPACPipelineRunRef = "https://raw.githubusercontent.com/%s/%s/pkg/pipelines/resources/tekton/task/func-buildpacks/0.1/func-buildpacks.yaml"
taskFuncDeployPACPipelineRunRef = "https://raw.githubusercontent.com/%s/%s/pkg/pipelines/resources/tekton/task/func-deploy/0.1/func-deploy.yaml"

Using Git resolver might be problematic when the referenced task is hosted in a large git repo - it takes some time to fetch the whole repo. I opened issue on Tekton to add URL resolver - tektoncd/pipeline#6920

We should mitigate the problem with the lengthy resolver, there are a couple of solutions:

  • wait until URL resolver is added to Tekton (this might take some time)
  • move tasks to another Git repo that will only host these tasks (suboptimal solution)
  • add Func tasks to Tekton Hub and then just use Hub Resolver which already exists (I think this is the cleaniest solution from Tekton POV)

Affected tasks:

  • func-buildpacks
  • func-s2i
  • func-deploy
@zroubalik zroubalik mentioned this issue Jul 11, 2023
29 tasks
@lance lance moved this to 🔖 Next in Functions WG Roadmap Jul 12, 2023
@lance lance added this to the Release 1.11 milestone Jul 12, 2023
@phutaneVinayak
Copy link

Any update? Facing same issue.

"error":"1 error occurred:\n\t Couldn't retrieve Task "func-buildpacks": tasks.tekton.dev "func-buildpacks" not found*

complete logs
{"severity":"error","timestamp":"2023-08-07T14:47:19.017Z","logger":"tekton-pipelines-controller","caller":"pipelinerun/pipelinerun.go:258","message":"Reconcile error: Couldn't retrieve Task "func-buildpacks": tasks.tekton.dev "func-buildpacks" not found","commit":"d267743","knative.dev/controller":"github.com.tektoncd.pipeline.pkg.reconciler.pipelinerun.Reconciler","knative.dev/kind":"tekton.dev.PipelineRun","knative.dev/traceid":"d04699fe-edd6-4093-8169-f5118ecced40","knative.dev/key":"default/mydemo-pack-upload-pip5bsbd","stacktrace":"github.com/tektoncd/pipeline/pkg/reconciler/pipelinerun.(*Reconciler).ReconcileKind\n\tgithub.com/tektoncd/pipeline/pkg/reconciler/pipelinerun/pipelinerun.go:258\ngithub.com/tektoncd/pipeline/pkg/client/injection/reconciler/pipeline/v1/pipelinerun.(*reconcilerImpl).Reconcile\n\tgithub.com/tektoncd/pipeline/pkg/client/injection/reconciler/pipeline/v1/pipelinerun/reconciler.go:236\nknative.dev/pkg/controller.(*Impl).processNextWorkItem\n\tknative.dev/pkg@v0.0.0-20230221145627-8efb3485adcf/controller/controller.go:542\nknative.dev/pkg/controller.(*Impl).RunContext.func3\n\tknative.dev/pkg@v0.0.0-20230221145627-8efb3485adcf/controller/controller.go:491"}

@matejvasek
Copy link
Contributor

@phutaneVinayak This is odd, what version of func do you use?

@matejvasek
Copy link
Contributor

What command did you invoke?

@phutaneVinayak
Copy link

phutaneVinayak commented Aug 7, 2023

Hi @matejvasek ,
I am using kn-func version v1.10.0.

I try below command
kn-func deploy --remote

Which help to deploy function from current folder to cluster. I am trying on cluster build.

Can you give me bit more perfect way to do it. It would be much helpful.

@matejvasek
Copy link
Contributor

matejvasek commented Aug 7, 2023

@phutaneVinayak change is in v1.11.0.

@matejvasek
Copy link
Contributor

You need update.

@matejvasek
Copy link
Contributor

On v1.10.0 you need to install the tasks manually using kubectl apply.

@phutaneVinayak
Copy link

phutaneVinayak commented Aug 7, 2023

Hi @matejvasek ,

Can we have task git url? or need to manually create task in tekton pipeline ?

I will also try to update to kn-func to 1.11.0

@matejvasek
Copy link
Contributor

They are under https://github.com/knative/func/tree/main/pkg/pipelines/resources/tekton/task .
But v1.11.0 should resolve it.

@phutaneVinayak
Copy link

Hi @matejvasek ,

Really really thank you :) . I try both way.

@phutaneVinayak
Copy link

Hi @matejvasek ,

I updated kn-func to 1.11.0 It worked 👍

thanks a lot.

@lkingland lkingland added kind/feature-request pipelines issues related to on-cluster builds via Tekton Pipelines labels Aug 23, 2023
@lkingland lkingland removed this from the Release 1.11 milestone Aug 23, 2023
@lkingland lkingland moved this from 🔖 Next to ❄ Icebox in Functions WG Roadmap Oct 17, 2023
Copy link
Contributor

This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue 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 Nov 23, 2023
@github-project-automation github-project-automation bot moved this from ❄ Icebox to ✅ Done in Functions WG Roadmap Dec 24, 2023
@lkingland lkingland removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature-request pipelines issues related to on-cluster builds via Tekton Pipelines
Projects
Status: ✅ Done
Development

No branches or pull requests

5 participants