What’s stopping you from using LS Deployment?
In any case, you can have a cancel event in your server that cancels the in-flight task. And then you can have the option to either roll back to the previous run (delete the in-flight checkpoints) or interrupt while retaining whatever progress was made (would be the default in this scenario).