Execute commands in runner via WebSocket

This enables executing commands in runners and forwarding input and
output between the runner and the websocket to the client.

Co-authored-by: Maximilian Paß <maximilian.pass@student.hpi.uni-potsdam.de>
This commit is contained in:
Konrad Hanff
2021-05-20 08:47:51 +02:00
parent 892f902377
commit 3afcdeaba8
10 changed files with 479 additions and 78 deletions

View File

@@ -16,6 +16,10 @@ var (
type EnvironmentId int
func (e EnvironmentId) toString() string {
return string(rune(e))
}
type NomadJobId string
// Manager keeps track of the used and unused runners of all execution environments in order to provide unused runners to new clients and ensure no runner is used twice.
@@ -153,7 +157,7 @@ func (m *NomadRunnerManager) unusedRunners(environmentId EnvironmentId, fetchedR
if !ok {
_, ok = job.idleRunners.Get(runnerId)
if !ok {
newRunners = append(newRunners, NewRunner(runnerId))
newRunners = append(newRunners, NewNomadAllocation(runnerId, m.apiClient))
}
}
}