slub / ocrd_kitodo

Docker integration of Kitodo.Production and OCR-D
MIT License
10 stars 6 forks source link

Cannot launch without controller #70

Closed SvenMarcus closed 1 year ago

SvenMarcus commented 1 year ago

The ocrd-manager and ocrd-monitor services depend on the ocrd-controller service. Therefore, I cannot launch the docker compose configuration without activating the controller.

bertsky commented 1 year ago

Really? What error message do you get?

AFAIK (and by my experience) these dependencies have no effect for services from disabled profiles.

markusweigelt commented 1 year ago

If I delete the with-ocrd-controller profile from the Makefile and start it, all services except the controller are started. Is it different for you @SvenMarcus ?

bertsky commented 1 year ago

If I delete the with-ocrd-controller profile from the Makefile and start it

No need to edit the makefile! Just set COMPOSE_PROFILES in your shell.

markusweigelt commented 1 year ago

No need to edit the makefile! Just set COMPOSE_PROFILES in your shell.

That's the royal road for the test, it was sufficient. :innocent:

SvenMarcus commented 1 year ago

Oh sorry, it was a mistake on my part. I accidentally read the wrong line in the documentation when looking up the default profile and ended up assuming it was just manager/monitor 🙃

One thing that we need to have a look at though, is that I need to define the controller variables in my .env despite disabling the controller. I get the following errors:

WARN[0000] The "CONTROLLER_BASE_VERSION" variable is not set. Defaulting to a blank string.
WARN[0000] The "CONTROLLER_IMAGE" variable is not set. Defaulting to a blank string.
WARN[0000] The "CONTROLLER_ENV_UMASK" variable is not set. Defaulting to a blank string.
WARN[0000] The "CONTROLLER_WORKERS" variable is not set. Defaulting to a blank string.
WARN[0000] The "CONTROLLER_WORKERS" variable is not set. Defaulting to a blank string.
3 error(s) decoding:

* error decoding 'Volumes[1]': invalid spec: :/models: empty section between colons
* error decoding 'Volumes[2]': invalid spec: :/config: empty section between colons
* error decoding 'Volumes[3]': invalid spec: :/data: empty section between colons
markusweigelt commented 1 year ago

We could use $$ for these variables. The only problem is that there is no information if the variable is really empty.

https://docs.docker.com/compose/compose-file/compose-file-v2/#variable-substitution

bertsky commented 1 year ago

One thing that we need to have a look at though, is that I need to define the controller variables in my .env despite disabling the controller.

I don't see the problem. Some of these variables denote where to reach the external instance – they are used by the Manager and Monitor. The others are just ignored. Since the .env is just a default and you can set variables in your environment, it suffices to export CONTROLLER_HOST=my.host.com CONTROLLER_PORT_SSH=123. (And you can also use -e or --env-file customization.) No need to touch the (git-controlled) .env really, regardless of your profile.

I get the following errors:

How exactly does that happen?

markusweigelt commented 1 year ago

IMO this is about the variables and volumes that are not needed for the connection of an external controller.

The others are just ignored.

@SvenMarcus Do these warnings appear even though the controller profile is disable?

No need to touch the (git-controlled) .env really, regardless of your profile.

@bertsky In this case the warning is only suppressed because the variables are set for another use case. Why should a warning appear for variables that are not needed?

markusweigelt commented 1 year ago

Errors will be avoided with following pr https://github.com/slub/ocrd_controller/pull/27

markusweigelt commented 1 year ago

Problem is fixed and merge into the master branch of controller repo. Please reopen if there is still a problem here.