Skip to content

Docker update extension - #117

Open
LongusBongus wants to merge 11 commits into
masterfrom
docker-update-extension
Open

Docker update extension#117
LongusBongus wants to merge 11 commits into
masterfrom
docker-update-extension

Conversation

@LongusBongus

@LongusBongus LongusBongus commented Jun 25, 2026

Copy link
Copy Markdown

Backend now supports DWH updates for docker distributions, using the new version of AKTIN update agent aktin/debian-updateagent-pkg@main...docker-support.

Now different update handlers can be implemented in a modular and self-managed architecture, keeping changes to the actual DWH endpoints and function calls minimal.

The changes require a internal gateway passed inside compose.yml, which is also a new feature
aktin/docker-aktin-dwh@main...docker-update-extension

@LongusBongus
LongusBongus requested a review from akomii June 25, 2026 12:52
@LongusBongus LongusBongus self-assigned this Jun 25, 2026
@LongusBongus LongusBongus added the enhancement New feature or request label Jun 25, 2026

@rwm rwm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

bitte auch nochmal Alexander drüber schauen lassen

}

private boolean executeSocketOperation(int port) {
String host = getHost();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

warum ist der Host bekannt, aber nicht der Port?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

In der Realisierung eines Update Managers ist der Host konstant. Aber diese Methode wird dazu verwendet, verschiedene Ports anzusprechen. Darum kann der Host immer automatisch resolved werden, aber der Port muss zur jeweiligen Operation spezifiziert werden. Beispielsweise ruft der Debian Update Manager die Methode mit dem Port 1002 auf, wird das Apt-Update Socket angesprochen. Übergibt es nun den Port 1003 wird das DWH Update Socket angesprochen.

Comment thread admin-gui/src/main/webapp/plain/update.html
@github-project-automation github-project-automation Bot moved this from Todo to In Progress in AKTIN Project Jun 26, 2026
LongusBongus pushed a commit that referenced this pull request Jun 29, 2026
* for the socket-based update agent communication as well as the environment
* detection used by {@link UpdateManagerFactory}.</p>
*/
public abstract class AbstractUpdateManager implements IUpdateManager {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there another implementation of IUpdateManager? If not, why the split then?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The code can work without the interface Updater. With the interface in addition to the implementations, we get a logic layer that can be useful when it comes to creating other updaters not inheriting from AbstractUpdater. In this case it makes it easier to add other types of updaters to our code (open principle, or at least that was the idea).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

But does the abstraction right now reduce complexity or maintainability? Are other updaters already planned?---> YAGNI

boolean supports = this.supportsCurrentSystem();
LOGGER.log(Level.INFO, "Supports Current System: " + supports);
if (supports) {
reloadAptPackageLists();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this here? There should be either docker installation or deb installation

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This method still used the old naming for apt updates of debian dwhs. I changed it to refreshUpdateStatus() to make it generic. Also adapted the javadoc accordingly inside Updater.java

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Generic renaming would be a good idea. Is it already commited?

Comment on lines +36 to +39
@Override
public boolean supportsCurrentSystem() {
return Files.exists(Paths.get("/.dockerenv"));
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Other way around. A parent class should do this check and then decide which updatemanager to use

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I can implement that, but this would go against dependency-inversion principle, by the parent requiring knowledge of lower classes. It would also mean, we would have to change the code inside the parent class, to implement new realisations of Updater, going against the open-close principle.

Currently to add a new realisation of Updater, we would only need to create a class implementing Updater or inheriting from AbstractUpdater and give it the annotation @EnvironmentSpecific. This automatically loads it as a singleton bean and integrates ito the logic seeminglessly.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

DIP isnt about inheritance relationships, but that abstractions (interfaces) should not depend on details (implementations). With the parent manager and the child agent we would effectively have the factory pattern. The current code is rigid, because it was only designed for apt environments without debian in mind. Thats why some rewrites are necessary

Comment on lines +31 to +33
@Override
public boolean supportsCurrentSystem() {
return !Files.exists(Paths.get("/.dockerenv"));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why are two classes doing this check?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The two classes are different implementations of Updater. Each one self-responsively checks their compatibility to the current system. Currently debian-updater checks, if dockerenv does not exist and docker-updater check if it exists. I need to overhaul the logic for debian-updater tough, do you have an idea how to check if the current environment is a debian installation?

*/

@Singleton
public class UpdateManagerFactory {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A factory should be used for easy class initialization at runtime. In this case, the update manager need only to be initialized at startup once. A Service class could do that and the factory would not be necessary

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I changed the class name to UpdaterManager to clearify its function. The updater-beans are loaded automatically into the environment on application start up. This class finds them and returns the first updater-bean that supports the current environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

3 participants