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

how do I set pipelinerun wait for the previous pipelinerun execution to complete #5485

Closed
dgsfor opened this issue Sep 13, 2022 · 9 comments
Closed
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@dgsfor
Copy link

dgsfor commented Sep 13, 2022

I want to set pipelinerun in serial, because the task in pipeline use the same pvc

@dgsfor dgsfor added the kind/bug Categorizes issue or PR as related to a bug. label Sep 13, 2022
@Yongxuanzhang
Copy link
Member

Hi, could you elaborate your use cases? Why not put the tasks in the same pipeline if they have dependency?

@dibyom
Copy link
Member

dibyom commented Sep 14, 2022

If I am reading this correctly, you have multiple runs of the same pipeline but they all need to share a single PVC that can only be mounted to one pod at a time. In that case, tektoncd/community#818 might be what you need

@dgsfor
Copy link
Author

dgsfor commented Sep 15, 2022

@dibyom yes,I use git-clone and build code task in pipeline, but the git-clone task will clean the pvc workspace, and the build code task will have some error.
image

@Yongxuanzhang
Copy link
Member

@dgsfor
Copy link
Author

dgsfor commented Sep 27, 2022

In fact, there are two points to this problem:
1.How to control concurrency
2.How to solve multiple pipelineruns using the same pvc problem

Regarding the first point, it has not yet been resolved and needs to be seen in the subsequent update iterations。

Regarding the second point, I have implemented two solutions so far:
1.When creating a pipelinerun, use volumeClaimTemplate to create random PVCs

apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
  generateName: eve-php-pre-volumeclaimtemplate-
  namespace: tekton-run
spec:
  workspaces:
    - name: git-clone-workspace-random
      volumeClaimTemplate:
        spec:
          accessModes:
            - ReadWriteOnce
          resources:
            requests:
              storage: 1Gi

2.If you use TriggerTemplate, then you can specify in resourcetemplates that workspace uses pvc's subPath capability,different directories can be created by $(uid)

apiVersion: triggers.tekton.dev/v1alpha1
kind: TriggerTemplate
metadata:
  name: trigger-template-eve-php-pre
  namespace: tekton-run
spec:
  params:
    - name: user-username
  resourcetemplates:
    - apiVersion: tekton.dev/v1beta1
      kind: PipelineRun
      metadata:
        generateName: eve-php-pre-pipelinerun-
        namespace: tekton-run
      spec:
        workspaces:
          - name: git-clone-workspace
            persistentVolumeClaim:
              claimName: pvc-tekton
            subPath: pvc-$(uid)

@tekton-robot
Copy link
Collaborator

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale with a justification.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle stale

Send feedback to tektoncd/plumbing.

@tekton-robot tekton-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 26, 2022
@tekton-robot
Copy link
Collaborator

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten with a justification.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle rotten

Send feedback to tektoncd/plumbing.

@tekton-robot tekton-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jan 25, 2023
@tekton-robot
Copy link
Collaborator

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen with a justification.
Mark the issue as fresh with /remove-lifecycle rotten with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/close

Send feedback to tektoncd/plumbing.

@tekton-robot
Copy link
Collaborator

@tekton-robot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen with a justification.
Mark the issue as fresh with /remove-lifecycle rotten with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/close

Send feedback to tektoncd/plumbing.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
Status: Done
Development

No branches or pull requests

4 participants