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

Better support for CI systems that provide many env vars #1294

Closed
bobcatfish opened this issue Sep 9, 2019 · 11 comments
Closed

Better support for CI systems that provide many env vars #1294

bobcatfish opened this issue Sep 9, 2019 · 11 comments
Labels
design This task is about creating and discussing a design kind/design Categorizes issue or PR as related to design. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@bobcatfish
Copy link
Collaborator

Expected Behavior

Many CI systems expect to pass a plethora of environment variables to executing logic (in our case, to the executing Step containers).

For example, these are environment varaibles that Jenkins X provides, and these are environment variables that Prow provides. Each has ~12-15+ env vars to provide.

It should be possible for CI systems that want to integrate with Tekton to:

  1. Pass all environment variables to executing Tasks + Steps
  2. Be able to add new environment variables without needing to change all Pipelines + Tasks

But at the same time we need to uphold Tekton principles, specifically avoiding implied coupling between Step containers and the CI system.

For example, say the CI system provides an environment variable PROW_JOB_ID and container gcr.io/someregistry/write-results uses the environment variable PROW_JOB_ID. It should be clear to anyone using a step that uses gcr.io/someregistry/write-results that the environment variable PROW_JOB_ID must be provided.

Actual Behavior

Currently all environment variables that are provided to a step must be listed explicitly. Providing a set of ~15 environment variable automatically to a Pipeline + Tasks could easily end up looking like:

  • All Pipelines take all 15 env vars as parameters - if any env vars are added, all Pipelines + PipelineRun templates must be updated
  • All Tasks referred to by all Pipelines could end up taking all 15 env vars as parameters

Both of these lead to brittle Pipelines and Tasks that can't be reused, and need to be updated to stay in sync with the CI system.

Additional Info

  • It could be that this is best solved by providing best practices and guidance to CI authors integrating with Tekton Pipelines and nothing actually needs to change
  • One interesting way to look at this problem could be in the context of TriggerTemplates, i.e. how could a triggering system provide all the context necessary
  • @imjasonh suggested the idea of an EnvVarPipelineResource which could maybe hold bundle of env vars, and there would be a way to easily link those Resources to executing images (maybe @imjasonh could provide more detail here)
@bobcatfish bobcatfish added the design This task is about creating and discussing a design label Sep 9, 2019
@imjasonh
Copy link
Member

@poy is working on migrating https://github.com/google/kf from Knative Build to Tekton (🎉 ) and ran into this speedbump. As a workaround they're going to create a ConfigMap that defines all the env vars for each TaskRun, then create both and tie them together with:

steps:
- image: ubuntu
  envFrom:
  - configMapRef:
      name: $(inputs.params.ENVS)

Thought it might be worth mentioning as a (kinda cruddy) workaround until we come up with something better.

@tekton-robot
Copy link
Collaborator

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

/close

Send feedback to tektoncd/plumbing.

@tekton-robot
Copy link
Collaborator

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
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.

/lifecycle stale

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.
Mark the issue as fresh with /remove-lifecycle rotten.

/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.

@tekton-robot tekton-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 12, 2020
@vdemeester
Copy link
Member

/remove-lifecycle rotten
/remove-lifecycle stale
/reopen

@tekton-robot tekton-robot reopened this Aug 13, 2020
@tekton-robot
Copy link
Collaborator

@vdemeester: Reopened this issue.

In response to this:

/remove-lifecycle rotten
/remove-lifecycle stale
/reopen

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.

@tekton-robot tekton-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 13, 2020
@coryrc
Copy link

coryrc commented Aug 29, 2020

I think people who want to use Tekton should make dependencies explicit by using parameters. Environment variables are globals and we stopped using globals in code; I say it shouldn't be encouraged.

I am writing a Task to parse each Prow environment variable and put each into a result. (It'll get it from Prow via an encoded string passed as a single param).

@tekton-robot
Copy link
Collaborator

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
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.

/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 Nov 27, 2020
@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 Dec 27, 2020
@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
design This task is about creating and discussing a design kind/design Categorizes issue or PR as related to design. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

5 participants