A further complication in my case is that I will not be changing the Activities themselves (each activity calls a python training script which is the one that is modified) so versioning might be difficult to use.
Versioning solves a completely different problem of updating workflow code while there are open long running workflows.
Temporal supports activity task routing to specific hosts. So you should be able to enforce the execution of activity 2 on the same host as activity 1. If the host goes down the whole sequence can be reexecuted on a different host. See the fileprocessing sample that demonstrates this pattern.
Sorry, I don’t think I depicted my issue correctly:
In my setup, it is not important that all activities be carried out on the same host (because the outputs of upstream activities are uploaded upon activity completion and downloaded by subsequent activities).
My problem is as follows: my workflow runs in a docker image which contains the python code called by the activity. Some workflow updates will mean that the python code is updated in a non-backward compatible way. This means that resuming previously running workflows with the updated python code should be prevented.
My question is: how to best make sure previously running jobs are interrupted, and restarted with the updated version ?