Mount file on batch change steps containers
Created by: jensim
User outcome and current workflow
It's frequent for users to run complex scripts or internal tools in batch changes. To do so today, they gave two choices:
- bake the script/ or binary inside the step container. This is painful and slows down iteration as it requires to rebuild the container.
- Use steps.file, which is also painful and slows down iteration. To convince yourself, paste a python script of a 100 line in a batch spec and fix the indentation :).
Proposal
Allow users to mount a file (a script, a binary of an internal tool) on the batch spec container. This means the user can iterate on the file easily, without needing to copy-paste it inside the spec, or rebuild a container.
One thing we need to figure out is caching. If the spec does not change, but the file changes, we should invalidate the cache.
This is discussed in RFC 560 REVIEW: Mount file on Batch Changes container
Additional context
Impacted customers (details in thread)
- https://github.com/sourcegraph/accounts/issues/8202
- https://github.com/sourcegraph/accounts/issues/1
- https://github.com/sourcegraph/accounts/issues/537
- https://github.com/sourcegraph/accounts/issues/544
-
https://github.com/sourcegraph/accounts/issues/278 (Use case: to replace all docker files by a specific docker file,
files:
is not convenient) - https://github.com/sourcegraph/accounts/issues/6859 because they need to run custom tooling, and it's currently brittle
Delivery plan
-
#31790 (closed) -
#37216 (closed) -
#31791 -
#31792 -
#31793 -
#37751 - Make sure template UI supports template with mounted files