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

Update 2024 10 11 #452

Merged
merged 37 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
0a7c090
Dockerfile: default for OCRD_MODULES was outdated
kba Aug 1, 2024
52a1b58
update 2024-10-11
kba Oct 10, 2024
016ab06
actually add ocrd_page2alto
kba Oct 10, 2024
76494e2
update ocrd_cis
kba Oct 11, 2024
0d2cd1a
update ocrd_fileformat
kba Oct 11, 2024
adbad42
try to fix conflicts in main venv
bertsky Oct 11, 2024
2ec1937
more attempts
bertsky Oct 11, 2024
e1ee446
fix-cuda: not in sub-venv if it does not exist, yet
bertsky Oct 11, 2024
f093e5d
fix-cuda: local version label needs exact requirement
bertsky Oct 11, 2024
6855e1f
fix-cuda: fix typo in recipe
bertsky Oct 11, 2024
8eac021
docker: fix mini/medi defs
bertsky Oct 12, 2024
1bed4e3
CI/CD: try to split up mini/medi/maxi into inter-dependent jobs
bertsky Oct 12, 2024
9ee4e81
CI/CD: store_test_results with file path
bertsky Oct 12, 2024
c49e6c6
docker: do not rm venv created by previous stage
bertsky Oct 12, 2024
fab9caa
Updated config.yml
bertsky Oct 13, 2024
4ce8a0b
CI/CD: transfer images via workspace and docker save/load
bertsky Oct 14, 2024
f5b7b6b
CI/CD: allow long wait for saving/persisting Docker image
bertsky Oct 14, 2024
5766a73
try to fix conflicts in main venv, and some
bertsky Oct 14, 2024
08e67b8
CI/CD: move image transfers to pre-steps and post-steps, use command …
bertsky Oct 14, 2024
a94646d
CI/CD: rm images after loading to Docker daemon
bertsky Oct 14, 2024
5746a54
update sbb_binarization to #70
bertsky Oct 14, 2024
7039405
update dinglehopper to #120
bertsky Oct 14, 2024
21b2e34
CI/CD: abuse Dockerhub for transferring Docker images between jobs
bertsky Oct 14, 2024
edea0c5
CI/CD: work around CircleCI not allowing variables in workflow ctxt
bertsky Oct 14, 2024
2ae2842
CI/CD: fix typo
bertsky Oct 14, 2024
03fe0f8
CI/CD: fix another typo
bertsky Oct 14, 2024
9a5542a
CI/CD: try with other form of parameter+variable interpolation
bertsky Oct 15, 2024
49d57da
CI/CD: CircleCI notoriously does not interpolate variables in commands
bertsky Oct 15, 2024
80bc708
CI/CD: try to adapt to CircleCI's stupid variable scoping
bertsky Oct 15, 2024
13f7da8
CI/CD: debug
bertsky Oct 15, 2024
7b32661
update sbb_binarization to #70, again
bertsky Oct 15, 2024
27f06a8
CI/CD: simply forgot to login to Dockerhub
bertsky Oct 15, 2024
f41d394
CI/CD: store core test results via docker-cp
bertsky Oct 15, 2024
4bbe808
CI/CD: remove temporary images on Dockerhub
bertsky Oct 15, 2024
cd8333f
CI/CD: move when-attribute to step definition
bertsky Oct 15, 2024
af6e005
CI/CD: fix Dockerhub API password variable name
bertsky Oct 15, 2024
e33ac77
:memo: update changelog
bertsky Oct 15, 2024
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
299 changes: 244 additions & 55 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,78 +1,109 @@
version: 2.1
jobs:

commands:
dockerhub-store:
description: "store an image on Dockerhub"
parameters:
tag:
description: "image tag (full variant name) to be saved"
type:
string
steps:
- run:
name: Login to Docker Hub
command: echo "$DOCKERHUB_PASS" | docker login --username "$DOCKERHUB_USERNAME" --password-stdin
- run:
name: save image
command: |
docker tag ocrd/all:<< parameters.tag >> ocrd/all:<< parameters.tag >>-${CIRCLE_SHA1}
docker push ocrd/all:<< parameters.tag >>-${CIRCLE_SHA1}
no_output_timeout: 30m
dockerhub-load:
description: "load an image from Dockerhub"
parameters:
tag:
description: "image tag (full variant name) to be pulled"
type:
string
steps:
- run:
name: load previous image
command: |
docker pull ocrd/all:<< parameters.tag >>-${CIRCLE_SHA1}
docker tag ocrd/all:<< parameters.tag >>-${CIRCLE_SHA1} ocrd/all:<< parameters.tag >>
dockerhub-remove:
description: "remove an image on Dockerhub"
parameters:
tag:
description: "image tag (full variant name) to be removed"
type:
string
steps:
- run:
name: use Dockerhub API to remove temporary image
command: |
HUB_TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d "{\"username\": \"$DOCKERHUB_USERNAME\", \"password\": \"$DOCKERHUB_PASS\"}" https://hub.docker.com/v2/users/login/ | jq -r .token)
set -x
curl -i -X DELETE -H "Accept: application/json" -H "Authorization: JWT $HUB_TOKEN" https://hub.docker.com/v2/namespaces/ocrd/repositories/all/tags/<< parameters.tag >>-${CIRCLE_SHA1}/
# must be unconditional (both on_error and on_success)
when: always
build:
docker:
- image: cimg/base:current-22.04
resource_class: large
description: "template for all docker-* build jobs"
parameters:
tag:
description: "image tag (full variant name) to be built"
type:
string
dep:
description: "image tag (full variant name) this depends on (should _not_ be rebuilt)"
type:
string
default: "core"
steps:
- checkout
- setup_remote_docker # https://circleci.com/docs/2.0/building-docker-images/
- setup_remote_docker
- run:
name: build image
command: make docker-maximum-cuda GIT_DEPTH=--single-branch DOCKER_PARALLEL=-j4
name: Build Docker image
command: make docker-<< parameters.tag >> -o docker-<< parameters.dep >> GIT_DEPTH=--single-branch
no_output_timeout: 30m
- run:
name: test image
command: |
mkdir test-results
docker run --rm -v $PWD:/data ocrd/all:maximum-cuda make -C /build/core deps-test test PYTEST_ARGS=--junitxml=/data/test-results/core.xml
# cannot use docker run -v because the docker executor does not support volumes
# docker run --rm -v $PWD:/data ocrd/all:<< parameters.tag >> make -C /build/core deps-test test PYTEST_ARGS=--junitxml=/data/test-results/core.xml
id=`docker create ocrd/all:<< parameters.tag >> make -C /build/core deps-test test PYTEST_ARGS=--junitxml=core.xml`
docker start -a $id
docker cp $id:/build/core/core.xml test-results/
docker rm $id
- store_test_results:
path: test-results
- when:
# takes too long for 1h1m CircleCI timeout overall
# also, storage is limited...
condition: false
steps:
- run:
name: persist image
command: |
sudo apt install pigz
docker image save ocrd/all:maximum-cuda | pigz --fast > ocrd-all-maximum.tar.gz
no_output_timeout: 30m
# can be downloaded from CircleCI.com and imported via "docker image load"
- store_artifacts:
path: ocrd-all-maximum.tar.gz
destination: artifacts
path: test-results/core.xml
deploy:
docker:
- image: cimg/base:current-22.04
description: "template for all docker-* deploy jobs"
parameters:
variant:
tag:
description: "image tag (full variant name) to be pushed"
type:
string
steps:
- checkout
- setup_remote_docker # https://circleci.com/docs/2.0/building-docker-images/
- setup_remote_docker
- run:
name: Build Docker image
command: make docker-<< parameters.variant >> GIT_DEPTH=--single-branch
# fails due to pip races: DOCKER_PARALLEL=-j3
no_output_timeout: 30m
- run:
name: Alias Docker images
command: docker tag ocrd/all:<< parameters.variant >> ocrd/all:<< parameters.variant >>-git
name: Alias Docker image
command: docker tag ocrd/all:<< parameters.tag >> ocrd/all:<< parameters.tag >>-git
- run:
name: Login to Docker Hub
command: echo "$DOCKERHUB_PASS" | docker login --username "$DOCKERHUB_USERNAME" --password-stdin
- run:
name: Push images to Docker Hub
no_output_timeout: 2.5h
command: |
docker push ocrd/all:<< parameters.variant >>
docker push ocrd/all:<< parameters.variant >>-git
docker push ocrd/all:<< parameters.tag >>
docker push ocrd/all:<< parameters.tag >>-git
- when:
condition:
equal: [ maximum, << parameters.variant >> ]
equal: [ maximum, << parameters.tag >> ]
steps:
- run:
name: Alias and push intermediate variants
command: |
docker tag ocrd/all:medium ocrd/all:medium-git
docker tag ocrd/all:minimum ocrd/all:minimum-git
docker push ocrd/all:minimum
docker push ocrd/all:minimum-git
docker push ocrd/all:medium
docker push ocrd/all:medium-git
- run:
name: store ocrd-all-tool.json
command: |
Expand All @@ -91,28 +122,186 @@ jobs:
destination: ocrd-all-module-dir.json
- when:
condition:
equal: [ maximum-cuda, << parameters.variant >> ]
equal: [ maximum-cuda, << parameters.tag >> ]
steps:
- run:
name: Create a date-versioned mirror of ocrd/all:maximum-cuda
command: bash release.sh release-dockerhub
- run:
name: Update badge
command: curl -X POST "$MICROBADGER_WEBHOOK" || true
- when:
# takes too long for 1h1m CircleCI timeout overall
# also, storage is limited...
condition: false
steps:
- run:
name: persist image
command: |
sudo apt install pigz
docker image save ocrd/all:<< parameters.tag >> | pigz --fast > ocrd-all-maximum.tar.gz
no_output_timeout: 30m
# can be downloaded from CircleCI.com and imported via "docker image load"
- store_artifacts:
path: ocrd-all-maximum.tar.gz
destination: artifacts

jobs:
build-mini:
docker:
- image: cimg/base:current-22.04
parameters:
variant:
type:
string
steps:
- build:
tag: minim<< parameters.variant >>
- dockerhub-store:
tag: minim<< parameters.variant >>
build-medi:
docker:
- image: cimg/base:current-22.04
parameters:
variant:
type:
string
steps:
- dockerhub-load:
tag: minim<< parameters.variant >>
- unless:
condition:
equal: [ master, << pipeline.git.branch >>]
# only PR testing – not needed anymore
steps:
- dockerhub-remove:
tag: minim<< parameters.variant >>
- build:
dep: minim<< parameters.variant >>
tag: medi<< parameters.variant >>
- dockerhub-store:
tag: medi<< parameters.variant >>
build-maxi:
docker:
- image: cimg/base:current-22.04
parameters:
variant:
type:
string
steps:
- dockerhub-load:
tag: medi<< parameters.variant >>
- unless:
condition:
equal: [ master, << pipeline.git.branch >>]
# only PR testing – not needed anymore
steps:
- dockerhub-remove:
tag: medi<< parameters.variant >>
- build:
dep: medi<< parameters.variant >>
tag: maxim<< parameters.variant >>
- when:
condition:
equal: [ master, << pipeline.git.branch >>]
# only PR testing – not needed
steps:
- dockerhub-store:
tag: maxim<< parameters.variant >>
deploy-mini:
docker:
- image: cimg/base:current-22.04
parameters:
variant:
type:
string
steps:
- dockerhub-load:
tag: minim<< parameters.variant >>
- deploy:
tag: minim<< parameters.variant >>
- dockerhub-remove:
tag: minim<< parameters.variant >>
deploy-medi:
docker:
- image: cimg/base:current-22.04
parameters:
variant:
type:
string
steps:
- dockerhub-load:
tag: medi<< parameters.variant >>
- deploy:
tag: medi<< parameters.variant >>
- dockerhub-remove:
tag: medi<< parameters.variant >>
deploy-maxi:
docker:
- image: cimg/base:current-22.04
parameters:
variant:
type:
string
steps:
- dockerhub-load:
tag: maxim<< parameters.variant >>
- deploy:
tag: maxim<< parameters.variant >>
- dockerhub-remove:
tag: maxim<< parameters.variant >>

workflows:
version: 2
build-master:
build:
jobs:
- deploy:
- build-mini:
name: build-minim<< matrix.variant >>
matrix:
parameters:
variant: [um, um-cuda]
- build-medi:
name: build-medi<< matrix.variant >>
matrix:
parameters:
variant: [um, um-cuda]
requires:
- build-minim<< matrix.variant >>
- build-maxi:
name: build-maxim<< matrix.variant >>
matrix:
parameters:
variant: [maximum, maximum-cuda]
variant: [um, um-cuda]
requires:
- build-medi<< matrix.variant >>
- deploy-mini:
name: deploy-minim<< matrix.variant >>
matrix:
parameters:
variant: [um, um-cuda]
requires:
- build-minim<< matrix.variant >>
filters:
branches:
only: master
build-pull-request:
jobs:
- build:
- deploy-medi:
name: deploy-medi<< matrix.variant >>
matrix:
parameters:
variant: [um, um-cuda]
requires:
- build-medi<< matrix.variant >>
filters:
branches:
only: master
- deploy-maxi:
name: deploy-maxim<< matrix.variant >>
matrix:
parameters:
variant: [um, um-cuda]
requires:
- build-maxim<< matrix.variant >>
filters:
branches:
ignore: master
only: master

3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,6 @@
[submodule "ocrd_froc"]
path = ocrd_froc
url = https://github.com/OCR-D/ocrd_froc
[submodule "ocrd_page2alto"]
path = ocrd_page2alto
url = https://github.com/OCR-D/page-to-alto
Loading