Introduce trusted artifacts#712
Conversation
36ebdaf to
d612aaa
Compare
|
It looks like you have accidentally formatted everything? There is a huge amount of non-related formatting changes in the PR. |
|
Have you performance tested this? Last I heard we were IO bound on the PVCs, and this has the potential to add significantly more PVC IO, especially for builds with a large number of dependencies. Is the plan to eventually move away from PVC storage altogether? |
This was on purpose (see the separate commit), I would still like to avoid that and from what it seems the .dotfiles are not included in the archive.
No I have not, but I can do some preliminary performance tests. I'm pretty sure that the performance will not improve with this.
Not something I can comment on, also not seeing how that would fit with Tekton's notion of a workspace, we would need to not use those to begin with. |
48c3cc8 to
afb009b
Compare
Would it not be possible to do it without OCI archives? When creating the artifact, use For some filesystems, writing lots of small files is much worse than one large file, so the Flashbacks to the time when extracting a 1.0 GiB git repo archive to an aws-efs volume took 30 minutes |
Oh! This reminds me of something. @zregvart, when a trusted artifact is being used, it should get extracted to an emptyDir that only the Task has access to. Otherwise, a Task running in parallel can change the contents after they've been verified. |
Given the change in[1], and the new data available in the attestation, we can create a chain of PipelineRun tasks that contributed to the image artifact being built. Namely, the `*_ARTIFACT` parameters of a task should reference the `*_ARTIFACT` results of a task whose artifact(s) it depends on. Given such a chain, we can examine if all the Tasks comprising that chain are acceptable. This assumes that any acceptable Task conforms to using _only_ the trusted artifacts when performing the its undertaking. reference: https://issues.redhat.com/browse/EC-252 [1] konflux-ci/build-definitions#712
64b442e to
017c2d0
Compare
If we are worried about parallel tasks then shouldn't the 'store' task also do all its processing in an off-PVC location? At the moment it writes the archive to the store directory, the gets the digest and moves it/writes the results. If we are worried about parallel tasks then in theory a parallel task could modify the archive between creation and the original task generating the digest. |
When restoring the archive from the store the hash of the archive is checked again, for this to be a concern a Task running in parallel would also need to be able to influence the |
Adds the use of trusted artifacts[1] to the Tasks and Pipelines. The `prefetch-dependencies` Task is no longer skipped based on the `hermetic` parameter -- it needs to run always to produce the trusted artifacts as the build* tasks depend on these, so if it were skipped the build* tasks would be skipped as well. With this the default value is set for the `*_ARTIFACT` parameters and the workspace will be unaltered by the `build-trusted-artifact` steps. This way it is simpler to opt-in to using trusted artifacts, and the default pipelines do so. Ref: https://issues.redhat.com/browse/EC-251 [1] https://github.com/redhat-appstudio/build-trusted-artifacts
017c2d0 to
af832bf
Compare
|
|
This will conflict with #771, so let's put this one on hold |
I mean if you have two task running in parallel, with either Basically at line 46 the archive has been created, but we have not yet calculated the digest. A malicious or erroneous task could in theory modify the archive at this point and we would not be able to detect it, as we have not yet calculated the sha. |
Only if the $TEMP directory is on the same PVC, right? That will not be the case. |
|
What do you mean by $TEMP? There is only a call to |
Right, thanks, I've created konflux-ci/build-trusted-artifacts#14 to fix that. I guess the original intent was to make sure that the archive was created on a filesystem with enough free space. Let's see if that becomes an issue at any point. |
|
Submitted a followup in #791, please have a look. I'll close this one as the discussion here will not be applicable over there in most comments. |
Given the change in[1], and the new data available in the attestation, we can create a chain of PipelineRun tasks that contributed to the image artifact being built. Namely, the `*_ARTIFACT` parameters of a task should reference the `*_ARTIFACT` results of a task whose artifact(s) it depends on. Given such a chain, we can examine if all the Tasks comprising that chain are acceptable. This assumes that any acceptable Task conforms to using _only_ the trusted artifacts when performing the its undertaking. reference: https://issues.redhat.com/browse/EC-252 [1] konflux-ci/build-definitions#712
Given the change in[1], and the new data available in the attestation, we can create a chain of PipelineRun tasks that contributed to the image artifact being built. Namely, the `*_ARTIFACT` parameters of a task should reference the `*_ARTIFACT` results of a task whose artifact(s) it depends on. Given such a chain, we can examine if all the Tasks comprising that chain are acceptable. This assumes that any acceptable Task conforms to using _only_ the trusted artifacts when performing the its undertaking. Reference: EC-252 [1] konflux-ci/build-definitions#712
Given the change in[1], and the new data available in the attestation, we can create a chain of PipelineRun tasks that contributed to the image artifact being built. Namely, the `*_ARTIFACT` parameters of a task should reference the `*_ARTIFACT` results of a task whose artifact(s) it depends on. Given such a chain, we can examine if all the Tasks comprising that chain are acceptable. This assumes that any acceptable Task conforms to using _only_ the trusted artifacts when performing the its undertaking. Reference: EC-252 [1] konflux-ci/build-definitions#712
Given the change in[1], and the new data available in the attestation, we can create a chain of PipelineRun tasks that contributed to the image artifact being built. Namely, the `*_ARTIFACT` parameters of a task should reference the `*_ARTIFACT` results of a task whose artifact(s) it depends on. Given such a chain, we can examine if all the Tasks comprising that chain are acceptable. This assumes that any acceptable Task conforms to using _only_ the trusted artifacts when performing the its undertaking. Reference: EC-252 [1] konflux-ci/build-definitions#712
Given the change in[1], and the new data available in the attestation, we can create a chain of PipelineRun tasks that contributed to the image artifact being built. Namely, the `*_ARTIFACT` parameters of a task should reference the `*_ARTIFACT` results of a task whose artifact(s) it depends on. Given such a chain, we can examine if all the Tasks comprising that chain are acceptable. This assumes that any acceptable Task conforms to using _only_ the trusted artifacts when performing the its undertaking. Reference: EC-252 [1] konflux-ci/build-definitions#712
Given the change in[1], and the new data available in the attestation, we can create a chain of PipelineRun tasks that contributed to the image artifact being built. Namely, the `*_ARTIFACT` parameters of a task should reference the `*_ARTIFACT` results of a task whose artifact(s) it depends on. Given such a chain, we can examine if all the Tasks comprising that chain are acceptable. This assumes that any acceptable Task conforms to using _only_ the trusted artifacts when performing the its undertaking. Reference: EC-252 [1] konflux-ci/build-definitions#712

Adds the use of trusted artifacts[1] to the Tasks and Pipelines. The
prefetch-dependenciesTask is no longer skipped based on thehermeticparameter -- it needs to run always to produce the trusted artifacts as the build* tasks depend on these, so if it were skipped the build* tasks would be skipped as well.This also includes one small bugfix in the
buildahtask, it no longer tries to pull thescratchimage.Ref: https://issues.redhat.com/browse/EC-251
[1] https://github.com/redhat-appstudio/build-trusted-artifacts