-
Notifications
You must be signed in to change notification settings - Fork 83
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
Docker Improvements #489
Conversation
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...
Moving the opening of the socket after the certificate handling makes it even less likely we open it without needing it.
This ensures that we change the state, which allows waiting threads to make progress.
With this we can reduce the visibility of isConnected a little bit
There was a problem hiding this 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.
core/src/main/java/org/polypheny/db/docker/PolyphenyHandshakeClient.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/polypheny/db/docker/models/AutoDockerResult.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/polypheny/db/docker/models/AutoDockerStatus.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/polypheny/db/docker/DockerContainer.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/polypheny/db/docker/PolyphenyCertificateManager.java
Show resolved
Hide resolved
There was a problem hiding this 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!
Summary
Various improvements to the Docker subsystem, such as:
DockerUserException
which carries an appropriate HTTP status code for the response.DELETE
etc.See #94 for the UI changes.