-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #70 from bertsky/add-docker
add Docker and GHA CD via Dockerhub
- Loading branch information
Showing
9 changed files
with
154 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Docker Image CD | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
workflow_dispatch: | ||
inputs: | ||
docker-tagname: | ||
description: Tag name of the Docker image | ||
default: 'ocrd/sbb_binarization' | ||
|
||
env: | ||
DOCKER_TAGNAME: ${{ github.evenv.inputs.docker-tagname || 'ocrd/sbb_binarization' }} | ||
|
||
jobs: | ||
|
||
build: | ||
|
||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
contents: read | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- # Activate cache export feature to reduce build time of image | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Build the Docker image | ||
run: make docker DOCKER_TAG=${{ env.DOCKER_TAGNAME }} | ||
- name: Login to Dockerhub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
- name: Push image to Dockerhub | ||
run: docker push ${{ env.DOCKER_TAGNAME }} | ||
- name: Alias the Docker image for GHCR | ||
run: docker tag ${{ env.DOCKER_TAGNAME }} ghcr.io/${{ github.repository }} | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Push image to Github Container Registry | ||
run: docker push ghcr.io/${{ github.repository }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
ARG DOCKER_BASE_IMAGE | ||
FROM $DOCKER_BASE_IMAGE | ||
ARG VCS_REF | ||
ARG BUILD_DATE | ||
LABEL \ | ||
maintainer="https://ocr-d.de/kontakt" \ | ||
org.label-schema.vcs-ref=$VCS_REF \ | ||
org.label-schema.vcs-url="https://github.com/qurator-spk/sbb_binarization" \ | ||
org.label-schema.build-date=$BUILD_DATE | ||
|
||
WORKDIR /build/sbb_binarization | ||
COPY pyproject.toml . | ||
COPY ocrd-tool.json . | ||
COPY sbb_binarize ./sbb_binarize | ||
COPY requirements.txt . | ||
COPY README.md . | ||
COPY Makefile . | ||
RUN make install | ||
RUN rm -rf /build/sbb_binarization | ||
|
||
WORKDIR /data | ||
VOLUME ["/data"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
[build-system] | ||
requires = ["setuptools>=61.0", "wheel", "setuptools-ocrd"] | ||
|
||
[project] | ||
name = "sbb_binarization" | ||
authors = [ | ||
{name = "Vahid Rezanezhad"}, | ||
{name = "Staatsbibliothek zu Berlin - Preußischer Kulturbesitz"}, | ||
] | ||
description = "Pixelwise binarization with selectional auto-encoders in Keras" | ||
readme = "README.md" | ||
license.file = "LICENSE" | ||
requires-python = ">=3.8" | ||
|
||
dynamic = ["dependencies", "version"] | ||
|
||
classifiers = [ | ||
"Development Status :: 4 - Beta", | ||
"Environment :: Console", | ||
"Intended Audience :: Science/Research", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Topic :: Scientific/Engineering :: Image Processing", | ||
] | ||
|
||
[project.scripts] | ||
sbb_binarize = "sbb_binarize.cli:main" | ||
ocrd-sbb-binarize = "sbb_binarize.ocrd_cli:cli" | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/qurator-spk/sbb_binarization" | ||
Repository = "https://github.com/qurator-spk/sbb_binarization.git" | ||
|
||
[tool.setuptools.dynamic] | ||
dependencies = {file = ["requirements.txt"]} | ||
|
||
[tool.setuptools.packages.find] | ||
where = ["."] | ||
include = ["sbb_binarize"] | ||
namespaces = false | ||
|
||
[tool.setuptools] | ||
include-package-data = true | ||
|
||
[tool.setuptools.package-data] | ||
"*" = ["*.json"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ numpy | |
setuptools >= 41 | ||
opencv-python-headless | ||
ocrd >= 2.38.0 | ||
tensorflow <= 2.11.1 | ||
tensorflow < 2.13 |