* #155 refactor and synchronise writing to CodeOcean.
* Reduce complexity of input parsing.
* Update typo in internal/api/ws/codeocean_writer.go
Co-authored-by: Sebastian Serth <MrSerth@users.noreply.github.com>
* With `logger.level: TRACE`, the content of WebSocket messages is logged
together with the corresponding timestamp.
* The input is not further sanitized as this log level
is not intended for production use.
* Add statistics route for execution environments
* Add maximum to port api definition
Co-authored-by: Sebastian Serth <MrSerth@users.noreply.github.com>
* #9 Implement routes to list, get and delete execution environments.
A refactoring was required to introduce the ExecutionEnvironment interface.
* Fix MR comments, linting issues and bug that lead to e2e test failure
* Add e2e tests
* Add unit tests
* Change authorization header key
as the use of headers starting with X- has been deprecated in RFC6648.
* Update configuration.example.yaml
Co-authored-by: Sebastian Serth <MrSerth@users.noreply.github.com>
Previously, the execution.Storer interface was embedded in the Runner interface.
However, this resulted in calls like runner.Add(...) to add an execution to the
store which is kind of ugly. Thus, we decided to add only the required functions to
the runner interface and make the execution.Storer a field of the implementation.
Previously, the server sometimes crashed due to concurrent writes
to the websocket connection. Now, we ensure that only one concurrent
function writes to the websocket at a time by enclosing the WriteMessage
function with a mutex.
When the context passed to Nomad Allocation Exec is cancelled, the
process is not terminated. Instead, just the WebSocket connection is
closed. In order to terminate long-running processes, a special
character is injected into the standard input stream. This character is
parsed by the tty line discipline (tty has to be true). The line
discipline sends a SIGQUIT signal to the process, terminating it and
producing a core dump (in a file called 'core'). The SIGQUIT signal can
be caught but isn't by default, which is why the runner is destroyed if
the program does not terminate during a grace period after the signal
was sent.
We previously didn't really had any structure in our project apart
from creating a new folder for each package in our project root.
Now that we have accumulated some packages, we use the well-known
Golang project layout in order to clearly communicate our intent
with packages. See https://github.com/golang-standards/project-layout