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

Pipelines-in-Pipelines support #1354

Open
Bibz87 opened this issue Jul 25, 2023 · 1 comment
Open

Pipelines-in-Pipelines support #1354

Bibz87 opened this issue Jul 25, 2023 · 1 comment

Comments

@Bibz87
Copy link
Contributor

Bibz87 commented Jul 25, 2023

Are Pipelines-in-Pipelines supported?

I've installed the PiP controller and regular runs made directly in Tekton work properly. However, trying to run with Pipelines as Code makes PaC think the sub-pipeline is a task and can't find it.

I'm using Pipelines as Code's stable version.

Error:
{
  "severity": "ERROR",
  "timestamp": "2023-07-25T20:23:18.321536113Z",
  "logger": "pipelinesascode",
  "caller": "events/emit.go:45",
  "message": "failed to match pipelineRuns: cannot find referenced task good-morning-good-afternoon. if it's a remote task make sure to add it in the annotations",
  "commit": "88586a0",
  "provider": "gitlab",
  "event-id": "",
  "event-sha": "e22167794157a14fb6be28cf793cf31c4f8d05f4",
  "event-type": "Push",
  "stacktrace": "github.com/openshift-pipelines/pipelines-as-code/pkg/events.(*EventEmitter).EmitMessage\n\t/src/pkg/events/emit.go:45\ngithub.com/openshift-pipelines/pipelines-as-code/pkg/pipelineascode.(*PacRun).getPipelineRunsFromRepo\n\t/src/pkg/pipelineascode/match.go:162\ngithub.com/openshift-pipelines/pipelines-as-code/pkg/pipelineascode.(*PacRun).matchRepoPR\n\t/src/pkg/pipelineascode/match.go:34\ngithub.com/openshift-pipelines/pipelines-as-code/pkg/pipelineascode.(*PacRun).Run\n\t/src/pkg/pipelineascode/pipelineascode.go:47\ngithub.com/openshift-pipelines/pipelines-as-code/pkg/adapter.(*sinker).processEvent\n\t/src/pkg/adapter/sinker.go:52\ngithub.com/openshift-pipelines/pipelines-as-code/pkg/adapter.listener.handleEvent.func1.2\n\t/src/pkg/adapter/adapter.go:189"
}
Configuration:

Sub-pipeline

This pipeline is installed directly on the cluster and is listed in Tekton Dashboard's Pipelines section. The same error also occurs if the pipeline is remotely referenced via an annotation.

apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
  name: good-morning-good-afternoon
spec:
  tasks:
    - name: echo-good-morning
      taskSpec:
        steps:
          - name: echo
            image: ubuntu
            script: |
              #!/usr/bin/env bash
              echo "Good Morning!"
    - name: echo-good-afternoon
      taskSpec:
        steps:
          - name: echo
            image: ubuntu
            script: |
              #!/usr/bin/env bash
              echo "Good Afternoon!"

PipelineRun

apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
  name: test-pipeline-in-pipeline
  annotations:
    pipelinesascode.tekton.dev/max-keep-runs: "5"
    pipelinesascode.tekton.dev/on-cel-expression: >
      event == "push"
spec:
  serviceAccountName: 'default'
  pipelineSpec:
    name: test-pipeline-in-pipeline
    description: Testing Pipelines-in-Pipelines feature
    tasks:
      - name: hello
        taskSpec:
          steps:
            - name: echo
              image: ubuntu
              script: |
                #!/usr/bin/env bash
                echo "Hello World!"
      - name: greeting
        taskRef:
          apiVersion: tekton.dev/v1beta1
          kind: Pipeline
          name: good-morning-good-afternoon
        runAfter:
          - hello
      - name: bye
        taskSpec:
          steps:
            - name: echo
              image: ubuntu
              script: |
                #!/usr/bin/env bash
                echo "Bye World!"
        runAfter:
          - greeting
@Bibz87
Copy link
Contributor Author

Bibz87 commented Jul 25, 2023

Come to think of it, Pipelines as Code only supports one pipeline on remote resolution, so even if Pipelines-in-Pipelines were supported, I'd still be forced to install multiple pipelines on the cluster. 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant