Updating environment of an existing worker
A worker's environment (environment variables and command-line arguments) can only be set once when the worker is created. This is intentional as modifying them can lead to divergence as the worker's code can depend on them.
However, as we support updating workers, it is possible that an update introduces the need for a new environment variable and it is not possible to add it currently.
The following proposal would solve this:
- Add optional parameters to the worker update command (on all layers) to accept an updated list of environment variables / args.
- This should be made convenient on the user interface level, for example being able to list "additional env vars" without touching the existing ones, etc.
- The worker update command must allow updating to the same version if the user only wants to update the configuration
- Even if the version does not change but the environment does, worker executor must go through the usual process of attempting an update with the updated environment, which potentially can lead to divergence and fail.
Just to make sure i understand: does this only allow adding env vars and not modifying existing ones, or both possible but with different flags?
Note also that some auto-generated environment variables may already change during the lifetime of a worker (at least the component version). And during replay, this needs to be handled properly.
Now that we have per-component environment variables that can be applied to workers by updating them, I think it makes sense to support changing the per-worker environment variables too at the same time (by worker update).
I'm including this in milestone 1.3 as part of the "compositional initial state" epic.
@mschuwalow you've done this right?
Only the component-level environment variables can be updated currently. The initial environment variables a worker is started with cannot be updated currently