Skip to content
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

Add support and documentation for podman / podman-compose #28

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,26 +1,36 @@
ifeq ($(shell type podman-compose >/dev/null 2>&1 && echo y),)
# Use docker / docker compose
DOCKER_COMPOSE=docker compose
DOCKER=docker
else
# Use podman / podman-compose
DOCKER_COMPOSE=podman-compose
DOCKER=podman
endif

.PHONY: build clean clean-results clean-workspaces prepare-default-gt run start stop

build:
docker compose build
$(DOCKER_COMPOSE) build

start:
docker compose run -d app
$(DOCKER_COMPOSE) run -d --name quiver-benchmarks_app app

prepare-default-gt:
docker compose exec app bash scripts/prepare.sh
$(DOCKER_COMPOSE) exec app bash scripts/prepare.sh

run:
mkdir -p logs
docker compose exec app bash workflows/execute_workflows.sh > logs/run_$$(date +"%s").log
$(DOCKER_COMPOSE) exec app bash workflows/execute_workflows.sh > logs/run_$$(date +"%s").log 2>&1

stop:
CONTAINER_ID=$$(docker ps | grep quiver | cut -d' ' -f1); docker container stop $$CONTAINER_ID && docker container rm $$CONTAINER_ID
$(DOCKER) container stop quiver-benchmarks_app && $(DOCKER) container rm quiver-benchmarks_app

clean-workspaces:
docker compose exec app rm -rf workflows/workspaces
rm -rf workflows/workspaces

clean-results:
docker compose exec app rm -rf workflows/nf-results workflows/results
rm -rf workflows/nf-results workflows/results

clean: clean-workspaces clean-results
@echo "Cleaning everything."
@echo "Cleaned everything."
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ QuiVer Benchmarks is based on `ocrd/all:maximum` and has all OCR-D processors at
- [Docker Compose plugin](https://docs.docker.com/compose/install/linux/#install-using-the-repository)
- make

Instead of Docker it is also possible to use podman and podman-compose.
Install them on Debian or Ubuntu with `apt install podman podman-compose`.

Note: Debian bookworm installs an older version (1.0.3) of `podman-compose`
which is unusable. Therefore `podman-compose` must be installed from PyPI
unless a newer Linux distribution with `podman-compose` 1.0.6 is used.

To speed up QuiVer Benchmarks you can mount already downloaded text recognition models to `/usr/local/share/ocrd-resources/` in `docker-compose.yml` by adding

```yml
Expand Down Expand Up @@ -79,13 +86,13 @@ Add new OCR-D workflows to the directory `workflows/ocrd_workflows` according to
- workflows have to be TXT files
- all workflows have to use [`ocrd process`](https://ocr-d.de/en/user_guide#ocrd-process)

You can then either rebuild the Docker image via `docker compose build` or mount the directory to the container via
You can then either rebuild the Docker image via `make build` or mount the directory to the container via

```yml
- ./workflows/ocrd_workflows:/app/workflows/ocrd_workflows
```

in the `volumes` section and spin up a new run with `docker compose up`.
in the `volumes` section and spin up a new run with `docker compose up` or `podman-compose up`.

### Removing OCR-D Workflows

Expand Down