From ff6b289d94fc2edbbd36224eaf081872a2e84ec3 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Mon, 6 Feb 2023 20:15:52 +0100 Subject: [PATCH 01/53] =?UTF-8?q?=F0=9F=9A=A7=20Use=20Ubuntu=2022.04?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Building opencv-python-headless takes ages, try to use the latest Ubuntu LTS to avoid that. --- Dockerfile-core | 2 +- Dockerfile-core-cuda10.0 | 2 +- Dockerfile-core-cuda10.1 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile-core b/Dockerfile-core index 443db85..26c012a 100644 --- a/Dockerfile-core +++ b/Dockerfile-core @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:22.04 ARG PIP_INSTALL="pip install --no-cache-dir" ARG OCRD_VERSION_MINIMUM="2.23.3" diff --git a/Dockerfile-core-cuda10.0 b/Dockerfile-core-cuda10.0 index f1a2d60..c620a65 100644 --- a/Dockerfile-core-cuda10.0 +++ b/Dockerfile-core-cuda10.0 @@ -1,4 +1,4 @@ -FROM nvidia/cuda:10.0-cudnn7-runtime-ubuntu18.04 +FROM nvidia/cuda:10.0-cudnn7-runtime-ubuntu22.04 ARG PIP_INSTALL="pip install --no-cache-dir" ARG OCRD_VERSION_MINIMUM="2.23.3" diff --git a/Dockerfile-core-cuda10.1 b/Dockerfile-core-cuda10.1 index 569a567..594aa2a 100644 --- a/Dockerfile-core-cuda10.1 +++ b/Dockerfile-core-cuda10.1 @@ -1,4 +1,4 @@ -FROM nvidia/cuda:10.1-cudnn7-runtime-ubuntu18.04 +FROM nvidia/cuda:10.1-cudnn7-runtime-ubuntu22.04 ARG PIP_INSTALL="pip install --no-cache-dir" ARG OCRD_VERSION_MINIMUM="2.23.3" From 9ca6463f8bf71bc28418276e9b9f719e4e027a28 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Tue, 7 Feb 2023 11:30:28 +0100 Subject: [PATCH 02/53] =?UTF-8?q?=F0=9F=9A=A7=20build:=20Install=20pip=20f?= =?UTF-8?q?or=20Python=203.10?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile-core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile-core b/Dockerfile-core index 26c012a..12d91f4 100644 --- a/Dockerfile-core +++ b/Dockerfile-core @@ -33,7 +33,7 @@ RUN echo "setOverrideLogLevel(os.getenv('LOG_LEVEL', 'INFO'))" >/etc/ocrd_loggin # We use get-pip.py here to avoid # a. having to upgrade from Ubuntu's pip # b. the dreaded "old script wrapper" error message -RUN curl -sSL https://bootstrap.pypa.io/pip/3.6/get-pip.py -o get-pip.py && \ +RUN curl -sSL https://bootstrap.pypa.io/pip/3.10/get-pip.py -o get-pip.py && \ python3 get-pip.py && \ rm -f get-pip.py From 06e373847e65ce59563518e7c863c48cfd709464 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Tue, 7 Feb 2023 11:36:48 +0100 Subject: [PATCH 03/53] =?UTF-8?q?=F0=9F=9A=A7=20build:=20Install=20pip=20f?= =?UTF-8?q?or=20Python=203.10?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile-core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile-core b/Dockerfile-core index 12d91f4..e4272aa 100644 --- a/Dockerfile-core +++ b/Dockerfile-core @@ -33,7 +33,7 @@ RUN echo "setOverrideLogLevel(os.getenv('LOG_LEVEL', 'INFO'))" >/etc/ocrd_loggin # We use get-pip.py here to avoid # a. having to upgrade from Ubuntu's pip # b. the dreaded "old script wrapper" error message -RUN curl -sSL https://bootstrap.pypa.io/pip/3.10/get-pip.py -o get-pip.py && \ +RUN curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \ python3 get-pip.py && \ rm -f get-pip.py From 620d8593b8777332353155e28ce4926e59bf6d05 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Wed, 8 Feb 2023 12:21:51 +0100 Subject: [PATCH 04/53] =?UTF-8?q?=F0=9F=9A=A7=20Remove=20data=20submodule?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data | 1 - 1 file changed, 1 deletion(-) delete mode 160000 data diff --git a/data b/data deleted file mode 160000 index 9ab08a3..0000000 --- a/data +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9ab08a3626dde1d38dd622b65e425277cd029722 From 5b73c0ce6d620a10289d745e092a1d8691b0bf49 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Wed, 8 Feb 2023 12:35:57 +0100 Subject: [PATCH 05/53] =?UTF-8?q?=F0=9F=9A=A7=20Install=20pyenv?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile-core | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Dockerfile-core b/Dockerfile-core index e4272aa..b0f2b89 100644 --- a/Dockerfile-core +++ b/Dockerfile-core @@ -29,14 +29,17 @@ RUN echo "APT::Acquire::Retries \"3\";" > /etc/apt/apt.conf.d/80-retries && \ RUN echo "setOverrideLogLevel(os.getenv('LOG_LEVEL', 'INFO'))" >/etc/ocrd_logging.py -# Install pip (and setuptools) -# We use get-pip.py here to avoid -# a. having to upgrade from Ubuntu's pip -# b. the dreaded "old script wrapper" error message -RUN curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \ - python3 get-pip.py && \ - rm -f get-pip.py - +# Install pyenv +# TODO: do not run as root +# TODO: does just saying "3.7" work as intended? +ENV HOME=/root +ENV PYENV_ROOT=$HOME/.pyenv +ENV PATH=$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH +RUN \ + git clone --depth=1 git://github.com/yyuu/pyenv.git .pyenv && \ + pyenv install 3.7 && \ + pyenv global 3.7 && \ + pyenv rehash # Install pip installable-stuff RUN ${PIP_INSTALL} \ From e592a84e3bae7036bbab453f1a8ad6543e12fd3d Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Wed, 8 Feb 2023 12:38:20 +0100 Subject: [PATCH 06/53] =?UTF-8?q?=F0=9F=9A=A7=20Install=20pyenv?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile-core | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile-core b/Dockerfile-core index b0f2b89..b88315e 100644 --- a/Dockerfile-core +++ b/Dockerfile-core @@ -9,10 +9,10 @@ ENV PIP_DEFAULT_TIMEOUT=120 RUN echo "APT::Acquire::Retries \"3\";" > /etc/apt/apt.conf.d/80-retries && \ apt-get update && \ apt-get install -y \ - curl xz-utils \ - build-essential python3-dev \ -# For get-pip.py: - python3-distutils \ + build-essential \ + curl \ + git \ + xz-utils \ # For add-apt-repository: software-properties-common \ # XML utils From 6fba90d49a529d5539b5fd4244a54045f269b40e Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Wed, 8 Feb 2023 12:55:02 +0100 Subject: [PATCH 07/53] =?UTF-8?q?=F0=9F=9A=A7=20Install=20pyenv?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile-core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile-core b/Dockerfile-core index b88315e..d87f5c8 100644 --- a/Dockerfile-core +++ b/Dockerfile-core @@ -36,7 +36,7 @@ ENV HOME=/root ENV PYENV_ROOT=$HOME/.pyenv ENV PATH=$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH RUN \ - git clone --depth=1 git://github.com/yyuu/pyenv.git .pyenv && \ + git clone --depth=1 https://github.com/yyuu/pyenv.git .pyenv && \ pyenv install 3.7 && \ pyenv global 3.7 && \ pyenv rehash From 55ebfb807a5a9cb2ef2502afd123653a39120a5d Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Wed, 8 Feb 2023 13:00:36 +0100 Subject: [PATCH 08/53] =?UTF-8?q?=F0=9F=9A=A7=20Install=20pyenv?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile-core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile-core b/Dockerfile-core index d87f5c8..9b35ec2 100644 --- a/Dockerfile-core +++ b/Dockerfile-core @@ -36,7 +36,7 @@ ENV HOME=/root ENV PYENV_ROOT=$HOME/.pyenv ENV PATH=$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH RUN \ - git clone --depth=1 https://github.com/yyuu/pyenv.git .pyenv && \ + git clone --depth=1 https://github.com/yyuu/pyenv.git $HOME/.pyenv && \ pyenv install 3.7 && \ pyenv global 3.7 && \ pyenv rehash From e608fdae1d397b0b489143253dc79e27a6f00d3f Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Wed, 8 Feb 2023 14:18:30 +0100 Subject: [PATCH 09/53] =?UTF-8?q?=F0=9F=9A=A7=20Install=20pyenv?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile-core | 19 ++++++++++++++++--- build | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Dockerfile-core b/Dockerfile-core index 9b35ec2..65ac56a 100644 --- a/Dockerfile-core +++ b/Dockerfile-core @@ -20,6 +20,17 @@ RUN echo "APT::Acquire::Retries \"3\";" > /etc/apt/apt.conf.d/80-retries && \ xmlstarlet \ # OCR-D uses ImageMagick for pixel density estimation imagemagick \ +# pyenv builds +# TODO: builder container? + libz-dev \ + libssl-dev \ + libbz2-dev \ + liblzma-dev \ + libncurses-dev \ + libffi-dev \ + libreadline-dev \ + libsqlite3-dev \ + libmagic-dev \ && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* @@ -33,13 +44,15 @@ RUN echo "setOverrideLogLevel(os.getenv('LOG_LEVEL', 'INFO'))" >/etc/ocrd_loggin # TODO: do not run as root # TODO: does just saying "3.7" work as intended? ENV HOME=/root -ENV PYENV_ROOT=$HOME/.pyenv +ENV PYENV_ROOT=/usr/local/share/pyenv ENV PATH=$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH RUN \ - git clone --depth=1 https://github.com/yyuu/pyenv.git $HOME/.pyenv && \ + git clone --depth=1 https://github.com/yyuu/pyenv.git $PYENV_ROOT && \ pyenv install 3.7 && \ pyenv global 3.7 && \ - pyenv rehash + pyenv rehash && \ + pip install -U pip && \ + pip install setuptools # Install pip installable-stuff RUN ${PIP_INSTALL} \ diff --git a/build b/build index 3c713e5..0262066 100755 --- a/build +++ b/build @@ -45,7 +45,7 @@ get_from_web() { download_to --strip-components 1 'https://qurator-data.de/eynollah/models_eynollah.tar.gz' 'eynollah' } . $self_dir/qurator_data_lib.sh -handle_data +#handle_data From 807eb3eadfd9e1ae2e42c72447105ba8fe75276e Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Wed, 8 Feb 2023 14:20:21 +0100 Subject: [PATCH 10/53] =?UTF-8?q?=F0=9F=9A=A7=20Do=20not=20use=20data=20su?= =?UTF-8?q?bmodule?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitmodules | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index a08c53c..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "data"] - path = data - url = git@code.dev.sbb.berlin:qurator/qurator-data.git From 08a0398e37c59067ca67a088d499810ff85ad36d Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Wed, 8 Feb 2023 14:44:17 +0100 Subject: [PATCH 11/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Build=20a=20seco?= =?UTF-8?q?nd=20container=20image?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 920e0b0..865cc62 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,11 +26,24 @@ jobs: # TODO matrix for all Dockerfiles - - name: Build + name: Build core uses: docker/build-push-action@v4 with: context: . file: Dockerfile-core build-args: DRONE_COMMIT=${{ github.sha }} - push: false + push: true + tags: + - ${{ github.sha }} + - + name: Build dinglehopper + uses: docker/build-push-action@v4 + with: + context: . + file: Dockerfile-dinglehopper + build-args: + DRONE_COMMIT=${{ github.sha }} + push: true + tags: + - ${{ github.sha }} From 648414d9f9dfd6c53195f722a84e73492cd9fcf4 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Wed, 8 Feb 2023 14:53:07 +0100 Subject: [PATCH 12/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Build=20a=20seco?= =?UTF-8?q?nd=20container=20image?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 865cc62..54e1dfa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,8 +34,7 @@ jobs: build-args: DRONE_COMMIT=${{ github.sha }} push: true - tags: - - ${{ github.sha }} + tags: ${{ github.sha }} - name: Build dinglehopper uses: docker/build-push-action@v4 @@ -45,5 +44,4 @@ jobs: build-args: DRONE_COMMIT=${{ github.sha }} push: true - tags: - - ${{ github.sha }} + tags: ${{ github.sha }} From a478b9bd47f215c25fe061ffb69330bd276aceb9 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Wed, 8 Feb 2023 14:58:40 +0100 Subject: [PATCH 13/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Do=20not=20attem?= =?UTF-8?q?pt=20to=20push=20for=20now?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 54e1dfa..14778c7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,7 +33,7 @@ jobs: file: Dockerfile-core build-args: DRONE_COMMIT=${{ github.sha }} - push: true + push: false tags: ${{ github.sha }} - name: Build dinglehopper @@ -43,5 +43,5 @@ jobs: file: Dockerfile-dinglehopper build-args: DRONE_COMMIT=${{ github.sha }} - push: true + push: false tags: ${{ github.sha }} From 40430c5150312a0b331fcd88ee6516424ddb2d72 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Wed, 8 Feb 2023 16:46:15 +0100 Subject: [PATCH 14/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Push=20image?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 14778c7..2835bf4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,12 @@ jobs: # TODO data # TODO matrix for all Dockerfiles - + - + name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build core uses: docker/build-push-action@v4 @@ -33,7 +38,7 @@ jobs: file: Dockerfile-core build-args: DRONE_COMMIT=${{ github.sha }} - push: false + push: true tags: ${{ github.sha }} - name: Build dinglehopper @@ -43,5 +48,5 @@ jobs: file: Dockerfile-dinglehopper build-args: DRONE_COMMIT=${{ github.sha }} - push: false + push: true tags: ${{ github.sha }} From f79551b485b32e0d27da57eff1093439d502268c Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Wed, 8 Feb 2023 17:02:09 +0100 Subject: [PATCH 15/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Push=20image?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2835bf4..72f26f3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,7 +39,7 @@ jobs: build-args: DRONE_COMMIT=${{ github.sha }} push: true - tags: ${{ github.sha }} + tags: quratorspk/ocrd-galley-core:${{ github.sha }} - name: Build dinglehopper uses: docker/build-push-action@v4 @@ -49,4 +49,4 @@ jobs: build-args: DRONE_COMMIT=${{ github.sha }} push: true - tags: ${{ github.sha }} + tags: quratorspk/ocrd-galley-dinglehopper:${{ github.sha }} From 2e027d015d04ae65bb7b1d009e4e11296181ad2f Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Wed, 8 Feb 2023 17:45:16 +0100 Subject: [PATCH 16/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Use=20a=20matrix?= =?UTF-8?q?=20build=20to=20DRY?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 72f26f3..2ef07fa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,6 +10,9 @@ on: jobs: docker: + strategy: + matrix: + subimage: ["core", "dinglehopper"] # core images need to come first! runs-on: ubuntu-latest steps: - @@ -23,7 +26,6 @@ jobs: uses: docker/setup-buildx-action@v2 # TODO data - # TODO matrix for all Dockerfiles - name: Login to Docker Hub uses: docker/login-action@v2 @@ -31,22 +33,12 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build core + name: Build ${{ matrix.subimage }} uses: docker/build-push-action@v4 with: context: . - file: Dockerfile-core + file: Dockerfile-${{ matrix.subimage }} build-args: DRONE_COMMIT=${{ github.sha }} push: true - tags: quratorspk/ocrd-galley-core:${{ github.sha }} - - - name: Build dinglehopper - uses: docker/build-push-action@v4 - with: - context: . - file: Dockerfile-dinglehopper - build-args: - DRONE_COMMIT=${{ github.sha }} - push: true - tags: quratorspk/ocrd-galley-dinglehopper:${{ github.sha }} + tags: quratorspk/ocrd-galley-${{ matrix.subimage }}:${{ github.sha }} From e591342b3e050a4a0ebfa9ce4a43c660bbb83873 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Wed, 8 Feb 2023 17:55:52 +0100 Subject: [PATCH 17/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Use=20a=20matrix?= =?UTF-8?q?=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 39 +++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2ef07fa..b6a8ab4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,22 +9,21 @@ on: - 'test/github-actions' jobs: - docker: + build-core: strategy: matrix: - subimage: ["core", "dinglehopper"] # core images need to come first! + subimage: ["core"] runs-on: ubuntu-latest + # TODO reuse workflow for core + rest steps: - name: Checkout uses: actions/checkout@v3 # We are checking out explicitly, so build-push-action isn't trying # to checkout the (unreachable) submodule. (Using "context" there.) - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - # TODO data - name: Login to Docker Hub @@ -42,3 +41,35 @@ jobs: DRONE_COMMIT=${{ github.sha }} push: true tags: quratorspk/ocrd-galley-${{ matrix.subimage }}:${{ github.sha }} + + build-rest: + needs: build-core + strategy: + matrix: + subimage: ["dinglehopper"] + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v3 + # We are checking out explicitly, so build-push-action isn't trying + # to checkout the (unreachable) submodule. (Using "context" there.) + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - + name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build ${{ matrix.subimage }} + uses: docker/build-push-action@v4 + with: + context: . + file: Dockerfile-${{ matrix.subimage }} + build-args: + DRONE_COMMIT=${{ github.sha }} + push: true + tags: quratorspk/ocrd-galley-${{ matrix.subimage }}:${{ github.sha }} From 0022e4a275785803c3d516040d063c9148e3232c Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Wed, 8 Feb 2023 18:08:49 +0100 Subject: [PATCH 18/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Use=20reusable?= =?UTF-8?q?=20workflow=20to=20build=20both=20core=20+=20rest=20of=20images?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-subimage.yml | 41 ++++++++++++++++++ .github/workflows/build.yml | 63 ++++------------------------ 2 files changed, 49 insertions(+), 55 deletions(-) create mode 100644 .github/workflows/build-subimage.yml diff --git a/.github/workflows/build-subimage.yml b/.github/workflows/build-subimage.yml new file mode 100644 index 0000000..c076a14 --- /dev/null +++ b/.github/workflows/build-subimage.yml @@ -0,0 +1,41 @@ +on: + workflow_call: + inputs: + subimage: + required: true + type: string + secrets: + DOCKERHUB_USERNAME: + required: true + DOCKERHUB_PASSWORD: + required: true + + +jobs: + build-subimage-job: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v3 + # We are checking out explicitly, so build-push-action isn't trying + # to checkout the (unreachable) submodule. (Using "context" there.) + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - + name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build ${{ inputs.subimage }} + uses: docker/build-push-action@v4 + with: + context: . + file: Dockerfile-${{ inputs.subimage }} + build-args: + DRONE_COMMIT=${{ github.sha }} + push: true + tags: quratorspk/ocrd-galley-${{ inputs.subimage }}:${{ github.sha }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b6a8ab4..e41634f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,63 +13,16 @@ jobs: strategy: matrix: subimage: ["core"] - runs-on: ubuntu-latest - # TODO reuse workflow for core + rest - steps: - - - name: Checkout - uses: actions/checkout@v3 - # We are checking out explicitly, so build-push-action isn't trying - # to checkout the (unreachable) submodule. (Using "context" there.) - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - # TODO data - - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build ${{ matrix.subimage }} - uses: docker/build-push-action@v4 - with: - context: . - file: Dockerfile-${{ matrix.subimage }} - build-args: - DRONE_COMMIT=${{ github.sha }} - push: true - tags: quratorspk/ocrd-galley-${{ matrix.subimage }}:${{ github.sha }} + uses: ./.github/workflows/build-subimage.yml + with: + subimage: ${{ matrix.subimage }} + secrets: inherit build-rest: - needs: build-core strategy: matrix: subimage: ["dinglehopper"] - runs-on: ubuntu-latest - steps: - - - name: Checkout - uses: actions/checkout@v3 - # We are checking out explicitly, so build-push-action isn't trying - # to checkout the (unreachable) submodule. (Using "context" there.) - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build ${{ matrix.subimage }} - uses: docker/build-push-action@v4 - with: - context: . - file: Dockerfile-${{ matrix.subimage }} - build-args: - DRONE_COMMIT=${{ github.sha }} - push: true - tags: quratorspk/ocrd-galley-${{ matrix.subimage }}:${{ github.sha }} + uses: ./.github/workflows/build-subimage.yml + with: + subimage: ${{ matrix.subimage }} + secrets: inherit From 6bcbba036d15b4600489364bab1669b32a0fbc90 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Wed, 8 Feb 2023 18:13:11 +0100 Subject: [PATCH 19/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Explicitly=20pas?= =?UTF-8?q?s=20secrets?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e41634f..5ac9d64 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,9 @@ jobs: uses: ./.github/workflows/build-subimage.yml with: subimage: ${{ matrix.subimage }} - secrets: inherit + secrets: + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} build-rest: strategy: @@ -25,4 +27,6 @@ jobs: uses: ./.github/workflows/build-subimage.yml with: subimage: ${{ matrix.subimage }} - secrets: inherit + secrets: + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} From b742a0d471fc32bc63cd0f11358891219d4bc796 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Wed, 8 Feb 2023 18:14:57 +0100 Subject: [PATCH 20/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Fix=20inheriting?= =?UTF-8?q?=20secrets...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-subimage.yml | 2 +- .github/workflows/build.yml | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-subimage.yml b/.github/workflows/build-subimage.yml index c076a14..eaa3ed4 100644 --- a/.github/workflows/build-subimage.yml +++ b/.github/workflows/build-subimage.yml @@ -7,7 +7,7 @@ on: secrets: DOCKERHUB_USERNAME: required: true - DOCKERHUB_PASSWORD: + DOCKERHUB_TOKEN: required: true diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5ac9d64..5cc77ff 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,7 @@ name: build on: + workflow_dispatch: push: @@ -9,6 +10,7 @@ on: - 'test/github-actions' jobs: + build-core: strategy: matrix: @@ -16,9 +18,7 @@ jobs: uses: ./.github/workflows/build-subimage.yml with: subimage: ${{ matrix.subimage }} - secrets: - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} + secrets: inherit build-rest: strategy: @@ -27,6 +27,4 @@ jobs: uses: ./.github/workflows/build-subimage.yml with: subimage: ${{ matrix.subimage }} - secrets: - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} + secrets: inherit From 3dcb89a963d54fcd95746d74e6d79118b9993e2b Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Wed, 8 Feb 2023 18:15:58 +0100 Subject: [PATCH 21/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Fix=20build-rest?= =?UTF-8?q?=20dependency=20again?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5cc77ff..aa4b9e6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,6 +21,7 @@ jobs: secrets: inherit build-rest: + needs: build-core strategy: matrix: subimage: ["dinglehopper"] From 0237e68efc453d3f98370c4ac1768ffecce2cb9c Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Wed, 8 Feb 2023 18:41:27 +0100 Subject: [PATCH 22/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Add=20a=20test?= =?UTF-8?q?=20job?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aa4b9e6..3b422a4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,3 +29,21 @@ jobs: with: subimage: ${{ matrix.subimage }} secrets: inherit + + test: + needs: build-rest + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Install wrapper + run: | + apt-get install python3-pip + cd wrapper && pip install . + - + name: Test + run: | + ocrd --version + ocrd-dinglehopper --version From 0cfad9be7e5d787c171e4577f16625ff513893c4 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Wed, 8 Feb 2023 18:49:15 +0100 Subject: [PATCH 23/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Fix=20installing?= =?UTF-8?q?=20pip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3b422a4..c1def39 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,7 +40,7 @@ jobs: - name: Install wrapper run: | - apt-get install python3-pip + sudo apt-get install -y python3-pip cd wrapper && pip install . - name: Test From 725650046840ad1bf49f366f20a172e7054f92a2 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Wed, 8 Feb 2023 19:01:29 +0100 Subject: [PATCH 24/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Set=20DOCKER=5FI?= =?UTF-8?q?MAGE=5FTAG=20to=20let=20wrapper=20run=20the=20correct=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c1def39..0a43777 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,6 +33,8 @@ jobs: test: needs: build-rest runs-on: ubuntu-latest + env: + DOCKER_IMAGE_TAG: ${{ github.sha }} # needed to run the correct version through the wrapper steps: - name: Checkout From a3c193043b6a8cbc1118cfc548c0915ed0129d2f Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Thu, 9 Feb 2023 10:35:22 +0100 Subject: [PATCH 25/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Add=20metadata?= =?UTF-8?q?=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0a43777..0a53ec2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,6 +30,7 @@ jobs: subimage: ${{ matrix.subimage }} secrets: inherit + test: needs: build-rest runs-on: ubuntu-latest @@ -49,3 +50,21 @@ jobs: run: | ocrd --version ocrd-dinglehopper --version + + + # At this point, we have successfully built, uploaded and tested the images. We now just need to add + # tags. + + tag: + needs: test + runs-on: ubuntu-latest + steps: + - + name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + images: | + name/app + tags: | + type=ref,event=branch From 3b2fa5b3a9675d9690a99de2a668a483d92e4557 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Thu, 9 Feb 2023 17:29:16 +0100 Subject: [PATCH 26/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Refactor=20to=20?= =?UTF-8?q?allow=20setting=20image=20tag=20from=20main=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-subimage.yml | 4 +++- .github/workflows/build.yml | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-subimage.yml b/.github/workflows/build-subimage.yml index eaa3ed4..7727d8e 100644 --- a/.github/workflows/build-subimage.yml +++ b/.github/workflows/build-subimage.yml @@ -4,6 +4,9 @@ on: subimage: required: true type: string + tags: + required: true + type: List secrets: DOCKERHUB_USERNAME: required: true @@ -38,4 +41,3 @@ jobs: build-args: DRONE_COMMIT=${{ github.sha }} push: true - tags: quratorspk/ocrd-galley-${{ inputs.subimage }}:${{ github.sha }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0a53ec2..bd0de2d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,6 +18,8 @@ jobs: uses: ./.github/workflows/build-subimage.yml with: subimage: ${{ matrix.subimage }} + tags: + - quratorspk/ocrd-galley-${{ inputs.subimage }}:${{ github.sha }} secrets: inherit build-rest: @@ -28,6 +30,8 @@ jobs: uses: ./.github/workflows/build-subimage.yml with: subimage: ${{ matrix.subimage }} + tags: + - quratorspk/ocrd-galley-${{ inputs.subimage }}:${{ github.sha }} secrets: inherit From 8951955dafb5d64240e818599a14b2fc1f485645 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Thu, 9 Feb 2023 17:35:08 +0100 Subject: [PATCH 27/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Work=20around=20?= =?UTF-8?q?that=20actions=20can't=20have=20list=20inputs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-subimage.yml | 3 ++- .github/workflows/build.yml | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-subimage.yml b/.github/workflows/build-subimage.yml index 7727d8e..0897d7e 100644 --- a/.github/workflows/build-subimage.yml +++ b/.github/workflows/build-subimage.yml @@ -6,7 +6,7 @@ on: type: string tags: required: true - type: List + type: String secrets: DOCKERHUB_USERNAME: required: true @@ -40,4 +40,5 @@ jobs: file: Dockerfile-${{ inputs.subimage }} build-args: DRONE_COMMIT=${{ github.sha }} + tags: ${{ inputs.tags }} push: true diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bd0de2d..dd08859 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,8 +18,7 @@ jobs: uses: ./.github/workflows/build-subimage.yml with: subimage: ${{ matrix.subimage }} - tags: - - quratorspk/ocrd-galley-${{ inputs.subimage }}:${{ github.sha }} + tags: quratorspk/ocrd-galley-${{ inputs.subimage }}:${{ github.sha }} secrets: inherit build-rest: @@ -30,8 +29,7 @@ jobs: uses: ./.github/workflows/build-subimage.yml with: subimage: ${{ matrix.subimage }} - tags: - - quratorspk/ocrd-galley-${{ inputs.subimage }}:${{ github.sha }} + tags: quratorspk/ocrd-galley-${{ inputs.subimage }}:${{ github.sha }} secrets: inherit From 873f102d6e55c8c9f8a67ce47df0e4a51041d2b4 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Thu, 9 Feb 2023 17:36:24 +0100 Subject: [PATCH 28/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Fix=20input=20ty?= =?UTF-8?q?pe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-subimage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-subimage.yml b/.github/workflows/build-subimage.yml index 0897d7e..46523d3 100644 --- a/.github/workflows/build-subimage.yml +++ b/.github/workflows/build-subimage.yml @@ -6,7 +6,7 @@ on: type: string tags: required: true - type: String + type: string secrets: DOCKERHUB_USERNAME: required: true From edc25ed890d9619aee69ea8394af3da67bde5cb9 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Thu, 9 Feb 2023 17:38:05 +0100 Subject: [PATCH 29/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Fix=20Docker=20t?= =?UTF-8?q?ags?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dd08859..53ae3b3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: uses: ./.github/workflows/build-subimage.yml with: subimage: ${{ matrix.subimage }} - tags: quratorspk/ocrd-galley-${{ inputs.subimage }}:${{ github.sha }} + tags: quratorspk/ocrd-galley-${{ matrix.subimage }}:${{ github.sha }} secrets: inherit build-rest: @@ -29,7 +29,7 @@ jobs: uses: ./.github/workflows/build-subimage.yml with: subimage: ${{ matrix.subimage }} - tags: quratorspk/ocrd-galley-${{ inputs.subimage }}:${{ github.sha }} + tags: quratorspk/ocrd-galley-${{ matrix.subimage }}:${{ github.sha }} secrets: inherit From e9df223d210bda6f71f0304e1630c363e6fda3ae Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Thu, 9 Feb 2023 17:54:44 +0100 Subject: [PATCH 30/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Push=20with=20ta?= =?UTF-8?q?gs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-subimage.yml | 6 ++++++ .github/workflows/build.yml | 17 +++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-subimage.yml b/.github/workflows/build-subimage.yml index 46523d3..b7bfa07 100644 --- a/.github/workflows/build-subimage.yml +++ b/.github/workflows/build-subimage.yml @@ -7,6 +7,10 @@ on: tags: required: true type: string + cache-from: + required: false + type: string + default: secrets: DOCKERHUB_USERNAME: required: true @@ -42,3 +46,5 @@ jobs: DRONE_COMMIT=${{ github.sha }} tags: ${{ inputs.tags }} push: true + + cache-from: ${{ inputs.cache-from }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 53ae3b3..1c4b883 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -55,11 +55,16 @@ jobs: # At this point, we have successfully built, uploaded and tested the images. We now just need to add - # tags. + # tags. We do this by building again, but using the formerly built images to + # cache from. tag: needs: test runs-on: ubuntu-latest + strategy: + matrix: + subimage: ["core", "dinglehopper"] + # TODO have one list, not multiple steps: - name: Docker meta @@ -67,6 +72,14 @@ jobs: uses: docker/metadata-action@v4 with: images: | - name/app + quratorspk/ocrd-galley-${{ matrix.subimage }} tags: | type=ref,event=branch + - + name: Push with tags (from cache) + uses: ./.github/workflows/build-subimage.yml + with: + subimage: ${{ matrix.subimage }} + cache-from: quratorspk/ocrd-galley-${{ matrix.subimage }}:${{ github.sha }} + tags: ${{ steps.meta.outputs.tags }} + secrets: inherit From 802fa54021dcacc2dbf8649f8426ee3f628f7d59 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Thu, 9 Feb 2023 17:58:45 +0100 Subject: [PATCH 31/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Fix=20secrets=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1c4b883..576f1fa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -65,6 +65,7 @@ jobs: matrix: subimage: ["core", "dinglehopper"] # TODO have one list, not multiple + secrets: inherit steps: - name: Docker meta @@ -82,4 +83,3 @@ jobs: subimage: ${{ matrix.subimage }} cache-from: quratorspk/ocrd-galley-${{ matrix.subimage }}:${{ github.sha }} tags: ${{ steps.meta.outputs.tags }} - secrets: inherit From 9b2b68ce2d12d6d8836f45bc4f19870d09f000ac Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Thu, 9 Feb 2023 18:04:10 +0100 Subject: [PATCH 32/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Fix=20secrets=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 576f1fa..653eead 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -65,7 +65,6 @@ jobs: matrix: subimage: ["core", "dinglehopper"] # TODO have one list, not multiple - secrets: inherit steps: - name: Docker meta From f1081cb721498a3328c2cce4fb3e7e26ebf8338a Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Thu, 9 Feb 2023 18:55:30 +0100 Subject: [PATCH 33/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Reuse=20subimage?= =?UTF-8?q?=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-subimage.yml | 16 ++++++++----- .github/workflows/build.yml | 35 +++++++++++----------------- 2 files changed, 23 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build-subimage.yml b/.github/workflows/build-subimage.yml index b7bfa07..98e938b 100644 --- a/.github/workflows/build-subimage.yml +++ b/.github/workflows/build-subimage.yml @@ -7,10 +7,6 @@ on: tags: required: true type: string - cache-from: - required: false - type: string - default: secrets: DOCKERHUB_USERNAME: required: true @@ -30,6 +26,14 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 + - + name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + images: | + quratorspk/ocrd-galley-${{ inputs.subimage }} + tags: ${{ inputs.tags }} - name: Login to Docker Hub uses: docker/login-action@v2 @@ -44,7 +48,7 @@ jobs: file: Dockerfile-${{ inputs.subimage }} build-args: DRONE_COMMIT=${{ github.sha }} - tags: ${{ inputs.tags }} + tags: ${{ steps.meta.outputs.tags }} push: true - cache-from: ${{ inputs.cache-from }} + cache-from: quratorspk/ocrd-galley-${{ inputs.subimage }}:${{ github.sha }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 653eead..ebe9df0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,8 @@ jobs: uses: ./.github/workflows/build-subimage.yml with: subimage: ${{ matrix.subimage }} - tags: quratorspk/ocrd-galley-${{ matrix.subimage }}:${{ github.sha }} + tags: | + type=sha,format=long secrets: inherit build-rest: @@ -29,7 +30,8 @@ jobs: uses: ./.github/workflows/build-subimage.yml with: subimage: ${{ matrix.subimage }} - tags: quratorspk/ocrd-galley-${{ matrix.subimage }}:${{ github.sha }} + tags: | + type=sha,format=long secrets: inherit @@ -58,27 +60,16 @@ jobs: # tags. We do this by building again, but using the formerly built images to # cache from. - tag: + push-with-tags: needs: test - runs-on: ubuntu-latest strategy: matrix: subimage: ["core", "dinglehopper"] - # TODO have one list, not multiple - steps: - - - name: Docker meta - id: meta - uses: docker/metadata-action@v4 - with: - images: | - quratorspk/ocrd-galley-${{ matrix.subimage }} - tags: | - type=ref,event=branch - - - name: Push with tags (from cache) - uses: ./.github/workflows/build-subimage.yml - with: - subimage: ${{ matrix.subimage }} - cache-from: quratorspk/ocrd-galley-${{ matrix.subimage }}:${{ github.sha }} - tags: ${{ steps.meta.outputs.tags }} + uses: ./.github/workflows/build-subimage.yml + with: + subimage: ${{ matrix.subimage }} + tags: | + type=sha,format=long + type=ref,event=tag + use-cache: true + secrets: inherit From 9349650994bca7b0007e67277f4666b58e89470a Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Thu, 9 Feb 2023 18:56:13 +0100 Subject: [PATCH 34/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Reuse=20subimage?= =?UTF-8?q?=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ebe9df0..539f8a9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -71,5 +71,4 @@ jobs: tags: | type=sha,format=long type=ref,event=tag - use-cache: true secrets: inherit From e743384ca21249661175ce0a73c651945b37f8e5 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Thu, 9 Feb 2023 18:59:10 +0100 Subject: [PATCH 35/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Reuse=20subimage?= =?UTF-8?q?=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-subimage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-subimage.yml b/.github/workflows/build-subimage.yml index 98e938b..138d7ba 100644 --- a/.github/workflows/build-subimage.yml +++ b/.github/workflows/build-subimage.yml @@ -51,4 +51,4 @@ jobs: tags: ${{ steps.meta.outputs.tags }} push: true - cache-from: quratorspk/ocrd-galley-${{ inputs.subimage }}:${{ github.sha }} + cache-from: quratorspk/ocrd-galley-${{ inputs.subimage }}:sha-${{ github.sha }} From bb7bbd03134ae6082b675ffc65724236b31cc441 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Thu, 9 Feb 2023 19:01:56 +0100 Subject: [PATCH 36/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Reuse=20subimage?= =?UTF-8?q?=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-subimage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-subimage.yml b/.github/workflows/build-subimage.yml index 138d7ba..cc953a6 100644 --- a/.github/workflows/build-subimage.yml +++ b/.github/workflows/build-subimage.yml @@ -47,7 +47,7 @@ jobs: context: . file: Dockerfile-${{ inputs.subimage }} build-args: - DRONE_COMMIT=${{ github.sha }} + DRONE_COMMIT=sha-${{ github.sha }} tags: ${{ steps.meta.outputs.tags }} push: true From cbf11082ac9667638798ba39804fffd6cd466855 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Thu, 9 Feb 2023 19:08:17 +0100 Subject: [PATCH 37/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Reuse=20subimage?= =?UTF-8?q?=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 539f8a9..fbd4c0f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,7 +39,7 @@ jobs: needs: build-rest runs-on: ubuntu-latest env: - DOCKER_IMAGE_TAG: ${{ github.sha }} # needed to run the correct version through the wrapper + DOCKER_IMAGE_TAG: sha-${{ github.sha }} # needed to run the correct version through the wrapper steps: - name: Checkout From db29662ae91ad1069890739575e93630903eab66 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Thu, 9 Feb 2023 19:26:29 +0100 Subject: [PATCH 38/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Try=20to=20enabl?= =?UTF-8?q?e=20caching?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-subimage.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-subimage.yml b/.github/workflows/build-subimage.yml index cc953a6..b054480 100644 --- a/.github/workflows/build-subimage.yml +++ b/.github/workflows/build-subimage.yml @@ -48,6 +48,7 @@ jobs: file: Dockerfile-${{ inputs.subimage }} build-args: DRONE_COMMIT=sha-${{ github.sha }} + BUILDKIT_INLINE_CACHE=1 tags: ${{ steps.meta.outputs.tags }} push: true From 3950f4fad6eb48be9231c5080feb57e4b54e13fa Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Thu, 9 Feb 2023 19:33:30 +0100 Subject: [PATCH 39/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Try=20to=20enabl?= =?UTF-8?q?e=20caching?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-subimage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-subimage.yml b/.github/workflows/build-subimage.yml index b054480..cc86acb 100644 --- a/.github/workflows/build-subimage.yml +++ b/.github/workflows/build-subimage.yml @@ -46,7 +46,7 @@ jobs: with: context: . file: Dockerfile-${{ inputs.subimage }} - build-args: + build-args: | DRONE_COMMIT=sha-${{ github.sha }} BUILDKIT_INLINE_CACHE=1 tags: ${{ steps.meta.outputs.tags }} From d9b0260d607ec20a8478cdb8df2a9cc748d96452 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Fri, 10 Feb 2023 12:59:13 +0100 Subject: [PATCH 40/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Test=20generatin?= =?UTF-8?q?g=20job=20outputs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/list-subimages | 36 ++++++++++++++++++++++++++++++++++++ .github/workflows/build.yml | 11 +++++++++++ 2 files changed, 47 insertions(+) create mode 100755 .github/list-subimages diff --git a/.github/list-subimages b/.github/list-subimages new file mode 100755 index 0000000..5d0e5ef --- /dev/null +++ b/.github/list-subimages @@ -0,0 +1,36 @@ +#!/usr/bin/python3 +import glob +import re +import sys +import argparse + +all_subimages = {re.sub(r"^Dockerfile-", "", dockerfile) for dockerfile in glob.glob("Dockerfile-*")} +core_subimages = {si for si in all_subimages if si.startswith("core")} +rest_subimages = all_subimages - core_subimages + + + +parser = argparse.ArgumentParser(description='List subimages.') +parser.add_argument('--core', action='store_true', + default=False, help='List core subimages') +parser.add_argument('--rest', action='store_true', + default=False, help='List rest subimages') +parser.add_argument('--csv', action='store_true', + default=False, help='Return list as CSV') +args = parser.parse_args() + + +def list_(subimages): + subimages = sorted(subimages) + if args.csv: + print(",".join(subimages)) + else: + print("\n".join(subimages)) + + +if not args.core and not args.rest: + list_(core_subimages | rest_subimages) +if args.core: + list_(core_subimages) +if args.rest: + list_(rest_subimages) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fbd4c0f..a55343d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,6 +10,17 @@ on: - 'test/github-actions' jobs: + generate-matrix: + runs-on: ubuntu-latest + outputs: + core: ${{ steps.step1.outputs.core }} + rest: ${{ steps.step1.outputs.rest }} + steps: + - + id: step1 + run: | + echo "core=$(./.github/list-subimages --core --csv)" >>$GITHUB_OUTPUT + echo "rest=$(./.github/list-subimages --rest --csv)" >>$GITHUB_OUTPUT build-core: strategy: From 958db4d0e9751afeef2c89d26f47f36646da5735 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Fri, 10 Feb 2023 13:01:02 +0100 Subject: [PATCH 41/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Test=20generatin?= =?UTF-8?q?g=20job=20outputs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a55343d..8c7017d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,6 +17,10 @@ jobs: rest: ${{ steps.step1.outputs.rest }} steps: - + name: Checkout + uses: actions/checkout@v3 + - + name: Generate outputs id: step1 run: | echo "core=$(./.github/list-subimages --core --csv)" >>$GITHUB_OUTPUT From 31fe37c36c232f821bd5000884d7e8eefdb346db Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Fri, 10 Feb 2023 13:13:23 +0100 Subject: [PATCH 42/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20TUse=20dynamic?= =?UTF-8?q?=20build=20matrix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/list-subimages | 10 ++++++---- .github/workflows/build.yml | 9 +++++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/list-subimages b/.github/list-subimages index 5d0e5ef..7966019 100755 --- a/.github/list-subimages +++ b/.github/list-subimages @@ -3,6 +3,8 @@ import glob import re import sys import argparse +import json + all_subimages = {re.sub(r"^Dockerfile-", "", dockerfile) for dockerfile in glob.glob("Dockerfile-*")} core_subimages = {si for si in all_subimages if si.startswith("core")} @@ -15,15 +17,15 @@ parser.add_argument('--core', action='store_true', default=False, help='List core subimages') parser.add_argument('--rest', action='store_true', default=False, help='List rest subimages') -parser.add_argument('--csv', action='store_true', - default=False, help='Return list as CSV') +parser.add_argument('--json', action='store_true', + default=False, help='Return list as JSON') args = parser.parse_args() def list_(subimages): subimages = sorted(subimages) - if args.csv: - print(",".join(subimages)) + if args.json: + print(json.dumps(subimages)) else: print("\n".join(subimages)) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8c7017d..52f4ea4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ on: - 'test/github-actions' jobs: - generate-matrix: + matrix: runs-on: ubuntu-latest outputs: core: ${{ steps.step1.outputs.core }} @@ -23,13 +23,14 @@ jobs: name: Generate outputs id: step1 run: | - echo "core=$(./.github/list-subimages --core --csv)" >>$GITHUB_OUTPUT - echo "rest=$(./.github/list-subimages --rest --csv)" >>$GITHUB_OUTPUT + echo "core=$(./.github/list-subimages --core --json)" >>$GITHUB_OUTPUT + echo "rest=$(./.github/list-subimages --rest --json)" >>$GITHUB_OUTPUT build-core: + needs: matrix strategy: matrix: - subimage: ["core"] + subimage: ${{ fromJson(needs.matrix.outputs.core) }} uses: ./.github/workflows/build-subimage.yml with: subimage: ${{ matrix.subimage }} From dfe6536e26714ee1c37ae4a65b002f9848488020 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Fri, 10 Feb 2023 13:17:31 +0100 Subject: [PATCH 43/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Use=20dynamic=20?= =?UTF-8?q?build=20matrix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 52f4ea4..fcdda31 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,6 +15,7 @@ jobs: outputs: core: ${{ steps.step1.outputs.core }} rest: ${{ steps.step1.outputs.rest }} + all: ${{ steps.step1.outputs.all }} steps: - name: Checkout @@ -25,6 +26,7 @@ jobs: run: | echo "core=$(./.github/list-subimages --core --json)" >>$GITHUB_OUTPUT echo "rest=$(./.github/list-subimages --rest --json)" >>$GITHUB_OUTPUT + echo "all=$(./.github/list-subimages --json)" >>$GITHUB_OUTPUT build-core: needs: matrix @@ -42,7 +44,7 @@ jobs: needs: build-core strategy: matrix: - subimage: ["dinglehopper"] + subimage: ${{ fromJson(needs.matrix.outputs.rest) }} uses: ./.github/workflows/build-subimage.yml with: subimage: ${{ matrix.subimage }} @@ -80,7 +82,7 @@ jobs: needs: test strategy: matrix: - subimage: ["core", "dinglehopper"] + subimage: ${{ fromJson(needs.matrix.outputs.all) }} uses: ./.github/workflows/build-subimage.yml with: subimage: ${{ matrix.subimage }} From 0595e3b14e5e682b1d7909866801d84222d79b8f Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Fri, 10 Feb 2023 13:19:24 +0100 Subject: [PATCH 44/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Use=20Ubuntu=201?= =?UTF-8?q?8.04=20again=20(due=20to=20CUDA)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile-core | 2 +- Dockerfile-core-cuda10.0 | 2 +- Dockerfile-core-cuda10.1 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile-core b/Dockerfile-core index 65ac56a..f28c0c6 100644 --- a/Dockerfile-core +++ b/Dockerfile-core @@ -1,4 +1,4 @@ -FROM ubuntu:22.04 +FROM ubuntu:18.04 ARG PIP_INSTALL="pip install --no-cache-dir" ARG OCRD_VERSION_MINIMUM="2.23.3" diff --git a/Dockerfile-core-cuda10.0 b/Dockerfile-core-cuda10.0 index c620a65..f1a2d60 100644 --- a/Dockerfile-core-cuda10.0 +++ b/Dockerfile-core-cuda10.0 @@ -1,4 +1,4 @@ -FROM nvidia/cuda:10.0-cudnn7-runtime-ubuntu22.04 +FROM nvidia/cuda:10.0-cudnn7-runtime-ubuntu18.04 ARG PIP_INSTALL="pip install --no-cache-dir" ARG OCRD_VERSION_MINIMUM="2.23.3" diff --git a/Dockerfile-core-cuda10.1 b/Dockerfile-core-cuda10.1 index 594aa2a..569a567 100644 --- a/Dockerfile-core-cuda10.1 +++ b/Dockerfile-core-cuda10.1 @@ -1,4 +1,4 @@ -FROM nvidia/cuda:10.1-cudnn7-runtime-ubuntu22.04 +FROM nvidia/cuda:10.1-cudnn7-runtime-ubuntu18.04 ARG PIP_INSTALL="pip install --no-cache-dir" ARG OCRD_VERSION_MINIMUM="2.23.3" From 67d3ff0f853afaa51925cd706c5a3ac05227a0ad Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Fri, 10 Feb 2023 14:27:10 +0100 Subject: [PATCH 45/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Debug=20GITHUB?= =?UTF-8?q?=5FOUTPUT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fcdda31..ab2db17 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,6 +28,9 @@ jobs: echo "rest=$(./.github/list-subimages --rest --json)" >>$GITHUB_OUTPUT echo "all=$(./.github/list-subimages --json)" >>$GITHUB_OUTPUT + echo "GITHUB_OUTPUT:" + cat $GITHUB_OUTPUT + build-core: needs: matrix strategy: From 257a568933a57fd03d9b8ea06a3a010c8e5869f9 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Fri, 10 Feb 2023 16:07:11 +0100 Subject: [PATCH 46/53] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Fix=20'needs'=20?= =?UTF-8?q?to=20have=20access=20to=20matrix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ab2db17..41143ce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,7 +44,7 @@ jobs: secrets: inherit build-rest: - needs: build-core + needs: [matrix, build-core] strategy: matrix: subimage: ${{ fromJson(needs.matrix.outputs.rest) }} @@ -82,7 +82,7 @@ jobs: # cache from. push-with-tags: - needs: test + needs: [matrix, test] strategy: matrix: subimage: ${{ fromJson(needs.matrix.outputs.all) }} From 252a125ed26fd2af50429c7f18ccbadcf45d67c1 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Fri, 10 Feb 2023 17:13:32 +0100 Subject: [PATCH 47/53] =?UTF-8?q?=F0=9F=9A=A7=20Do=20not=20add=20data=20to?= =?UTF-8?q?=20container=20image?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile-eynollah | 4 ---- Dockerfile-ocrd_calamari | 8 -------- Dockerfile-ocrd_calamari03 | 6 ------ Dockerfile-ocrd_tesserocr | 7 ------- Dockerfile-sbb_binarization | 4 ---- Dockerfile-sbb_textline_detector | 4 ---- 6 files changed, 33 deletions(-) diff --git a/Dockerfile-eynollah b/Dockerfile-eynollah index 1ce84d2..b932fc3 100644 --- a/Dockerfile-eynollah +++ b/Dockerfile-eynollah @@ -10,10 +10,6 @@ RUN ${PIP_INSTALL} \ "eynollah == ${EYNOLLAH_VERSION}" -# Copy OCR models -COPY data/eynollah /var/lib/eynollah - - # Check pip dependencies RUN pip check diff --git a/Dockerfile-ocrd_calamari b/Dockerfile-ocrd_calamari index fa38414..6181494 100644 --- a/Dockerfile-ocrd_calamari +++ b/Dockerfile-ocrd_calamari @@ -12,14 +12,6 @@ RUN ${PIP_INSTALL} \ "ocrd_calamari == $OCRD_CALAMARI_VERSION" -# Copy OCR models -RUN mkdir -p /var/lib/calamari-models/GT4HistOCR -COPY data/calamari-models/GT4HistOCR/2019-12-11T11_10+0100 /var/lib/calamari-models/GT4HistOCR/2019-12-11T11_10+0100 -# XXX experimental -#COPY data/calamari-models/GT4HistOCR/2019-12-18T17_24+0100-with-augmentation-UNTESTED /var/lib/calamari-models/GT4HistOCR/2019-12-18T17_24+0100 -#COPY data/mirror/github.com/Calamari-OCR/calamari_models/gt4histocr /var/lib/calamari-models/GT4HistOCR-chreul - - # Check pip dependencies RUN pip check diff --git a/Dockerfile-ocrd_calamari03 b/Dockerfile-ocrd_calamari03 index 43389ad..8119d2a 100644 --- a/Dockerfile-ocrd_calamari03 +++ b/Dockerfile-ocrd_calamari03 @@ -13,12 +13,6 @@ RUN ${PIP_INSTALL} \ 'ocrd_calamari == 0.0.7' -# Copy OCR models -RUN mkdir -p /var/lib/calamari-models/GT4HistOCR -COPY data/calamari-models/GT4HistOCR/2019-07-22T15_49+0200 /var/lib/calamari-models/GT4HistOCR/2019-07-22T15_49+0200 - - - # Check pip dependencies RUN pip check diff --git a/Dockerfile-ocrd_tesserocr b/Dockerfile-ocrd_tesserocr index 32b8e45..a558f33 100644 --- a/Dockerfile-ocrd_tesserocr +++ b/Dockerfile-ocrd_tesserocr @@ -17,13 +17,6 @@ RUN add-apt-repository ppa:alex-p/tesseract-ocr && \ apt-get clean && rm -rf /var/lib/apt/lists/* -# Copy OCR models -RUN mkdir -p $TESSDATA_PREFIX -ADD data/mirror/github.com/tesseract-ocr/tessdata_best/archive/${TESSDATA_BEST_VERSION}-repacked.tar.gz $TESSDATA_PREFIX/ -COPY data/tesseract-models/GT4HistOCR/GT4HistOCR_2000000.traineddata $TESSDATA_PREFIX/ -RUN curl -sSL -O https://ub-backup.bib.uni-mannheim.de/~stweil/ocrd-train/data/Fraktur_5000000/tessdata_fast/Fraktur_50000000.502_198857.traineddata && \ - mv *.traineddata $TESSDATA_PREFIX/ - # Build pip installable stuff RUN ${PIP_INSTALL} \ "ocrd_tesserocr == ${OCRD_TESSEROCR_VERSION}" diff --git a/Dockerfile-sbb_binarization b/Dockerfile-sbb_binarization index ff298ca..e8c6496 100644 --- a/Dockerfile-sbb_binarization +++ b/Dockerfile-sbb_binarization @@ -11,10 +11,6 @@ RUN ${PIP_INSTALL} \ "sbb_binarization == $SBB_BINARIZATION_VERSION" -# Copy models -COPY data/sbb_binarization/2021-03-09 /var/lib/sbb_binarization - - # Check pip dependencies RUN pip check diff --git a/Dockerfile-sbb_textline_detector b/Dockerfile-sbb_textline_detector index d206131..d4f3b75 100644 --- a/Dockerfile-sbb_textline_detector +++ b/Dockerfile-sbb_textline_detector @@ -12,10 +12,6 @@ RUN ${PIP_INSTALL} \ https://github.com/qurator-spk/sbb_textline_detector/archive/$SBB_TEXTLINE_DETECTOR_COMMIT.tar.gz -# Copy OCR models -COPY data/textline_detection /var/lib/textline_detection - - # Check pip dependencies RUN pip check From 83cad85b21f8e163f4b5d2afaf9a59eafa4a2893 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Mon, 6 Mar 2023 18:19:53 +0100 Subject: [PATCH 48/53] =?UTF-8?q?=F0=9F=9A=A2=20GitHub=20Actions:=20Set=20?= =?UTF-8?q?edge,=20branch=20and=20semver=20tags=20(including=20latest)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-subimage.yml | 3 +++ .github/workflows/build.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/build-subimage.yml b/.github/workflows/build-subimage.yml index cc86acb..afc3ccf 100644 --- a/.github/workflows/build-subimage.yml +++ b/.github/workflows/build-subimage.yml @@ -33,6 +33,9 @@ jobs: with: images: | quratorspk/ocrd-galley-${{ inputs.subimage }} + flavor: | + latest=auto + # latest=auto should generate "latest" for the type=semver tags entry tags: ${{ inputs.tags }} - name: Login to Docker Hub diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 41143ce..11c0e06 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,6 +41,9 @@ jobs: subimage: ${{ matrix.subimage }} tags: | type=sha,format=long + type=edge,branch=master + type=ref,event=branch + type=semver,pattern={{version}} secrets: inherit build-rest: From 97bfd249bdc067b885b058bf3f75bec15306fe3a Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Mon, 6 Mar 2023 18:29:00 +0100 Subject: [PATCH 49/53] =?UTF-8?q?=F0=9F=9A=A2=20GitHub=20Actions:=20Set=20?= =?UTF-8?q?edge,=20branch=20and=20semver=20tags=20(including=20latest)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 11c0e06..a356a01 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,9 +41,7 @@ jobs: subimage: ${{ matrix.subimage }} tags: | type=sha,format=long - type=edge,branch=master - type=ref,event=branch - type=semver,pattern={{version}} + # Here: NOT the full tags, just the sha! (they get added below) secrets: inherit build-rest: @@ -94,5 +92,8 @@ jobs: subimage: ${{ matrix.subimage }} tags: | type=sha,format=long - type=ref,event=tag + type=edge,branch=master + type=ref,event=branch + type=semver,pattern={{version}} + # Here: full tags secrets: inherit From 287273ca572d153741dea63bed961829c2b909a5 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Tue, 7 Mar 2023 15:39:03 +0100 Subject: [PATCH 50/53] =?UTF-8?q?=F0=9F=9A=A2=20GitHub=20Actions:=20Note?= =?UTF-8?q?=20about=20'latest'=20behavior?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a356a01..baae717 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -96,4 +96,7 @@ jobs: type=ref,event=branch type=semver,pattern={{version}} # Here: full tags + # Note: Do NOT use event=tag here, unless re-configuring the "latest" + # behavior too as that triggers on event=tag by default. By default, + # "latest" triggers on type=semver here, too (which is wanted). secrets: inherit From bcf13a69c3f475666344f0762c55de56e3e4d4e7 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Wed, 15 Mar 2023 16:39:55 +0100 Subject: [PATCH 51/53] =?UTF-8?q?=E2=9C=A8=20Add=20minimal=20support=20for?= =?UTF-8?q?=20using=20ocrd=20resmgr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wrapper/qurator/ocrd_galley/cli.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/wrapper/qurator/ocrd_galley/cli.py b/wrapper/qurator/ocrd_galley/cli.py index d6e6ab8..199f614 100644 --- a/wrapper/qurator/ocrd_galley/cli.py +++ b/wrapper/qurator/ocrd_galley/cli.py @@ -1,12 +1,18 @@ import os import subprocess import sys +from pathlib import Path DOCKER_IMAGE_PREFIX = os.environ.get("DOCKER_IMAGE_PREFIX", "quratorspk/ocrd-galley") DOCKER_IMAGE_TAG = os.environ.get("DOCKER_IMAGE_TAG", "latest") LOG_LEVEL = os.environ.get("LOG_LEVEL", "INFO") +# xdg-user-dirs is only available under Python 3.10+ etc. pp. → it is simpler +# to just roll it on our own. +XDG_CONFIG_HOME = os.environ.get("XDG_CONFIG_HOME", Path.home() / ".config") +XDG_DATA_HOME = os.environ.get("XDG_DATA_HOME", Path.home() / ".local" / "share") + sub_images = { "ocrd": "core", @@ -56,6 +62,8 @@ def main(): sub_image = sub_images[argv[0]] docker_image = "%s-%s:%s" % (DOCKER_IMAGE_PREFIX, sub_image, DOCKER_IMAGE_TAG) + if DOCKER_IMAGE_TAG != "latest": + print(f"Using {docker_image}") docker_run(argv, docker_image) @@ -67,6 +75,13 @@ def docker_run(argv, docker_image): docker_run_options.extend(["-e", "LOG_LEVEL=%s" % LOG_LEVEL]) docker_run_options.extend(["-e", "_OCRD_COMPLETE"]) + docker_run_options.extend(["-e", "XDG_CONFIG_HOME=%s" % XDG_CONFIG_HOME]) + docker_run_options.extend(["--mount", "type=bind,src=%s,target=%s" % + (XDG_CONFIG_HOME, XDG_CONFIG_HOME)]) + docker_run_options.extend(["-e", "XDG_DATA_HOME=%s" % XDG_DATA_HOME]) + docker_run_options.extend(["--mount", "type=bind,src=%s,target=%s" % + (XDG_DATA_HOME, XDG_DATA_HOME)]) + # JAVA_TOOL_OPTIONS is used for Java proxy settings if os.environ.get("JAVA_TOOL_OPTIONS"): docker_run_options.extend(["-e", "JAVA_TOOL_OPTIONS"]) From 435c88c5e1311cbf9381c07ec8a92922611427d0 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Wed, 15 Mar 2023 17:04:59 +0100 Subject: [PATCH 52/53] =?UTF-8?q?=F0=9F=A7=B9=20Use=20GIT=5FCOMMIT,=20not?= =?UTF-8?q?=20DRONE=5FCOMMIT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.star | 74 ---------------------------- .github/workflows/build-subimage.yml | 2 +- Dockerfile-dinglehopper | 4 +- Dockerfile-eynollah | 4 +- Dockerfile-ocrd_anybaseocr | 4 +- Dockerfile-ocrd_calamari | 4 +- Dockerfile-ocrd_calamari03 | 4 +- Dockerfile-ocrd_cis | 4 +- Dockerfile-ocrd_fileformat | 4 +- Dockerfile-ocrd_olena | 4 +- Dockerfile-ocrd_segment | 4 +- Dockerfile-ocrd_tesserocr | 4 +- Dockerfile-ocrd_wrap | 4 +- Dockerfile-sbb_binarization | 4 +- Dockerfile-sbb_textline_detector | 4 +- 15 files changed, 27 insertions(+), 101 deletions(-) delete mode 100644 .drone.star diff --git a/.drone.star b/.drone.star deleted file mode 100644 index 623c861..0000000 --- a/.drone.star +++ /dev/null @@ -1,74 +0,0 @@ -def main(ctx): - tags = [ctx.build.commit] - - if ctx.build.event == "tag": - name = "release" - elif ctx.build.branch == "master": - name = "master" - tags.append("latest") - else: - return - - return [ - { - "kind": "pipeline", - "name": name, - "steps": [ - { - "name": "prepare data", - "image": "alpine", - "commands": [ - "apk update && apk add bash curl", - "FORCE_DOWNLOAD=y ./build-tmp-XXX" - ] - }, - # We can't glob and have to add here manually... - step_for(ctx, "core", tags), - step_for(ctx, "core-cuda10.0", tags), - step_for(ctx, "core-cuda10.1", tags), - - step_for(ctx, "dinglehopper", tags), - step_for(ctx, "ocrd_calamari", tags), - step_for(ctx, "ocrd_calamari03", tags), - step_for(ctx, "ocrd_cis", tags), - step_for(ctx, "ocrd_fileformat", tags), - step_for(ctx, "ocrd_olena", tags), - step_for(ctx, "ocrd_segment", tags), - step_for(ctx, "ocrd_tesserocr", tags), - step_for(ctx, "ocrd_wrap", tags), - step_for(ctx, "sbb_binarization", tags), - step_for(ctx, "sbb_textline_detector", tags), - step_for(ctx, "eynollah", tags), - step_for(ctx, "ocrd_anybaseocr", tags), - { - "name": "notify", - "image": "drillster/drone-email", - "settings": { - "host": "172.17.0.1", - "port": "25", - "from": "drone@ci.moegen-wir.net", - }, - "when": { - "status": [ "success", "failure" ] - } - } - ] - } - ] - - -def step_for(ctx, sub_image, tags): - return { - "name": "build %s" % sub_image, - "image": "plugins/docker", - "settings": { - "build_args": [ - "DRONE_COMMIT=%s" % ctx.build.commit, - ], - "tags": tags, - "username": { "from_secret": "docker_username" }, - "password": { "from_secret": "docker_password" }, - "repo": "quratorspk/ocrd-galley-%s" % sub_image, - "dockerfile": "Dockerfile-%s" % sub_image, - } - } diff --git a/.github/workflows/build-subimage.yml b/.github/workflows/build-subimage.yml index afc3ccf..0fe98ce 100644 --- a/.github/workflows/build-subimage.yml +++ b/.github/workflows/build-subimage.yml @@ -50,7 +50,7 @@ jobs: context: . file: Dockerfile-${{ inputs.subimage }} build-args: | - DRONE_COMMIT=sha-${{ github.sha }} + GIT_COMMIT=sha-${{ github.sha }} BUILDKIT_INLINE_CACHE=1 tags: ${{ steps.meta.outputs.tags }} push: true diff --git a/Dockerfile-dinglehopper b/Dockerfile-dinglehopper index d7c9bc1..0ed198c 100644 --- a/Dockerfile-dinglehopper +++ b/Dockerfile-dinglehopper @@ -1,5 +1,5 @@ -ARG DRONE_COMMIT="latest" -FROM quratorspk/ocrd-galley-core:$DRONE_COMMIT +ARG GIT_COMMIT="latest" +FROM quratorspk/ocrd-galley-core:$GIT_COMMIT ARG PIP_INSTALL="pip install --no-cache-dir" ARG DINGLEHOPPER_COMMIT="dcc10c5" diff --git a/Dockerfile-eynollah b/Dockerfile-eynollah index b932fc3..7e6c5d1 100644 --- a/Dockerfile-eynollah +++ b/Dockerfile-eynollah @@ -1,5 +1,5 @@ -ARG DRONE_COMMIT="latest" -FROM quratorspk/ocrd-galley-core-cuda10.0:$DRONE_COMMIT +ARG GIT_COMMIT="latest" +FROM quratorspk/ocrd-galley-core-cuda10.0:$GIT_COMMIT ARG PIP_INSTALL="pip install --no-cache-dir" ARG EYNOLLAH_VERSION="0.0.10" diff --git a/Dockerfile-ocrd_anybaseocr b/Dockerfile-ocrd_anybaseocr index fb14dd7..403bfcc 100644 --- a/Dockerfile-ocrd_anybaseocr +++ b/Dockerfile-ocrd_anybaseocr @@ -1,5 +1,5 @@ -ARG DRONE_COMMIT="latest" -FROM quratorspk/ocrd-galley-core-cuda10.1:$DRONE_COMMIT +ARG GIT_COMMIT="latest" +FROM quratorspk/ocrd-galley-core-cuda10.1:$GIT_COMMIT ARG PIP_INSTALL="pip install --no-cache-dir" ARG OCRD_ANYBASEOCR_VERSION="1.8.2" diff --git a/Dockerfile-ocrd_calamari b/Dockerfile-ocrd_calamari index 6181494..7926fb7 100644 --- a/Dockerfile-ocrd_calamari +++ b/Dockerfile-ocrd_calamari @@ -1,5 +1,5 @@ -ARG DRONE_COMMIT="latest" -FROM quratorspk/ocrd-galley-core-cuda10.1:$DRONE_COMMIT +ARG GIT_COMMIT="latest" +FROM quratorspk/ocrd-galley-core-cuda10.1:$GIT_COMMIT # XXX https://github.com/OCR-D/core/issues/642 diff --git a/Dockerfile-ocrd_calamari03 b/Dockerfile-ocrd_calamari03 index 8119d2a..10b0646 100644 --- a/Dockerfile-ocrd_calamari03 +++ b/Dockerfile-ocrd_calamari03 @@ -1,5 +1,5 @@ -ARG DRONE_COMMIT="latest" -FROM quratorspk/ocrd-galley-core-cuda10.0:$DRONE_COMMIT +ARG GIT_COMMIT="latest" +FROM quratorspk/ocrd-galley-core-cuda10.0:$GIT_COMMIT ARG PIP_INSTALL="pip install --no-cache-dir" diff --git a/Dockerfile-ocrd_cis b/Dockerfile-ocrd_cis index 5790d74..e967893 100644 --- a/Dockerfile-ocrd_cis +++ b/Dockerfile-ocrd_cis @@ -1,5 +1,5 @@ -ARG DRONE_COMMIT="latest" -FROM quratorspk/ocrd-galley-core:$DRONE_COMMIT +ARG GIT_COMMIT="latest" +FROM quratorspk/ocrd-galley-core:$GIT_COMMIT ARG PIP_INSTALL="pip install --no-cache-dir" ARG OCRD_CIS_VERSION="0.1.5" diff --git a/Dockerfile-ocrd_fileformat b/Dockerfile-ocrd_fileformat index 0275598..060f79c 100644 --- a/Dockerfile-ocrd_fileformat +++ b/Dockerfile-ocrd_fileformat @@ -1,5 +1,5 @@ -ARG DRONE_COMMIT="latest" -FROM quratorspk/ocrd-galley-core:$DRONE_COMMIT +ARG GIT_COMMIT="latest" +FROM quratorspk/ocrd-galley-core:$GIT_COMMIT ARG PIP_INSTALL="pip install --no-cache-dir" ARG OCRD_FILEFORMAT_VERSION="0.5.0" diff --git a/Dockerfile-ocrd_olena b/Dockerfile-ocrd_olena index 1b1fcd0..21b2e04 100644 --- a/Dockerfile-ocrd_olena +++ b/Dockerfile-ocrd_olena @@ -1,5 +1,5 @@ -ARG DRONE_COMMIT="latest" -FROM quratorspk/ocrd-galley-core:$DRONE_COMMIT +ARG GIT_COMMIT="latest" +FROM quratorspk/ocrd-galley-core:$GIT_COMMIT ARG PIP_INSTALL="pip install --no-cache-dir" ARG OCRD_OLENA_VERSION="1.3.0" diff --git a/Dockerfile-ocrd_segment b/Dockerfile-ocrd_segment index 2dfee9e..44699ff 100644 --- a/Dockerfile-ocrd_segment +++ b/Dockerfile-ocrd_segment @@ -1,5 +1,5 @@ -ARG DRONE_COMMIT="latest" -FROM quratorspk/ocrd-galley-core:$DRONE_COMMIT +ARG GIT_COMMIT="latest" +FROM quratorspk/ocrd-galley-core:$GIT_COMMIT ARG PIP_INSTALL="pip install --no-cache-dir" ARG OCRD_SEGMENT_VERSION="0.1.21" diff --git a/Dockerfile-ocrd_tesserocr b/Dockerfile-ocrd_tesserocr index a558f33..e34c0df 100644 --- a/Dockerfile-ocrd_tesserocr +++ b/Dockerfile-ocrd_tesserocr @@ -1,5 +1,5 @@ -ARG DRONE_COMMIT="latest" -FROM quratorspk/ocrd-galley-core:$DRONE_COMMIT +ARG GIT_COMMIT="latest" +FROM quratorspk/ocrd-galley-core:$GIT_COMMIT ARG PIP_INSTALL="pip install --no-cache-dir" ARG TESSDATA_BEST_VERSION="4.0.0" diff --git a/Dockerfile-ocrd_wrap b/Dockerfile-ocrd_wrap index d38bc2c..518d306 100644 --- a/Dockerfile-ocrd_wrap +++ b/Dockerfile-ocrd_wrap @@ -1,5 +1,5 @@ -ARG DRONE_COMMIT="latest" -FROM quratorspk/ocrd-galley-core:$DRONE_COMMIT +ARG GIT_COMMIT="latest" +FROM quratorspk/ocrd-galley-core:$GIT_COMMIT ARG PIP_INSTALL="pip install --no-cache-dir" ARG OCRD_WRAP_VERSION="0.1.7" diff --git a/Dockerfile-sbb_binarization b/Dockerfile-sbb_binarization index e8c6496..cb70e95 100644 --- a/Dockerfile-sbb_binarization +++ b/Dockerfile-sbb_binarization @@ -1,5 +1,5 @@ -ARG DRONE_COMMIT="latest" -FROM quratorspk/ocrd-galley-core-cuda10.0:$DRONE_COMMIT +ARG GIT_COMMIT="latest" +FROM quratorspk/ocrd-galley-core-cuda10.0:$GIT_COMMIT ARG PIP_INSTALL="pip install --no-cache-dir" ARG SBB_BINARIZATION_VERSION="0.0.10" diff --git a/Dockerfile-sbb_textline_detector b/Dockerfile-sbb_textline_detector index d4f3b75..cf17738 100644 --- a/Dockerfile-sbb_textline_detector +++ b/Dockerfile-sbb_textline_detector @@ -1,5 +1,5 @@ -ARG DRONE_COMMIT="latest" -FROM quratorspk/ocrd-galley-core-cuda10.0:$DRONE_COMMIT +ARG GIT_COMMIT="latest" +FROM quratorspk/ocrd-galley-core-cuda10.0:$GIT_COMMIT ARG PIP_INSTALL="pip install --no-cache-dir" ARG SBB_TEXTLINE_DETECTOR_COMMIT="c4df3d6" From 2a020954fb356fe9b3c2d8df4439de054f0afa34 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Wed, 15 Mar 2023 19:40:43 +0100 Subject: [PATCH 53/53] =?UTF-8?q?=E2=9C=92=20README:=20Update=20that=20we?= =?UTF-8?q?=20have=20images=20again=20+=20how=20to=20download=20models?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 65e6e3e..e39581b 100644 --- a/README.md +++ b/README.md @@ -29,14 +29,9 @@ including all dependencies in Docker. How to use ---------- -**Currently, due to problems with the Travis CI, we do not provide pre-built -containers anymore.*** - -To build the containers yourself using Docker: -~~~ -cd ~/devel/ocrd-galley/ -./build -~~~ +ocrd-galley uses Docker to run the OCR-D images. We provide pre-built container +images that get downloaded automatically when you run the provided wrappers for +the OCR-D processors. You can then install the wrappers into a Python venv: ~~~ @@ -44,9 +39,13 @@ cd ~/devel/ocrd-galley/wrapper pip install . ~~~ +To download models, you need to use the `-a` flag of `ocrd resmgr`: +~~~ +ocrd resmgr download -a ocrd-calamari-recognize default +~~~ + You may then use the script `my_ocrd_workflow` to use your self-built containers on an example workspace: - ~~~ # Download an example workspace cd /tmp @@ -110,3 +109,11 @@ cd workspace-xxxxx # output by the last command ~~~ This produces a workspace from the files and then runs the OCR workflow on it. + +Build the containers yourself +----------------------------- +To build the containers yourself using Docker: +~~~ +cd ~/devel/ocrd-galley/ +./build +~~~