Skip to content
Snippets Groups Projects
Commit 78f4ff80 authored by ml bonhomme's avatar ml bonhomme :bee: Committed by Erwan Rouchet
Browse files

Add PDF and Page XML export Arkindex features

parent 391be3d0
No related branches found
No related tags found
1 merge request!2473Add PDF and Page XML export Arkindex features
......@@ -90,6 +90,9 @@ class Command(BaseCommand):
"""
assert worker.archived is None, "Cannot assign a version on an archived worker to a feature"
# Since there can be worker versions using the same Docker image but with different commands,
# we need to filter by command as well as by Docker image.
docker_command_filter = {"configuration__docker__command": docker_command} if docker_command else {"configuration__docker__command__isnull": True}
# docker_image_iid is not unique, so we sort by state and take the most recent one.
# Sorting by state means we prefer `available` versions first, then `created`, then `error`.
worker_version = worker.versions.filter(
......@@ -99,6 +102,7 @@ class Command(BaseCommand):
configuration__user_configuration__isnull=True,
gpu_usage=FeatureUsage.Disabled,
model_usage=FeatureUsage.Disabled,
**docker_command_filter
).order_by("state", "-updated").first()
if worker_version:
......
......@@ -666,6 +666,8 @@ class ArkindexFeature(Enum):
InitElements = "init_elements"
FileImport = "file_import"
S3Ingest = "s3_ingest"
ExportPDF = "pdf_export"
ExportPageXML = "pagexml_export"
class WorkerVersion(models.Model):
......
......@@ -11,3 +11,9 @@ features:
command: worker-init-elements
s3_ingest:
image: registry.gitlab.teklia.com/arkindex/workers/import/s3:0.1.0
pdf_export:
image: registry.gitlab.teklia.com/arkindex/workers/export:0.1.0
command: worker-export-pdf
pagexml_export:
image: registry.gitlab.teklia.com/arkindex/workers/export:0.1.0
command: worker-export-pagexml
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment