diff --git a/.gitignore b/.gitignore index 78355de2..ee35afc4 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ dist *.rpm *.gz *.tgz + test/helm/enterprise-integration-test-values.yaml diff --git a/docker-bake.hcl b/docker-bake.hcl index 784b9592..943b1db2 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -15,7 +15,7 @@ group "ats" { } group "tengines" { - targets = ["tengine_libreoffice", "tengine_imagemagick", "tengine_tika"] + targets = ["tengine_libreoffice", "tengine_imagemagick", "tengine_tika", "tengine_pdfrenderer"] } variable "LABEL_VENDOR" { @@ -360,3 +360,31 @@ target "tengine_tika" { tags = ["localhost/alfresco-tika:latest"] output = ["type=docker"] } + +variable "ALFRESCO_PDFRENDERER_USER_NAME" { + default = "pdf" +} + +variable "ALFRESCO_PDFRENDERER_USER_ID" { + default = "33001" +} + +target "tengine_pdfrenderer" { + dockerfile = "./tengine/pdfrenderer/Dockerfile" + inherits = ["java_base"] + contexts = { + java_base = "target:java_base" + } + args = { + ALFRESCO_PDFRENDERER_GROUP_NAME = "${ALFRESCO_GROUP_NAME}" + ALFRESCO_PDFRENDERER_GROUP_ID = "${ALFRESCO_GROUP_ID}" + ALFRESCO_PDFRENDERER_USER_NAME = "${ALFRESCO_PDFRENDERER_USER_NAME}" + ALFRESCO_PDFRENDERER_USER_ID = "${ALFRESCO_PDFRENDERER_USER_ID}" + } + labels = { + "org.opencontainers.image.title" = "${PRODUCT_LINE} Transform Engine PDF Renderer" + "org.opencontainers.image.description" = "Alfresco Transform Engine PDF Renderer" + } + tags = ["localhost/alfresco-pdf-renderer:latest"] + output = ["type=docker"] +} diff --git a/tengine/pdfrenderer/Dockerfile b/tengine/pdfrenderer/Dockerfile new file mode 100644 index 00000000..be522275 --- /dev/null +++ b/tengine/pdfrenderer/Dockerfile @@ -0,0 +1,29 @@ +FROM java_base + +ENV PDFRENDERER_COMMON_PATH=tengine/pdfrenderer +ENV JAVA_OPTS_CONTAINER_FLAGS=-XX:MaxRAMPercentage=80 + +EXPOSE 8090 + +ARG ALFRESCO_PDFRENDERER_GROUP_NAME +ARG ALFRESCO_PDFRENDERER_GROUP_ID +ARG ALFRESCO_PDFRENDERER_USER_NAME +ARG ALFRESCO_PDFRENDERER_USER_ID + +RUN --mount=type=bind,source=${PDFRENDERER_COMMON_PATH},target=/dist \ + tar xzf /dist/*.tgz -C /usr/bin && \ + yum clean all + +ADD ${PDFRENDERER_COMMON_PATH}/alfresco-transform-pdf-renderer*.jar /opt/app.jar + +RUN groupadd -g ${ALFRESCO_PDFRENDERER_GROUP_ID} ${ALFRESCO_PDFRENDERER_GROUP_NAME} && \ + useradd -u ${ALFRESCO_PDFRENDERER_USER_ID} -g ${ALFRESCO_PDFRENDERER_GROUP_NAME} ${ALFRESCO_PDFRENDERER_USER_NAME} && \ + chgrp ${ALFRESCO_PDFRENDERER_GROUP_NAME} /opt/app.jar + +USER ${ALFRESCO_PDFRENDERER_USER_NAME} + +HEALTHCHECK --interval=20s --timeout=10s --retries=3 --start-period=30s \ + CMD curl -f http://localhost:8090/live || exit 1 + +COPY ${PDFRENDERER_COMMON_PATH}/entrypoint.sh /entrypoint.sh +CMD ["/entrypoint.sh"] diff --git a/tengine/pdfrenderer/README.md b/tengine/pdfrenderer/README.md new file mode 100644 index 00000000..97b189cb --- /dev/null +++ b/tengine/pdfrenderer/README.md @@ -0,0 +1,22 @@ +# Runtime variables + +Sets of variables configurable with your docker image + +## -pdf-renderer + +```yaml + +transform-core-pdf-renderer: + image: localhost/alfresco-pdf-renderer:YOUR-TAG + environment: + JAVA_OPTS: + ACTIVEMQ_URL: nio://activemq:61616 + ACTIVEMQ_USER: admin + ACTIVEMQ_PASSWORD: admin + FILE_STORE_URL: http://shared-file-store:8099/alfresco/api/-default-/private/sfs/versions/1/file + +``` + +- `JAVA_OPTS` - Additional java options +- `ACTIVEMQ_URL` - The URL for Alfresco ActiveMQ. +- `FILE_STORE_URL` - Alfresco Shared FileStore endpoint. diff --git a/tengine/pdfrenderer/artifacts.json b/tengine/pdfrenderer/artifacts.json new file mode 100644 index 00000000..ed5e23ee --- /dev/null +++ b/tengine/pdfrenderer/artifacts.json @@ -0,0 +1,22 @@ +{ + "artifacts": { + "acs23": [ + { + "name": "alfresco-pdf-renderer", + "version": "1.2", + "path": "tengine/pdfrenderer", + "classifier": "-linux.tgz", + "repository": "releases", + "group": "org.alfresco" + }, + { + "name": "alfresco-transform-pdf-renderer", + "version": "5.1.3", + "path": "tengine/pdfrenderer", + "classifier": ".jar", + "repository": "releases", + "group": "org.alfresco" + } + ] + } +} diff --git a/tengine/pdfrenderer/entrypoint.sh b/tengine/pdfrenderer/entrypoint.sh new file mode 100755 index 00000000..158a2a1e --- /dev/null +++ b/tengine/pdfrenderer/entrypoint.sh @@ -0,0 +1,2 @@ +#!/bin/bash +exec java $JAVA_OPTS $JAVA_OPTS_CONTAINER_FLAGS -jar /opt/app.jar diff --git a/test/helm/test-overrides.yaml b/test/helm/test-overrides.yaml index 7ada7d0d..96ba304d 100644 --- a/test/helm/test-overrides.yaml +++ b/test/helm/test-overrides.yaml @@ -19,7 +19,10 @@ alfresco-search-enterprise: repository: localhost/alfresco-elasticsearch-live-indexing-path tag: latest alfresco-transform-service: - #pdfrenderer: + pdfrenderer: + image: + repository: localhost/alfresco-pdf-renderer + tag: latest imagemagick: image: repository: localhost/alfresco-imagemagick