slub / ocrd_monitor

Web frontend for ocrd_manager
MIT License
2 stars 3 forks source link

Configurable Manager endpoint #31

Closed markusweigelt closed 1 year ago

markusweigelt commented 1 year ago

In monitor template ocrdmonitor/server/templates/jobs.html.j2 there is following js function with a fixed manager endpoint call. The manager endpoint should be configurable from outside.

function killjob(pid) {
    console.log(fetch(`http://ocrd-manager:4004/cancel_job/${pid}`));
}

Additionally the fetch should be a await call.

bertsky commented 1 year ago

Additionally the fetch should be a await call.

Yes, @SvenMarcus noticed that as well.

The manager endpoint should be configurable from outside.

Why? Monitor cannot run without Manager, so we can rely on the Docker network for the name resolution and internal port here.

markusweigelt commented 1 year ago

Yes, @SvenMarcus noticed that as well.

Indeed, due to this suggestion, I initiated the issue to complete the pull request without incorporating additional fixes and detailed enhancements.

Why? Monitor cannot run without Manager, so we can rely on the Docker network for the name resolution and internal port here.

I have some uncertainties regarding this matter. The image can function independently, without requiring the ocrd_kitodo repository or specific names in the Docker Compose setup. This opens up alternative possibilities. It's plausible that the containers operate on distinct networks or that a reverse proxy has been implemented to manage various services separately.

bertsky commented 1 year ago

I have some uncertainties regarding this matter. The image can function independently, without requiring the ocrd_kitodo repository or specific names in the Docker Compose setup. This opens up alternative possibilities. It's plausible that the containers operate on distinct networks or that a reverse proxy has been implemented to manage various services separately.

Indeed. And for the same reason, we already introduced CONTROLLER_HOST and CONTROLLER_PORT_SSH for the Manager. Since we already did introduce MANAGER_HOST and MANAGER_PORT_WEB, let's use it here.