From 097e276902c66c1d89dc93dcf6d674acba29a03f Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Thu, 11 Jan 2024 19:57:23 +0100 Subject: [PATCH 1/6] Makefile: Simplify rule for stop target by using container name Signed-off-by: Stefan Weil --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c537285..67b9943 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ run: docker compose exec app bash workflows/execute_workflows.sh > logs/run_$$(date +"%s").log 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 From 862249d370a36b317821038f5f6fd21c4219585c Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Thu, 11 Jan 2024 19:59:08 +0100 Subject: [PATCH 2/6] Add support for podman instead of docker Signed-off-by: Stefan Weil --- Makefile | 24 +++++++++++++++++------- README.md | 7 +++++-- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 67b9943..72f0a13 100644 --- a/Makefile +++ b/Makefile @@ -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 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: - docker container stop quiver-benchmarks_app && docker container rm quiver-benchmarks_app + $(DOCKER) container stop quiver-benchmarks_app && $(DOCKER) container rm quiver-benchmarks_app clean-workspaces: - docker compose exec app rm -rf workflows/workspaces + $(DOCKER_COMPOSE) exec app rm -rf workflows/workspaces clean-results: - docker compose exec app rm -rf workflows/nf-results workflows/results + $(DOCKER_COMPOSE) exec app rm -rf workflows/nf-results workflows/results clean: clean-workspaces clean-results @echo "Cleaning everything." diff --git a/README.md b/README.md index 6699a0f..11c1ada 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,9 @@ 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`. + 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 @@ -79,13 +82,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 From 858741aca7bf38df82f3748937e941c5bcd632a0 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Fri, 12 Jan 2024 10:20:49 +0100 Subject: [PATCH 3/6] Fix make start Signed-off-by: Stefan Weil --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 72f0a13..4dbda29 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ 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 From 432720c089d671908f61bcbca91c07ff45eed0dc Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sun, 14 Jan 2024 17:06:21 +0100 Subject: [PATCH 4/6] Makefile: Simplify rules for clean* targets Signed-off-by: Stefan Weil --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 4dbda29..40efb3c 100644 --- a/Makefile +++ b/Makefile @@ -27,10 +27,10 @@ stop: $(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." From ddc6ac830968af1bea8fb030dfa17c2c3924c209 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sun, 14 Jan 2024 17:07:01 +0100 Subject: [PATCH 5/6] Update documentation for podman-compose Signed-off-by: Stefan Weil --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 11c1ada..2a5bb44 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,9 @@ QuiVer Benchmarks is based on `ocrd/all:maximum` and has all OCR-D processors at 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. + 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 From 085674e734a3f8b3200955b1cc57bbc6b73c7836 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Thu, 18 Jan 2024 16:55:52 +0100 Subject: [PATCH 6/6] Update podman related documentation Signed-off-by: Stefan Weil --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2a5bb44..4f7ef22 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,8 @@ 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. +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