Verified Commit 33e426cf authored by Marius Göcke's avatar Marius Göcke
Browse files

non-code-updates

parent 176e8095
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7,4 +7,4 @@ Debian;docker.io/library/debian;13.4-slim
Syft;docker.io/anchore/syft;v1.41.2
Curl;docker.io/curlimages/curl;8.20.0
Betterleaks;ghcr.io/betterleaks/betterleaks;v1.4.1
SCBuilder;aniondev/scbuilder;v1.2.7
SCBuilder;aniondev/scbuilder;v1.2.8
+46 −0
Original line number Diff line number Diff line
---
name: product-knowledge
description: What SimpleOCR is, how this repository is structured and which mechanisms exist for building and testing it. Use this before fixing a defect or developing a feature in this repository, to know where things belong and how to verify a change.
---

# SimpleOCR

SimpleOCR makes the text of images and pdf-documents available: it recognizes the text (OCR) and returns it.
It exists in three shapes, and that is the structure of the repository.

## Structure of the repository

The repository follows the "common project structure": all sourcecode lives in code-units, and every code-unit
has its own `Other`-folder with its build-, quality-check- and reference-files. Use the
`work-with-common-project-structure`-skill when you need the details of that structure.

The code-units are:

- `SimpleOCRLibrary` - the recognition itself. Everything which is really about OCR belongs here, and only
  here.
- `SimpleOCRCLI` - the commandline-program. It parses the arguments (verb-based, see `ProgramStarter` and the
  `Verbs`-folder) and calls the library.
- `SimpleOCRService` - the api-server which offers the same functionality over http.

A rule which follows from that split: neither the CLI nor the service may contain recognition-logic. When
something has to be fixed about *how* text is recognized, it is fixed in the library and both other code-units
get the fix for free.

## The api-server

`SimpleOCRService` is a GRYLibrary-api-server like the backends of the other products (ConSurv, OpenDMS,
RSSArchivist), so the same rules apply: the middlewares, the maintenance-routes and the logging come from the
library, and `Program.cs` is the entrypoint (that file-name is used for every server here).

Whether the server binds every ip-address or only the loopback-interface is decided by
`ApplicationConstants.ListenOnEveryIP`. The integration-tests set it to `false`; a productive run needs it to
be `true`, otherwise the service is not reachable from outside its container.

## Building and testing

`scbuildcodeunits` builds everything: compile, tests, linting and security-checks. The task `task bb`
(`BaseBuildAllCodeunits`) does the same.

The testcases of the library work on files which are contained in the repository, so they need neither a
network nor an installed service. Keep it that way: a testcase which needs a running service belongs to the
service-code-unit, not to the library.

GitVersion.yml

deleted100644 → 0
+0 −33
Original line number Diff line number Diff line
assembly-versioning-scheme: MajorMinorPatch
assembly-file-versioning-scheme: MajorMinorPatch
major-version-bump-message: '\+semver:\s?(major)'
minor-version-bump-message: '\+semver:\s?(minor)'
patch-version-bump-message: '\+semver:\s?(patch)'
branches:
  main:
    regex: ^main$
    increment: None
    mode: ContinuousDelivery
    source-branches: ['main']
  stable:
    regex: ^stable$
    increment: Patch
    mode: ContinuousDelivery
    source-branches: ['main']
  feature:
    regex: ^feature\/\S+$
    increment: Minor
    mode: ContinuousDelivery
    source-branches: ['main']
  bug:
    regex: ^bug\/\S+$
    increment: Patch
    mode: ContinuousDelivery
    source-branches: ['main']
  other:
    regex: ^other\/\S+$
    increment: Patch
    mode: ContinuousDelivery
    source-branches: ['main']
ignore:
  sha: []
+1 −1
Original line number Diff line number Diff line
@@ -39,6 +39,6 @@ RUN chmod +x /Workspace/Other/EntryPoint/EntryPoint.sh
COPY SimpleOCR/HealthCheck.sh /Workspace/Other/EntryPoint
RUN chmod +x /Workspace/Other/EntryPoint/HealthCheck.sh

HEALTHCHECK CMD ./HealthCheck.sh
HEALTHCHECK --interval=30s --timeout=20s --start-period=2m CMD ./HealthCheck.sh

ENTRYPOINT ["./EntryPoint.sh"]
+2 −2
Original line number Diff line number Diff line
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net10.0</TargetFramework>
    <Authors>Marius Göcke</Authors>
@@ -62,7 +62,7 @@
    <PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
    <PackageReference Include="Swashbuckle.AspNetCore" Version="10.1.5" />
    <PackageReference Include="CommandLineParser" Version="2.9.1" />
    <PackageReference Include="GRYLibrary" Version="2.0.23" />
    <PackageReference Include="GRYLibrary" Version="2.0.27" />
    <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.5" />
    <PackageReference Include="Tesseract" Version="5.2.0" />
    <PackageReference Include="Magick.NET-Q16-AnyCPU" Version="14.12.0" />
Loading