Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker Improvements #489

Merged
merged 63 commits into from
Apr 18, 2024
Merged

Docker Improvements #489

merged 63 commits into from
Apr 18, 2024

Conversation

gartens
Copy link
Contributor

@gartens gartens commented Apr 12, 2024

Summary

Various improvements to the Docker subsystem, such as:

  • Getting rid of Map.of in favor of properly annotated records/classes
  • Handshakes are now identified by an id, not the hostname
  • Better error handling by introducing DockerUserException which carries an appropriate HTTP status code for the response.
  • Change the schema of the endpoints to contain the ids, be a bit more CRUD like and use HTTP verbs like DELETE etc.
  • Various other small improvements

See #94 for the UI changes.

gartens added 30 commits April 11, 2024 16:44
This is done first for the Handshakes, by introducing a nice
HandshakeInfo that also holds a DockerHost.  This commit also adds a
DockerUserException, the User part is to say, that it is something
nice that can be shown to users (i.e. in the frontend).
When restoring instances on startup, and this connection fails,
instances are added in the "NEW" state, without an UUID.  So check for
that.
This allows status codes to be communicated with the Exception.
Default status is 400 (Bad Request).
While here also add a helper for a common task: collect the Maps (soon to be proper records) for each DockerInstance.
The frontend now updates the entire state with getDockerInstance, which is also improved in this commit.
This gets rid of a bunch Map<String, Objects> everywhere.
They now all start with /docker/ and somewhat look like CRUD endpoints.  Some endpoints also use HTTP verbs like DELETE instead of everything being just GET/POST.

Also add a new docker/handshakes endpoint that returns all handshakes from the HandshakeManager.
The only regression is the change of hostnames, but instead of doing a handshake like before, one of the upcoming commits will change this to copy/move the encryption keys, which should always work (because it is the same instance).  Maybe it will also allow to change the ports...
Copy link
Member

@datomo datomo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @gartens, this looks very nice and clean.
With the minor things and one final reformat out of the way this should be good to go.

Copy link
Member

@vogti vogti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @gartens, for this PR!

@vogti vogti merged commit 07138c6 into master Apr 18, 2024
38 checks passed
@vogti vogti deleted the docker-improvements branch April 18, 2024 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants