-
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
Bug in example for build-pipeline: cp -r /workspace/output/builtImage/ fails #401
Comments
At the moment the output_resource module unconditionally adds a copy step for every output resource in the taskrun. However not every output resource will generate content to be copied. Limit the copy to PipelineResourceTypeStorage for now. This is meant as a hotfix for bug tektoncd#401 until an implementation of the image output resource is available via tektoncd#216. Until image resource output is implemented, any consumer won't have guarantee that the image has been actually built and pushed, and won't know the hash of the created image.
/assign |
@afrittoli: GitHub didn't allow me to assign the following users: afrittoli. Note that only knative members and repo collaborators can be assigned. 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. |
The problem I see here is that output_resource schedules a mkdir and copy steps for every output resource defined, regardless of the output type. The image resource output is not implemented yet (see #216) and thus the copy fails. An alternative fix would be to fail the pipeline run if an image is used as an output resource, until #216 is implemented. |
Thanks @afrittoli for taking a look! I think we should implement option 2, so until #216 is done there's little point in anyone thinking this tutorial will completely succeed - we should add comments to that effect in the readme and mention that the functionality here isn't complete (and that could be used to foster attention to implementing what's not quite finished). Reminded of #386 here and how important it is. How could we fail the pipeline? Do we have an existing not yet implemented mechanism that we could leverage? |
At the moment the output_resource module unconditionally adds a copy step for every output resource in the taskrun. However not every output resource will generate content to be copied. Limit the copy to Storage and Git outoputs for now. This is meant as a hotfix for bug tektoncd#401 until an implementation of the image output resource is available via tektoncd#216. Until image resource output is implemented, any consumer won't have guarantee that the image has been actually built and pushed, and won't know the hash of the created image.
@a-roberts Fair point. I prepared #414 nonetheless, because there's not official release yet. If we can aim to implement #216 before the next release it should be fine. |
/assign @afrittoli |
@shashwathi: GitHub didn't allow me to assign the following users: afrittoli. Note that only knative members and repo collaborators can be assigned. 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. |
thanks @shashwathi - I thought only collaborators had the "assign" power but anyone could be assigned... I should have read the bot reply more carefully |
At the moment the output_resource module unconditionally adds a copy step for every output resource in the taskrun. However not every output resource will generate content to be copied. Limit the copy to Storage and Git outoputs for now. This is meant as a hotfix for bug tektoncd#401 until an implementation of the image output resource is available via tektoncd#216. Until image resource output is implemented, any consumer won't have guarantee that the image has been actually built and pushed, and won't know the hash of the created image.
/assign @afrittoli |
@afrittoli: GitHub didn't allow me to assign the following users: afrittoli. Note that only knative members and repo collaborators can be assigned. 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. |
uhm, collaborators is not the same as "Contributor" obviously |
p.s. just a quick note: excellent write up @a-roberts, thanks for all the detail ❤️ ! |
At the moment the output_resource module unconditionally adds a copy step for every output resource in the taskrun. However not every output resource will generate content to be copied. Limit the copy to Storage and Git outoputs for now. This is meant as a hotfix for bug #401 until an implementation of the image output resource is available via #216. Until image resource output is implemented, any consumer won't have guarantee that the image has been actually built and pushed, and won't know the hash of the created image.
@a-roberts are you satisfied that this is fixed now that #414 is merged? |
Hey @afrittoli, gonna give it a try now, thanks! I assume I need to build from source as there's no release yet, I'll slack you if I run into any problems. |
If there's a task that uses the image as input and it takes it from a previous task, then we hit the copy step again: https://github.com/knative/build-pipeline/blob/master/pkg/reconciler/v1alpha1/taskrun/resources/input_resources.go#L89 Does that mean that copy actually happens twice for things like git? |
I've spent all day trying to get the PipelineRun tutorial to work although @mnuttall has wrote a simpler example that exercises your fix and that works perfect. He says all is well so I'm happy to close this off, cheers again 👍 |
Bump Golang to 1.14
Expected Behavior
All steps for the tutorial complete OK
Actual Behavior
this is taken from my colleague @jessm12's laptop, we're both working on the tutorial together and are hitting this problem. This error is from the final container (
build-step-source-copy-skaffold-image-leeroy-web
):\"cp -r /workspace/output/builtImage/. /pvc/build-skaffold-web/builtImage\" with arguments cp: can't stat '/workspace/output/builtImage/.': No such file or directory
being the problem.May need an additional task? If I look at what's at my PV's location on disk, this directory is indeed empty.
We think there's a bug here whereby the image isn't copied successfully, perhaps due to a missing task where we should make the directory?
Steps to Reproduce the Problem
resources.yaml
removing theresults
entry and we would like to make the example even easier to run on one's laptopkubectl
apply on therun/pipeline-run.yaml
: observe the error when the demo pipeline run pod fails (the last init container should error).Update: I've since added more notes here that may be of use for running this locally for ease of a reproduce.
Additional Info
My environment is Docker for Desktop on a Mac running the edge Docker driver.
I'm pushing the built image up to my public Docker registry (this works fine, I've configured it to use a secret and patched the service account).
Perhaps it's to do with permissions and a Docker for Desktop specific problem? Under "File Sharing" I have
/Users
,/Volumes
,/private
, and/tmp
as directories/subdirectories that can be bind mounded.For some context and what's been discussed already please see https://knative.slack.com/archives/CDCQ72D0R/p1547731362165400.
The text was updated successfully, but these errors were encountered: