slim containers, local or ocrd_network#468
Draft
bertsky wants to merge 38 commits intoOCR-D:masterfrom
Draft
Conversation
Co-authored-by: Stefan Weil <sw@weilnetz.de>
logging hack no longer needed with slim containers
Co-authored-by: Robert Sachunsky <38561704+bertsky@users.noreply.github.com>
…and fat-container Docker builds
- Config: remove `.dest` and `.dest_env` -
put generated files into default locations
(`docker-compose.yml` and `.env`)
- Config: remove `.run_network_dir` -
- Config: rename `environment.data_dir_host` to `data_dir`
- Config: add `environment.res_vol` (named volume for resources)
- Config.from_file: if no `processors` are configured, then
read from makefile-generated `ocrd-all-images.yaml` etc.
- VOLUMES_TEMPLATE: set `ocrd-resources.name` dynamically in `.env`
- PROCESSING_SERVER_TEMPLATE: do not generate PS config file via service YAML,
but introduce PROCESSING_SERVER_CONFIG_TEMPLATE w/ command `create-psconfig`
- PROCESSING_SERVER_TEMPLATE: add healthcheck
- RABBITMQ_TEMPLATE: add healthcheck
- MONGODB_TEMPLATE: add healthcheck
- DELEGATOR_PROCESSOR_TEMPLATE: differentiate runtime behaviour between
ocrd_network/client and standalone/local:
- if `.env` exists, try to parse it for `OCRD_PS_PORT`
- if `$DOCKER_RUN_POLICY` is set, then override `.env` detection
- if PS port is usable (and not overridden), behave as client
- otherwise behave as standalone Docker run for that image and executable
- in the latter case, if no `/data` volume has yet been mounted via
`DOCKER_RUN_OPTS` at build time (make variable) or at run time (shell variable),
then bind-mount the CWD
- make all (`delegate_docker`): build executable scripts via `create-client` in rules,
instead of config-driven general `create-clients` - covers non-processors as well,
and covers all processors for all enabled modules (not just those enabled in
network configuration)
- make all/images (`pullpolicy_docker`): add filesystem artifacts for Docker images, so
- images will not have to be re-built/pulled each time, but are timestamped
- we can also aggregate metadata (executable names, Docker profiles) for `network-setup`
- make ocrd-all-images.yaml: just aggregates all such artifact names
- each image rule: add `DOCKER_PROFILES` target-specific variable
- make docker-compose.yml: depend on `ocrd-all-images.yaml` etc.
- make .env: after `create-dotenv`, customize DOCKER_VOL_NAME and UID/GID
- make network-start, make network-stop: no dependency on config file here
(i.e. just an alias for standard `docker compose up --wait -d` / `down`;
`wait_for_startup` obsolete because of standard compose `healthcheck`)
Collaborator
Author
|
added 4 commits
July 6, 2025 02:25
- print diagnostics to stderr to avoid mixing with actual output - in standalone mode, be careful not to re-expand arguments via shell - in standalone mode, try to replace host-side with container-side path arguments
- in client mode, delegate to `ocrd network client workflow run` - in standalone mode, delegate to 'ocrd process' (which in turn will translate processor calls to standalone Docker run via installed processor delegators)
… for non-processors
joschrew
approved these changes
Jul 14, 2025
Contributor
joschrew
left a comment
There was a problem hiding this comment.
For me this works now, maybe some smaller parts could be optimized but generally I'd merge this
Co-authored-by: joschrew <91774427+joschrew@users.noreply.github.com>
Co-authored-by: joschrew <91774427+joschrew@users.noreply.github.com>
Co-authored-by: joschrew <91774427+joschrew@users.noreply.github.com>
This was referenced Aug 28, 2025
kba
reviewed
Sep 10, 2025
Co-authored-by: Konstantin Baierer <kba@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
builds upon both #465 and #449, merging both conceptually
idea is to still rely on Makefile as much as possible, allow user to switch between client (ocrd_network) and standalone (local Docker) behaviour for processors, but
run-networkconfiguration: only optional and less complicatedI therefore also removed the
processorsdefinitions from the example configs, as they are no longer needed – you can still reduce the enabled/active list via normalmake OCRD_MODULES=....Example usage:
build/pull images, install executables
As usual, do
If you want to disable some modules, or only enable a few, use
OCRD_MODULES=andDISABLED_MODULES=as usual. This can still be done vialocal.mk. For example, dorun standalone
If you did not generate a network setup so far (or already ran
network-cleanafterwards), processors should just spin up the local containers, as in #346.If you want to pass specific options to
docker run, then useDOCKER_RUN_OPTS. For example, if the default CWD=/data is not the best for you, consider:Notably, you can still use the
ocrdmulti-CLI binary here. Each container has its own alias, just prefixing the image e.g.For example:
run network
Just running…
…will create a
docker-compose.ymlfor all installed processors (along with the Processing Server etc), along with a.env(to be customised) andocrd-processing-server-config.yaml.If you want to use ODEM config file (with fewer processors), pass that:
To then start all services, do
If you were using a configuration file without preconfigured
processors, then the typical ocrd_all definitions of profiles are usable with the standard Docker Compose mechanism for profiles, e.g.Then any processor will normally talk to the Processing Server:
If you don't want that, for example because you need to know the installed resources, you can use the override variable:
To stop the services, don't forget to do
examples of generated files:
ocrd-all-images.yaml
.env
note: the latter overrides the previous settings for USER ID etc
ocrd/eynollah
venv/bin/ocrd-eynollah-segment
venv/bin/ocrd-process
docker-compose.yml