-
Notifications
You must be signed in to change notification settings - Fork 17
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
Makefile-test for ocrd-network #407
base: master
Are you sure you want to change the base?
Conversation
you can set or pass |
I agree, but ideally the compose file offers both ways, so the user can decide whether to re-build ( |
I believe we should try to generate the docker-compose files per module from their respective ocrd-tool.json (or the ocrd-all-tool.json) and then include all sub-compose files into a single top-level one, with some shared definitions, networks and volumes. Generating could be done via another makefile rule. (But for the registry image names, we would need some additional field in the tool jsons, since it's unlikely these will become fully homogeneous and predictable.) |
you mean the |
Thanks for your help/input. May last commit updated the submodules (-PR's) and now the core image used is build with core/Dockerfile instead of building separately |
tests/network/docker-compose.yml
Outdated
context: ../../../core | ||
args: | ||
BASE_IMAGE: ubuntu:20.04 | ||
SKIP_ASSETS: 1 | ||
volumes: | ||
- "${PWD}/tests/network/test-workflow-1.txt:/ocrd-data/assets/ocrd_all-test-workflow.txt" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, it seems like this mountpoint is the only reason to have a definition of ocrd_network_core_test
.
If you followed my proposal to integrate the non-dummy workflow directly into core (but skip that test normally), then that could simply be done in the original compose file (i.e. the mountpoint for the non-dummy workflow next to dummy-workflow.txt
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, it seems like this mountpoint is the only reason to have a definition of ocrd_network_core_test.
This should now be possible since we decided to switch from CircleCI to GitHub Actions. Volume mapping was not possible in CircleCI. Check here. Hence, we had to use other hacks to achieve what we wanted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MehmedGIT ok I think I understand – but why didn't you just switch to named volumes on CircleCI (and docker cp
the required data into the volume from the host VM)?
Also, my point was merely that this config can be done in core alone (instead of a mix of compose files in core and ocrd_all). If the volume works there for the dummy workflow (however the VM is set up), then it should also work for the multimodule workflow (when additionally installing all the other module containers).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but why didn't you just switch to named volumes on CircleCI (and docker cp the required data into the volume from the host VM)?
Potentially that could have worked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I want to move the workflow to core as proposed, but didn't had the time yet. And I think I will try to volume mount in core too, as proposed
Another problem to address is persistent model storage. In #378 we already established that we need named volumes. These could also be shared via compose file, so all module containers contribute to a single |
I also find this important since |
Makefile
Outdated
# a mechanism to test if all queues are there but that is not available yet. So sleeping | ||
# here for now | ||
sleep 10 | ||
-$(INTEGRATION_TEST_IN_DOCKER) pytest -k 'test_ocrd_all_workflow' -v |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-$(INTEGRATION_TEST_IN_DOCKER) pytest -k 'test_ocrd_all_workflow' -v | |
$(INTEGRATION_TEST_IN_DOCKER) pytest -k 'test_ocrd_all_workflow' -v |
We want failure of the test command in failure of the make integration-test
target, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the CI/CD pipeline, yes. However, when testing locally, failed tests leave leftovers. Potentially, we need both versions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But for that use-case we used to have the convention of passing a variable PYTEST_ARGS
where the user could insert things like --continue-on-collection-errors
, right?
Change service overwrite. Use first images from docker hub instead of self building.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more re-usable Dockerhub deployments now...
No longer depends on / extends core's docker-compose. dry vs kiss
This adds a test for the ocrd-network with ocrd_all. Inspired by this merged pr.
The tests are run with a makefile-task. To run this tests submodules are needed. Currently it is also based on multiple PR's because the Dockerfiles for the processors have to be modified.
Run the tests:
clone this PR and fetch necessary submodules
-
git clone -b docker-tests https://github.com/OCR-D/ocrd_all.git
-
cd ocrd_all
-
git submodule update --recursive --init core/ ocrd_olena/ ocrd_anybaseocr/ ocrd_cis/
build the used images the first time:
-
docker-compose --file core/tests/network/docker-compose.yml --file tests/network/docker-compose.yml build ocrd-olena-binarize ocrd-anybaseocr-crop ocrd-cis-ocropy-denoise ocrd-cis-ocropy-clip ocrd-cis-ocropy-segment ocrd-cis-ocropy-dewarp
- this should only be necessary once to build the used images
- this takes on my machine about 40 Minutes
run the tests:
make integration-test DOCKER_COMPOSE=docker-compose
(or else:make integration-test
)Open questions/tasks:
docker-compose currently uses for the core-test-container, which is used to run the tests, a self created Image because the test are not yet available in the published image (just a PR atm)