pipeline icon indicating copy to clipboard operation
pipeline copied to clipboard

Provide a default emptyDir volume for TaskRuns

Open chitrangpatel opened this issue 1 year ago β€’ 2 comments

Feature request

Today, users generally declare workspaces for sharing data between Steps in a TaskRun. Tekton provides some implicit volume mounts that users are probably unaware of due to lack of documentation or against best practices. One such implicit mount is /tekton/home which is an emptyDir. Tekton does not use it for sharing any internal state between Tasks. It is there and most likely unused.

On behalf of the Data Interfaces WG: the request is to provide a variable replacement syntax (e.g. $(tekton.shared)) to the mount path of this emptyDir volume and document the use of this variable for our users.

  • This will make composing Taskruns for simple use cases easier (particularly now with StepActions).
    • e.g. a Task that does git-clone, image build and push would not need to declare a Workspace to share data between the two Steps.
    • Not having to provide Workspaces to a Task makes the TaskRun less dependent on kubernetisms.
  • Overall, it reduces the barrier to adoption for simple workflows when users new to Tekton and Kubernetes.

cc @wlynch @vdemeester @afrittoli

chitrangpatel avatar Jan 22 '24 20:01 chitrangpatel

Note that there is a "configuration" for default TaskRun workspace binding, see https://github.com/tektoncd/pipeline/blob/main/config/config-defaults.yaml#L75 πŸ‘ΌπŸΌ πŸ™ƒ . With this, it's very simple to support the use case of a single TaskRun with StepAction that does clone+build+… in on go, without having to worry on bounding the workspace.

vdemeester avatar Jan 24 '24 12:01 vdemeester

Ah! That's a good point. Does not require any changes in the controller.

chitrangpatel avatar Jan 24 '24 12:01 chitrangpatel