[Workbench] Copy and re-run container request
Need a button on container request page that copies the container request to a new container request in "uncommitted" state so that user can modify inputs and re-run.
To keep this simple, the implementation should just create a new container request with the relevant fields (command, container_image, cwd, description, environment, mounts, name, output_path, runtime_constraints, scheduling_parameters), in "uncommitted" state, and then redirect to the new container request page.
To ensure the new request always results in a new run, use_existing should be false.
#7 Updated by Lucas Di Pentima almost 5 years ago
LGTM, just found a typo on a comment on
apps/workbench/app/controllers/container_requests_controller.rb:82: 'wriable' (same one as in
Was going to ask why we're creating a new instance and then doing an object duplication on ApplicationController's copy method, but then I saw that this is based on the same method existing on pipeline_instance, so I imagine that there's a good reason for doing it that way.
#8 Updated by Radhika Chippada almost 5 years ago
Fixed the typo.
Regarding "why we're creating a new instance and then doing an object duplication": This is not exactly a pure "copy" we are doing, but copy the state with the run results. Especially in this case, we are making a copy of the object and re-running it. I guess a "copy-to-rerun" or "copy-initial-state" would have been a better name for this "copy" method instead.