Skip to content

ocrd network CLI syntax and terminology #1032

@kba

Description

@kba

From #974 (comment)

@MehmedGIT:

Okay, another note that will potentially be raised soon. Currently, the supported processing-worker CLI is still the old one:

# 1.
$ ocrd processing-worker <processor-name> --queue=<queue-address> --database=<database-address>

# 2.
$ <processor-name> --queue=<queue-address> --database=<database-address>

We (me and @joschrew) are aware that in the spec there is a change that is not adapted here, yet:

# 1. Use ocrd CLI bundled with OCR-D/core
$ ocrd server <processor-name> --type=worker --queue=<queue-address> --database=<database-address>

# 2. Use processor name
$ <processor-name> --server --type=worker --queue=<queue-address> --database=<database-address>

Where the --type can be either: worker (processing worker)

ocrd server <processor-name> --type=worker --queue=<queue-address> --database=<database-address>

or server (the REST API wrapper based on #884).

ocrd server <processor-name> --type=server --database=<database-address>

However, it's a bad idea to extend the processing worker code to support the REST API processing server (aka standalone processing worker that has nothing to do with the bigger Processing Server in the spec and does not need the queues).

Now, try to imagine a good way to explain to the OCR-D community without confusing them:

  1. why the <processor-name> is a server, but is not a server when --type=worker and is referred to with processing-worker and no direct requests can be sent
  2. why the <processor-name> is a server, and actual server when --type=server and is referred to with processing-server
  3. why both are grouped together under ocrd server... or ... --server ... but potentially implemented together under processing_worker.py
  4. why Processing Server (PS-big) and processing servers (PS-small), standalone ocrd processors, are different concepts but both referred to with processing server.

Sounds confusing? It's even more when it has to be implemented in a clean way. So there are 3 main reasons to not adapt that yet:

  • The priority changed a bit and the higher priority now is to deploy working Processing Server, Workflow Server, and Workspace Server together on a live VM instance, so KITODO can use that to continue their development.
  • Identify and fix problems that arise when combining the 3 servers above from 2 different repositories (Processing-Server #974 and reference WebAPI impl).
  • To not complicate the current implementation without first trying to think how to separate concepts properly and avoid potential problems. Ideally:
  1. the standalone processing servers (aka server processing workers) should be implemented as a separate class (name suggestions?), sibling of ProcessingWorker, and both will share the common methods.
  2. the CLI for both should be separated with improved naming conventions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions