-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Relates to: coder/coder#10352
Blocked by: #1094
Once we can track and react to dependencies between resources such as coder scripts, we need to allow scripts to register their dependencies on one another. At least two options are available:
- coder scripts can register themselves and their dependencies using a CLI command at runtime.
- templates can define dependencies in terraform, which are communicated to the agent on startup.
The first option has a lower burden on our long-term public API, in that it is easier to deprecate a new CLI command than it is to deprecate new attributes in our terraform provider.
As such, this issue represents the implementation of a CLI command that can register dependencies with a locally available coder agent and wait for the appropriate signal to proceed with execution.
To accomplish this:
- the dependency graph interface must be injected into the coder agent so that it is available to other workspace agent components
- workspace agents must listen for dependency registration on a locally available, well-known port range
- a new cli command must find and signal the well-known port in order to perform the actions described in add a graph to workspace agents that tracks dependencies between scripts #1093
Some form of simple script authentication might be necessary, but all scripts are able to register themselves and their dependencies, so no authz is limited to ensuring that scripts only act on themselves.