Workspace is responsible for setting up files for a job
Job is responsible for creating the command
Runner is responsible for bringing the workspace and job together
Coordinator is responsible for executing jobs in the right order
It might make sense to refactor these in terms of responsibilities:
Runner is responsible for taking a job (not a job and workspace, just a job), running it, and saying where we can get the output
for local builds, this probably just looks like managing the workspace
for remote builds, this looks like shipping the job definition and any necessary files to a remote executor, then downloading the result again (to be clear, remote builds are not part of this story!)
Workspace is responsible for isolating the file system as much as possible
it symlinks files into the working directory
it creates a fake HOME (see #62)
it symlinks any other jobs in
Job is responsible for command isolation
it isolates the PATH (see #61, or should Workspace maybe handle this?)
or maybe we should have some other kind of command that wraps std::process::Command that can do this wrapping for us?
Coordinator is responsible for the same things as before
This'll be a biggish refactor, but should mean we have better-defined responsibilities for all the components in the system.
Currently:
Workspace
is responsible for setting up files for a jobJob
is responsible for creating the commandRunner
is responsible for bringing the workspace and job togetherCoordinator
is responsible for executing jobs in the right orderIt might make sense to refactor these in terms of responsibilities:
Runner
is responsible for taking a job (not a job and workspace, just a job), running it, and saying where we can get the outputWorkspace
is responsible for isolating the file system as much as possibleHOME
(see #62)Job
is responsible for command isolationPATH
(see #61, or shouldWorkspace
maybe handle this?)std::process::Command
that can do this wrapping for us?Coordinator
is responsible for the same things as beforeThis'll be a biggish refactor, but should mean we have better-defined responsibilities for all the components in the system.