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

[WIP] POC for handling large results. #4838

Closed
wants to merge 2 commits into from

Conversation

ScrapCodes
Copy link
Contributor

@ScrapCodes ScrapCodes commented May 5, 2022

A POC for supporting results with values larger than the capacity limit of termination message.

What it does:

  1. When results are larger than certain threshold, so push it to a remote storage.
  2. Instead of storing large contents into result (i.e. termination message, we just swap it with a remote store url).
  3. When results are referred to by params, or in a command. In the entrypointer script, we do a prefetch of the contents and replace the link with the filesname containing the contents of the result /or the actual contents(TBD since results are large).

A example is provided:
examples/v1beta1/pipelineruns/pipelinerun-large-results.yaml

The poc does not do the following, inorder to keep the code change minimum and easily comprehensible.

  1. make this feature an opt in.
  2. Uses a string cos:// as a marker for processing it as links. This can be improved by either using a new result type
  3. It uses a cloud object storage directly as a remote store. Ideally, it should support a CSI and then a user will be able to plugin storage of their choice.
  4. The size threshold is not yet configurable.
  5. Misses out on integration tests. This is actually a TODO ( if the community like the overall approach.)

@tekton-robot
Copy link
Collaborator

@ScrapCodes: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

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 do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels May 5, 2022
@tekton-robot tekton-robot requested review from afrittoli and dibyom May 5, 2022 15:29
@tekton-robot tekton-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 5, 2022
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign afrittoli
You can assign the PR to them by writing /assign @afrittoli in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ScrapCodes ScrapCodes force-pushed the TEP-86-poc-approach2 branch from 5e84d54 to 998165a Compare June 1, 2022 11:21
@tekton-robot tekton-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 1, 2022
@ScrapCodes ScrapCodes force-pushed the TEP-86-poc-approach2 branch from 998165a to eb22fa9 Compare June 1, 2022 11:26
@tekton-robot tekton-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 1, 2022
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/entrypoint/entrypointer.go 84.8% 62.8% -22.0

…it of termination message.

# What it does:

1. When results are larger than certain threshold, so push it to a remote storage.
2. Instead of storing large contents into result (i.e. termination message, we just swap it with a remote COS url).
3. When results are referred to by params, or in a command. In the entrypointer script, we do a prefetch of the contents and replace the link(starting with cos:// ) with the filesname containing the contents of the result /or the actual contents(TBD since results are large).

A example is provided:
examples/v1beta1/pipelineruns/pipelinerun-large-results.yaml

The poc does not do the following, inorder to keep the code change minimum and easily comprehensible.

1. make this feature an opt in.
2. Uses a string cos:// as a marker for processing it as links. This can be improved by either using a new result type
3. It uses a cloud object storage directly as a remote store. Ideally, it should support a CSI and then a user will be able to plugin storage of their choice.
4. The size threshold is not yet configurable.
5. Misses out on integration tests. This is actually a TODO ( if the community like the overall approach.)
@ScrapCodes ScrapCodes force-pushed the TEP-86-poc-approach2 branch from eb22fa9 to b403fd2 Compare June 1, 2022 16:11
@tekton-robot
Copy link
Collaborator

@ScrapCodes: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-tekton-pipeline-go-coverage b403fd2 link /test pull-tekton-pipeline-go-coverage
pull-tekton-pipeline-unit-tests b403fd2 link /test tekton-pipeline-unit-tests
pull-tekton-pipeline-build-tests b403fd2 link /test pull-tekton-pipeline-build-tests
pull-tekton-pipeline-alpha-integration-tests b403fd2 link /test pull-tekton-pipeline-alpha-integration-tests
pull-tekton-pipeline-integration-tests b403fd2 link /test pull-tekton-pipeline-integration-tests

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

1 similar comment
@tekton-robot
Copy link
Collaborator

@ScrapCodes: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-tekton-pipeline-go-coverage b403fd2 link /test pull-tekton-pipeline-go-coverage
pull-tekton-pipeline-unit-tests b403fd2 link /test tekton-pipeline-unit-tests
pull-tekton-pipeline-build-tests b403fd2 link /test pull-tekton-pipeline-build-tests
pull-tekton-pipeline-alpha-integration-tests b403fd2 link /test pull-tekton-pipeline-alpha-integration-tests
pull-tekton-pipeline-integration-tests b403fd2 link /test pull-tekton-pipeline-integration-tests

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@wlynch
Copy link
Member

wlynch commented Jun 30, 2022

Thanks @dibyom for pointing me at this today! cc @chitrangpatel @jerop in case you haven't seen this yet - I think this approach addresses some of the permissions concerns with the log based solution we were talking about in tektoncd/community#745. This is using OIDC from the entrypoint flow (similar to what I mentioned), though it's currently interfacing with an external IdP rather than the in-cluster IdP.

@ScrapCodes great start! Main piece of feedback I have is having the user pod entrypoint interface directly with external OIDC storage buckets is going to make it hard to ensure that every service account has the access and permissions it needs, and doesn't have broad permissions to alter other Task results it shouldn't have access to.

If you haven't seen it already, you might be interested in some of the ideas detailed in TEP-0086 around the dedicated HTTP API - we could auth from the entrypoint with pod OIDC creds via service account token projection like you have here to a Tekton-managed API. That API can verify the JWT matches the correct Task pod, then handle the storage and any additional auth.

Creds can be centralized in the Tekton control plane (so no need to worry about granting user pods access to external resources), and the API could be swapped out for different impl for external storage like this is doing, or updating the TaskRun object directly similar to what @chitrangpatel is doing with the log based proof of concept.

@ScrapCodes
Copy link
Contributor Author

Thank you @wlynch, I agree with auth part, it is not perfect.

In order to confirm, that I have understood correctly.

  • The storage should support the same credentials as tekton.
  • May be using POD's credentials authenticating against a HTTP auth server running inside the controller might make it perfect.

Will we be limited to supporting only http transport based stores(e.g. COS) as storages. Do you think that is acceptable?

On the brighter side, It does not need a sidecar !

@wlynch
Copy link
Member

wlynch commented Jul 7, 2022

In order to confirm, that I have understood correctly.

  • The storage should support the same credentials as tekton.
  • May be using POD's credentials authenticating against a HTTP auth server running inside the controller might make it perfect.

Will we be limited to supporting only http transport based stores(e.g. COS) as storages. Do you think that is acceptable?

The only bit that would need to be HTTP (though it could also be another transport mechanism like protobuf, etc. - it doesn't really matter as long as the API is agreed upon) would be from the user pod to the tekton controlled storage API. The tekton controlled storage API server can then interface with whatever backing storage it wants once it's authorized the user pod - COS, GCS, it's own local volume, etc.

If an external service supported the same result storage API and federated OIDC creds from the cluster, then you could skip the internal API and go straight to the external service.

@tekton-robot
Copy link
Collaborator

@ScrapCodes: PR needs rebase.

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 needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 12, 2022
@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 Oct 10, 2022
@ScrapCodes ScrapCodes closed this Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants