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

Allow embedding specs in Pipeline and PipelineRun instead of referencing. #872

Closed
cjwagner opened this issue May 16, 2019 · 12 comments · Fixed by #1324 or #1554
Closed

Allow embedding specs in Pipeline and PipelineRun instead of referencing. #872

cjwagner opened this issue May 16, 2019 · 12 comments · Fixed by #1324 or #1554
Assignees
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. meaty-juicy-coding-work This task is mostly about implementation!!! And docs and tests of course but that's a given

Comments

@cjwagner
Copy link

Expected Behavior

I see that the TaskRun spec allow Tasks and PipelineResources to be embedded into the spec via the taskSpec and resourceSpec fields. (Docs, Issue) Creating just the TaskRun is simpler than creating all the CRDs and avoids the need to clean up ephemeral Tasks and PipelineResources that are only needed for the individual TaskRun. (ref #544)

It would be great if PipelineRuns could expose a similar embedding mechanism so that the Tasks, Pipeline, and PipelineResources could all be embedded into the PipelineRun spec. Here is a simple example of what I would expect a fully embedded PipelineRun to look like (snipped together from other examples):

apiVersion: tekton.dev/v1alpha1
kind: PipelineRun
metadata:
  name: do-the-thing
spec:
  resources:
    - name: source-repo
      resourceSpec:
        type: git
        params:
          - name: url
            value: https://github.com/pivotal-nader-ziada/gohelloworld
  pipelineSpec:
    resources:
      - name: source-repo
        type: git
    tasks:
      - name: skaffold-unit-tests
        taskSpec:
          inputs:
            resources:
              - name: workspace
                type: git
          steps:
            - name: build-and-push
              image: gcr.io/kaniko-project/executor
              command:
                - /kaniko/executor
              args:
                - --destination=gcr.io/my-project/gohelloworld
        resources:
          inputs:
            - name: workspace
              resource: source-repo

Additional Info

The context for this is running ProwJobs as Tekton Pipelines.
Prow now has a controller that can run ProwJobs that define a PipelineRun spec, but currently the referenced Pipeline and PipelineResources must already exist in the cluster. It would be neat if a ProwJob could specify all the needed information in the PipelineRun spec instead of having to reference other CRDs that must be separately managed by our automation.

@bobcatfish bobcatfish added help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. meaty-juicy-coding-work This task is mostly about implementation!!! And docs and tests of course but that's a given labels May 16, 2019
@bobcatfish
Copy link
Collaborator

Seems totally reasonable to have this! Thanks for opening the issue @cjwagner

The context for this is running ProwJobs as Tekton Pipelines.

Sort of related, I'd also like to bring your attention to #859: we'd really like our Pipeline and Task definitions to live in our repo alongside our code. So another possible way to address your use case could be for Prow to be aware of where the Pipeline and Task definitions are stored in the repo, and apply them before running?

(Would still need some way to stamp out and/or embed PipelineResources tho)

@bobcatfish
Copy link
Collaborator

(Would still need some way to stamp out and/or embed PipelineResources tho)

p.s. going to propose pipelineresource embedding for #544 anyway :D

@dibyom
Copy link
Member

dibyom commented Sep 12, 2019

@pritidesai is working on this!

@bobcatfish
Copy link
Collaborator

/assign pritidesai

@tekton-robot
Copy link
Collaborator

@bobcatfish: GitHub didn't allow me to assign the following users: pritidesai.

Note that only tektoncd members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

/assign pritidesai

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.

@bobcatfish
Copy link
Collaborator

/assign pritidesai

@bobcatfish
Copy link
Collaborator

@bobcatfish
Copy link
Collaborator

I'm going to reopen this b/c we don't have Task embedding yet.

@bobcatfish bobcatfish reopened this Sep 25, 2019
@pritidesai
Copy link
Member

will start working on Task embedding after PR #1353 and #1333 are merged since these PRs are perquisites for taskSpec under pipelineSpec.

@vdemeester
Copy link
Member

@bobcatfish @pritidesai I think all is done now, right ?

@pritidesai
Copy link
Member

hey @vdemeester the taskSpec is still pending, just started working on it this week.

@vdemeester
Copy link
Member

@pritidesai ok 👍 I thought it was tracked in another issue 😝

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. meaty-juicy-coding-work This task is mostly about implementation!!! And docs and tests of course but that's a given
Projects
None yet
6 participants