-
Notifications
You must be signed in to change notification settings - Fork 19
slim containers, local or ocrd_network #468
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
Draft
bertsky
wants to merge
34
commits into
OCR-D:master
Choose a base branch
from
bertsky:slim-cli-and-run-network
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
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
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`)
|
- 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
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.
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>
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-network
configuration: only optional and less complicatedI therefore also removed the
processors
definitions 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-clean
afterwards), 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
ocrd
multi-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.yml
for 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