Skip to content

Commit

Permalink
OPSEXP-2726 Add T-Engine Tika image Dockerfile (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmacius authored Aug 5, 2024
1 parent 654d3ef commit 70af9c1
Show file tree
Hide file tree
Showing 11 changed files with 118 additions and 13 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v5.34.0

- name: Setup nexus authentication
run: |
echo "machine nexus.alfresco.com" >> ~/.netrc
Expand Down Expand Up @@ -74,6 +76,10 @@ jobs:
run: |
docker save -o /tmp/${{ env.ARTIFACT_NAME }}.tar $(docker images --format "{{.Repository}}:{{.Tag}}" | grep alfresco)
- name: Check disk space
run: df -h
if: always()

- name: Upload images as artifact
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ dist
*.jar
*.rpm
*.gz

*.tgz
test/helm/enterprise-integration-test-values.yaml
32 changes: 30 additions & 2 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ group "ats" {
}

group "tengines" {
targets = ["tengine_libreoffice", "tengine_imagemagick"]
targets = ["tengine_libreoffice", "tengine_imagemagick", "tengine_tika"]
}

variable "LABEL_VENDOR" {
Expand Down Expand Up @@ -310,7 +310,7 @@ variable "ALFRESCO_LIBREOFFICE_USER_NAME" {
}

variable "ALFRESCO_LIBREOFFICE_USER_ID" {
default = "33002"
default = "33003"
}

target "tengine_libreoffice" {
Expand All @@ -332,3 +332,31 @@ target "tengine_libreoffice" {
tags = ["localhost/alfresco-libreoffice:latest"]
output = ["type=docker"]
}

variable "ALFRESCO_TIKA_USER_NAME" {
default = "tika"
}

variable "ALFRESCO_TIKA_USER_ID" {
default = "33004"
}

target "tengine_tika" {
dockerfile = "./tengine/tika/Dockerfile"
inherits = ["java_base"]
contexts = {
java_base = "target:java_base"
}
args = {
ALFRESCO_TIKA_GROUP_NAME = "${ALFRESCO_GROUP_NAME}"
ALFRESCO_TIKA_GROUP_ID = "${ALFRESCO_GROUP_ID}"
ALFRESCO_TIKA_USER_NAME = "${ALFRESCO_TIKA_USER_NAME}"
ALFRESCO_TIKA_USER_ID = "${ALFRESCO_TIKA_USER_ID}"
}
labels = {
"org.opencontainers.image.title" = "${PRODUCT_LINE} Transform Engine Tika"
"org.opencontainers.image.description" = "Alfresco Transform Engine Tika"
}
tags = ["localhost/alfresco-tika:latest"]
output = ["type=docker"]
}
4 changes: 2 additions & 2 deletions tengine/imagemagick/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ARG ALFRESCO_IMAGEMAGICK_GROUP_ID
ARG ALFRESCO_IMAGEMAGICK_USER_NAME
ARG ALFRESCO_IMAGEMAGICK_USER_ID

ADD ${IMAGEMAGICK_COMMON_PATH}/alfresco-transform-imagemagick*.jar /usr/bin/app.jar
ADD ${IMAGEMAGICK_COMMON_PATH}/alfresco-transform-imagemagick*.jar /opt/app.jar
ADD ${IMAGEMAGICK_COMMON_PATH}/imagemagick-distribution*-el9.rpm /tmp/imagemagick-distribution-el9.rpm
ADD ${IMAGEMAGICK_COMMON_PATH}/libs/imagemagick-distribution*-libs-el9.rpm /tmp/imagemagick-distribution-libs-el9.rpm

Expand All @@ -21,7 +21,7 @@ RUN yum install -y $IMAGEMAGICK_DEP_RPM_URL && \

RUN groupadd -g ${ALFRESCO_IMAGEMAGICK_GROUP_ID} ${ALFRESCO_IMAGEMAGICK_GROUP_NAME} && \
useradd -u ${ALFRESCO_IMAGEMAGICK_USER_ID} -g ${ALFRESCO_IMAGEMAGICK_GROUP_NAME} ${ALFRESCO_IMAGEMAGICK_USER_NAME} && \
chgrp ${ALFRESCO_IMAGEMAGICK_GROUP_NAME} /usr/bin/app.jar
chgrp ${ALFRESCO_IMAGEMAGICK_GROUP_NAME} /opt/app.jar

USER ${ALFRESCO_IMAGEMAGICK_USER_NAME}

Expand Down
2 changes: 1 addition & 1 deletion tengine/imagemagick/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

exec java $JAVA_OPTS $JAVA_OPTS_CONTAINER_FLAGS -jar /usr/bin/app.jar
exec java $JAVA_OPTS $JAVA_OPTS_CONTAINER_FLAGS -jar /opt/app.jar
4 changes: 2 additions & 2 deletions tengine/libreoffice/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ RUN --mount=type=bind,source=${LIBREOFFICE_COMMON_PATH},target=/dist \
rm -rf /tmp/dist && \
yum clean all

ADD ${LIBREOFFICE_COMMON_PATH}/alfresco-transform-libreoffice*.jar /usr/bin/app.jar
ADD ${LIBREOFFICE_COMMON_PATH}/alfresco-transform-libreoffice*.jar /opt/app.jar

RUN groupadd -g ${ALFRESCO_LIBREOFFICE_GROUP_ID} ${ALFRESCO_LIBREOFFICE_GROUP_NAME} && \
useradd -u ${ALFRESCO_LIBREOFFICE_USER_ID} -g ${ALFRESCO_LIBREOFFICE_GROUP_NAME} ${ALFRESCO_LIBREOFFICE_USER_NAME} && \
chgrp ${ALFRESCO_LIBREOFFICE_GROUP_NAME} /usr/bin/app.jar
chgrp ${ALFRESCO_LIBREOFFICE_GROUP_NAME} /opt/app.jar

USER ${ALFRESCO_LIBREOFFICE_USER_NAME}

Expand Down
30 changes: 30 additions & 0 deletions tengine/tika/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM java_base

ENV JAVA_OPTS_CONTAINER_FLAGS=-XX:MaxRAMPercentage=80
ENV TIKA_COMMON_PATH=tengine/tika
ENV TIKA_DEP_RPM_URL=https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm

EXPOSE 8090

ARG ALFRESCO_TIKA_GROUP_NAME
ARG ALFRESCO_TIKA_GROUP_ID
ARG ALFRESCO_TIKA_USER_NAME
ARG ALFRESCO_TIKA_USER_ID

RUN yum install -y ${TIKA_DEP_RPM_URL} && \
yum -y install perl-Image-ExifTool && \
yum clean all

ADD ${TIKA_COMMON_PATH}/alfresco-transform-tika*.jar /opt/app.jar

RUN groupadd -g ${ALFRESCO_TIKA_GROUP_ID} ${ALFRESCO_TIKA_GROUP_NAME} && \
useradd -u ${ALFRESCO_TIKA_USER_ID} -g ${ALFRESCO_TIKA_GROUP_NAME} ${ALFRESCO_TIKA_USER_NAME} && \
chgrp ${ALFRESCO_TIKA_GROUP_NAME} /opt/app.jar

USER ${ALFRESCO_TIKA_USER_NAME}

HEALTHCHECK --interval=20s --timeout=10s --retries=3 --start-period=30s \
CMD curl -f http://localhost:8090/live || exit 1

COPY ${TIKA_COMMON_PATH}/entrypoint.sh /entrypoint.sh
CMD ["/entrypoint.sh"]
22 changes: 22 additions & 0 deletions tengine/tika/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Runtime variables

Sets of variables configurable with your docker image

## tika

```yaml

transform-core-tika:
image: localhost/alfresco-tika: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.
14 changes: 14 additions & 0 deletions tengine/tika/artifacts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"artifacts": {
"acs23": [
{
"name": "alfresco-transform-tika",
"version": "5.1.3",
"path": "tengine/tika",
"classifier": ".jar",
"repository": "releases",
"group": "org.alfresco"
}
]
}
}
2 changes: 2 additions & 0 deletions tengine/tika/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
exec java $JAVA_OPTS $JAVA_OPTS_CONTAINER_FLAGS -jar /opt/app.jar
13 changes: 8 additions & 5 deletions test/helm/test-overrides.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ alfresco-transform-service:
image:
repository: localhost/alfresco-imagemagick
tag: latest
#libreoffice:
#image:
# repository: localhost/alfresco-libreoffice
# tag: latest
#tika:
# libreoffice:
# image:
# repository: localhost/alfresco-libreoffice
# tag: latest
tika:
image:
repository: localhost/alfresco-tika
tag: latest
#transformmisc:
transformrouter:
image:
Expand Down

0 comments on commit 70af9c1

Please sign in to comment.