-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Simplify and split apart MakePod #1605
Comments
@imjasonh I wasn't sure if what is listed is what /kind feature |
This is the next and largest step of the effort to simplify and separate MakePod out into digestible chunks (tektoncd#1605) Behavioral changes: - Script->Command conversion now happens before entrypoint rewriting, rather than converting the rewritten entrypoint args. - Image name->digest lookups are cached locally while resolving a single TaskRun's steps. - Entrypoint lookups also update the step's digest. This was a race before: if an image was pushed between resolution and pod start, the resolved command might be out-of-date. Some redundant test cases have been removed from taskrun_test.go -- this file should test only behavior of taskrun.go, which is now smaller. Unit tests for individual transformation behavior has been moved into individual test files in pkg/pod, with some integration tests in pod_test.go -- some of these could likely be removed as well, if we feel like it.
This is the next and largest step of the effort to simplify and separate MakePod out into digestible chunks (tektoncd#1605) Behavioral changes: - Script->Command conversion now happens before entrypoint rewriting, rather than converting the rewritten entrypoint args. - Image name->digest lookups are cached locally while resolving a single TaskRun's steps. - Entrypoint lookups also update the step's digest. This was a race before: if an image was pushed between resolution and pod start, the resolved command might be out-of-date. Some redundant test cases have been removed from taskrun_test.go -- this file should test only behavior of taskrun.go, which is now smaller. Unit tests for individual transformation behavior has been moved into individual test files in pkg/pod, with some integration tests in pod_test.go -- some of these could likely be removed as well, if we feel like it.
This is the next and largest step of the effort to simplify and separate MakePod out into digestible chunks (tektoncd#1605) Behavioral changes: - Script->Command conversion now happens before entrypoint rewriting, rather than converting the rewritten entrypoint args. - Image name->digest lookups are cached locally while resolving a single TaskRun's steps. - Entrypoint lookups also update the step's digest. This was a race before: if an image was pushed between resolution and pod start, the resolved command might be out-of-date. Some redundant test cases have been removed from taskrun_test.go -- this file should test only behavior of taskrun.go, which is now smaller. Unit tests for individual transformation behavior has been moved into individual test files in pkg/pod, with some integration tests in pod_test.go -- some of these could likely be removed as well, if we feel like it.
This is the next and largest step of the effort to simplify and separate MakePod out into digestible chunks (tektoncd#1605) Behavioral changes: - Script->Command conversion now happens before entrypoint rewriting, rather than converting the rewritten entrypoint args. - Image name->digest lookups are cached locally while resolving a single TaskRun's steps. - Entrypoint lookups also update the step's digest. This was a race before: if an image was pushed between resolution and pod start, the resolved command might be out-of-date. Some redundant test cases have been removed from taskrun_test.go -- this file should test only behavior of taskrun.go, which is now smaller. Unit tests for individual transformation behavior has been moved into individual test files in pkg/pod, with some integration tests in pod_test.go -- some of these could likely be removed as well, if we feel like it.
This is the next and largest step of the effort to simplify and separate MakePod out into digestible chunks (tektoncd#1605) Behavioral changes: - Script->Command conversion now happens before entrypoint rewriting, rather than converting the rewritten entrypoint args. - Image name->digest lookups are cached locally while resolving a single TaskRun's steps. - Entrypoint lookups also update the step's digest. This was a race before: if an image was pushed between resolution and pod start, the resolved command might be out-of-date. Some redundant test cases have been removed from taskrun_test.go -- this file should test only behavior of taskrun.go, which is now smaller. Unit tests for individual transformation behavior has been moved into individual test files in pkg/pod, with some integration tests in pod_test.go -- some of these could likely be removed as well, if we feel like it.
This is the next and largest step of the effort to simplify and separate MakePod out into digestible chunks (tektoncd#1605) Behavioral changes: - Script->Command conversion now happens before entrypoint rewriting, rather than converting the rewritten entrypoint args. - Image name->digest lookups are cached locally while resolving a single TaskRun's steps. - Entrypoint lookups also update the step's digest. This was a race before: if an image was pushed between resolution and pod start, the resolved command might be out-of-date. Some redundant test cases have been removed from taskrun_test.go -- this file should test only behavior of taskrun.go, which is now smaller. Unit tests for individual transformation behavior has been moved into individual test files in pkg/pod, with some integration tests in pod_test.go -- some of these could likely be removed as well, if we feel like it.
This is the next and largest step of the effort to simplify and separate MakePod out into digestible chunks (tektoncd#1605) Behavioral changes: - Script->Command conversion now happens before entrypoint rewriting, rather than converting the rewritten entrypoint args. - Image name->digest lookups are cached locally while resolving a single TaskRun's steps (with test!) - Entrypoint lookups also update the step's digest. This was a race before: if an image was pushed between resolution and pod start, the resolved command might be out-of-date. Some redundant test cases have been removed from taskrun_test.go -- this file should test only behavior of taskrun.go, which is now smaller. Unit tests for individual transformation behavior has been moved into individual test files in pkg/pod, with some integration tests in pod_test.go -- some of these could likely be removed as well, if we feel like it.
This is the next and largest step of the effort to simplify and separate MakePod out into digestible chunks (tektoncd#1605) Behavioral changes: - Script->Command conversion now happens before entrypoint rewriting, rather than converting the rewritten entrypoint args. - Image name->digest lookups are cached locally while resolving a single TaskRun's steps (with test!) - Entrypoint lookups also update the step's digest. This was a race before: if an image was pushed between resolution and pod start, the resolved command might be out-of-date. Some redundant test cases have been removed from taskrun_test.go -- this file should test only behavior of taskrun.go, which is now smaller. Unit tests for individual transformation behavior has been moved into individual test files in pkg/pod, with some integration tests in pod_test.go -- some of these could likely be removed as well, if we feel like it.
This is the next and largest step of the effort to simplify and separate MakePod out into digestible chunks (tektoncd#1605) Behavioral changes: - Script->Command conversion now happens before entrypoint rewriting, rather than converting the rewritten entrypoint args. - Image name->digest lookups are cached locally while resolving a single TaskRun's steps (with test!) - Entrypoint lookups also update the step's digest. This was a race before: if an image was pushed between resolution and pod start, the resolved command might be out-of-date. Some redundant test cases have been removed from taskrun_test.go -- this file should test only behavior of taskrun.go, which is now smaller. Unit tests for individual transformation behavior has been moved into individual test files in pkg/pod, with some integration tests in pod_test.go -- some of these could likely be removed as well, if we feel like it.
This is the next and largest step of the effort to simplify and separate MakePod out into digestible chunks (#1605) Behavioral changes: - Script->Command conversion now happens before entrypoint rewriting, rather than converting the rewritten entrypoint args. - Image name->digest lookups are cached locally while resolving a single TaskRun's steps (with test!) - Entrypoint lookups also update the step's digest. This was a race before: if an image was pushed between resolution and pod start, the resolved command might be out-of-date. Some redundant test cases have been removed from taskrun_test.go -- this file should test only behavior of taskrun.go, which is now smaller. Unit tests for individual transformation behavior has been moved into individual test files in pkg/pod, with some integration tests in pod_test.go -- some of these could likely be removed as well, if we feel like it.
This lists what MakePod does, in the ~ideal order. Before these changes things happened in jumbled order because it mostly happened in one huge wall of text. Afterwards I'd like to have one |
Today the |
Yeah I think that's expected behavior -- at least, I think that was the behavior before I started reorganizing |
After #1655 I think I'm comfortable declaring victory on this. We might want to move PipelineResource interactions into MakePod as well (prepending/appending steps for resources, applying parameter replacements), but at least those are already fairly well isolated into their own methods with clear tests. |
/reopen There are still a few TODOs associated with this issue-- this came up during review of #4598. It's not clear where mergeSteps should live; the TODO here would result in a circular import as this functionality is used in API validation which is a bit weird. @wlynch suggested moving into an internal package. |
@lbernick: Reopened this issue. In response to this:
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. |
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
Stale issues rot after 30d of inactivity. /lifecycle rotten Send feedback to tektoncd/plumbing. |
Related to #1519
Today, the conversion between TaskRun to a Pod jumbled together (mostly) inside
MakePod
, which is responsible for lots of different things. This makes it hard to understand, hard to test in isolation, and hard to make fixes and improvements.What
MakePod
does(roughly in the ideal order)
Applies
stepTemplate
stepTemplate.command
and.args
if the step specifies.script
stepTemplate
shouldn't apply tosidecars
, onlysteps
.Convert Steps with
script
to Containers withcommand
place-scripts
, which writes the user's scripts to/builder/scripts
Resolve image
ENTRYPOINT
from remote registry if the step doesnt' specify acommand
k8schain
Rewrite step
command
+args
to inject our entrypoint binaryplace-tools
, always./builder/tools
/builder/downward
script
conversion (today it happens before)Initialize credentials
creds-init
, if annotated creds are found in the service account's secrets/var/secrets/...
for each secret/builder/home
volume and (I think)HOME
env varmkdir
working dirs under/workspace
working-dir-init
, if any steps specify a relativeworkingDir
Apply resource requests/limits
Other minor operations
workingDir
to/workspace
if the user didn't specifyname
tostep-%s
(step name), or tostep-unnamed-%d
(step index) if not specifiedAfter these changes
/builder/
volumeMount paths to/tekton/
The text was updated successfully, but these errors were encountered: