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

OPSEXP-2722 Add ATS trouter image Dockerfile #7

Merged
merged 14 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 23 additions & 0 deletions ats/trouter/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM java_base

EXPOSE 8095 8443
ENV JAVA_OPTS_CONTAINER_FLAGS=-XX:MaxRAMPercentage=80

ARG ALFRESCO_TROUTER_GROUP_NAME
ARG ALFRESCO_TROUTER_GROUP_ID
ARG ALFRESCO_TROUTER_USER_NAME
ARG ALFRESCO_TROUTER_USER_ID

ADD ats/trouter/alfresco-transform-router*.jar /opt/app.jar

RUN groupadd -g ${ALFRESCO_TROUTER_GROUP_ID} ${ALFRESCO_TROUTER_GROUP_NAME} && \
useradd -u ${ALFRESCO_TROUTER_USER_ID} -g ${ALFRESCO_TROUTER_GROUP_NAME} ${ALFRESCO_TROUTER_USER_NAME} && \
chgrp ${ALFRESCO_TROUTER_GROUP_NAME} /opt/app.jar

USER ${ALFRESCO_TROUTER_USER_NAME}

HEALTHCHECK --interval=30s --timeout=10s --retries=3 --start-period=1m \
CMD curl -f http://localhost:8095/actuator/health || exit 1
alxgomz marked this conversation as resolved.
Show resolved Hide resolved

COPY ats/trouter/entrypoint.sh /entrypoint.sh
CMD ["/entrypoint.sh"]
41 changes: 41 additions & 0 deletions ats/trouter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Runtime variables

Sets of variables configurable with your docker image

## trouter

```yaml

transform-router:
image: alfresco-transform-router:YOUR-TAG
environment:
JAVA_OPTS:
ACTIVEMQ_URL: nio://activemq:61616
ACTIVEMQ_USER: "admin"
ACTIVEMQ_PASSWORD: "admin"

CORE_AIO_URL: http://transform-core-aio:8090
FILE_STORE_URL: http://shared-file-store:8099/alfresco/api/-default-/private/sfs/versions/1/file

TRANSFORMER_ENGINE_PROTOCOL: jms

IMAGEMAGICK_URL: "http://imagemagick:8090"
PDF_RENDERER_URL: "http://alfresco-pdf-renderer:8090"
LIBREOFFICE_URL: "http://libreoffice:8090"
TIKA_URL: "http://tika:8090"
MISC_URL: "http://misc:8090"

```

- `JAVA_OPTS` - Additional java options
alxgomz marked this conversation as resolved.
Show resolved Hide resolved
- `ACTIVEMQ_URL` - The URL for Alfresco ActiveMQ.
- `ACTIVEMQ_USER` - The username for ActiveMQ.
- `ACTIVEMQ_PASSWORD` - The password for ActiveMQ.
- `CORE_AIO_URL` - Transform Core AIO server
- `FILE_STORE_URL` - The URL for the Alfresco Shared FileStore endpoint.
- `TRANSFORMER_ENGINE_PROTOCOL` - Specifies the protocol used by the transform engine. For example, `jms`.
- `IMAGEMAGICK_URL` - The URL for the ImageMagick service
- `PDF_RENDERER_URL` - The URL for the PDF Renderer service
- `LIBREOFFICE_URL` - The URL for the LibreOffice service
- `TIKA_URL` - The URL for the Tika service
- `MISC_URL` - The URL for Mics service
13 changes: 13 additions & 0 deletions ats/trouter/artifacts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"artifacts": {
"acs23": [
{
"name": "alfresco-transform-router",
"version": "4.1.3",
"path": "ats/trouter",
"classifier": ".jar",
"group": "org.alfresco"
}
]
}
}
3 changes: 3 additions & 0 deletions ats/trouter/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

exec java $JAVA_OPTS $JAVA_OPTS_CONTAINER_FLAGS -jar /opt/app.jar
alxgomz marked this conversation as resolved.
Show resolved Hide resolved
50 changes: 45 additions & 5 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group "default" {
targets = ["content_service", "enterprise-search"]
targets = ["content_service", "enterprise-search", "ats"]
}

group "content_service" {
Expand All @@ -10,6 +10,10 @@ group "enterprise-search" {
targets = ["search_liveindexing"]
}

group "ats" {
targets = ["ats_trouter"]
}

variable "LABEL_VENDOR" {
default = "Hyland Software, Inc."
}
Expand Down Expand Up @@ -108,7 +112,7 @@ target "java_base" {
"org.opencontainers.image.source" = "$LABEL_SOURCE"
"org.opencontainers.image.authors" = "${LABEL_AUTHOR}"
}
tags = ["alfresco-base-java:${JDIST}${JAVA_MAJOR}-${DISTRIB_NAME}${DISTRIB_MAJOR}"]
tags = ["localhost/alfresco-base-java:${JDIST}${JAVA_MAJOR}-${DISTRIB_NAME}${DISTRIB_MAJOR}"]
output = ["type=cacheonly"]
}

Expand Down Expand Up @@ -150,7 +154,7 @@ target "tomcat_base" {
"org.opencontainers.image.title" = "${PRODUCT_LINE} Tomcat"
"org.opencontainers.image.description" = "A base image shipping Tomcat for Alfresco Products"
}
tags = ["alfresco-base-tomcat:tomcat${TOMCAT_MAJOR}-${JDIST}${JAVA_MAJOR}-${DISTRIB_NAME}${DISTRIB_MAJOR}"]
tags = ["localhost/alfresco-base-tomcat:tomcat${TOMCAT_MAJOR}-${JDIST}${JAVA_MAJOR}-${DISTRIB_NAME}${DISTRIB_MAJOR}"]
output = ["type=cacheonly"]
}

Expand All @@ -171,7 +175,7 @@ target "repository" {
"org.opencontainers.image.title" = "${PRODUCT_LINE} Content Repository"
"org.opencontainers.image.description" = "Alfresco Content Services Repository"
}
tags = ["alfresco-content-repository:latest"]
tags = ["localhost/alfresco-content-repository:latest"]
output = ["type=docker"]
}

Expand Down Expand Up @@ -209,6 +213,42 @@ target "search_liveindexing" {
"org.opencontainers.image.title" = "${PRODUCT_LINE} Enterprise Search - ${liveindexing.name}"
"org.opencontainers.image.description" = "${PRODUCT_LINE} Enterprise Search - ${liveindexing.name} live indexing"
}
tags = ["${liveindexing.artifact}:latest"]
tags = ["localhost/${liveindexing.artifact}:latest"]
output = ["type=docker"]
}

variable "ALFRESCO_TROUTER_GROUP_NAME" {
default = "Alfresco"
}

variable "ALFRESCO_TROUTER_GROUP_ID" {
default = "1000"
}

variable "ALFRESCO_TROUTER_USER_NAME" {
default = "trouter"
}

variable "ALFRESCO_TROUTER_USER_ID" {
default = "33016"
}

target "ats_trouter" {
dockerfile = "./ats/trouter/Dockerfile"
inherits = ["java_base"]
contexts = {
java_base = "target:java_base"
}
args = {
ALFRESCO_TROUTER_GROUP_NAME = "${ALFRESCO_TROUTER_GROUP_NAME}"
ALFRESCO_TROUTER_GROUP_ID = "${ALFRESCO_TROUTER_GROUP_ID}"
ALFRESCO_TROUTER_USER_NAME = "${ALFRESCO_TROUTER_USER_NAME}"
ALFRESCO_TROUTER_USER_ID = "${ALFRESCO_TROUTER_USER_ID}"
}
labels = {
"org.opencontainers.image.title" = "${PRODUCT_LINE} ATS Trouter"
"org.opencontainers.image.description" = "Alfresco Transform Service Trouter"
}
tags = ["localhost/alfresco-transform-router:latest"]
output = ["type=docker"]
}
11 changes: 4 additions & 7 deletions docker-compose/docker-compose-components.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,8 @@ services:
start_period: 1m
transform-router:
mem_limit: 512m
image: quay.io/alfresco/alfresco-transform-router:4.1.2
image: localhost/alfresco-transform-router:latest
environment:
JAVA_OPTS: >-
-XX:MinRAMPercentage=50
-XX:MaxRAMPercentage=80
ACTIVEMQ_URL: nio://activemq:61616
CORE_AIO_URL: http://transform-core-aio:8090
FILE_STORE_URL: >-
Expand Down Expand Up @@ -182,17 +179,17 @@ services:
ports:
- "9090:9090"
live-indexing-metadata:
image: alfresco-elasticsearch-live-indexing-metadata:latest
image: localhost/alfresco-elasticsearch-live-indexing-metadata:latest
environment:
SPRING_ELASTICSEARCH_REST_URIS: http://elastic:9200
SPRING_ACTIVEMQ_BROKERURL: nio://activemq:61616
live-indexing-path:
image: alfresco-elasticsearch-live-indexing-path:latest
image: localhost/alfresco-elasticsearch-live-indexing-path:latest
environment:
SPRING_ELASTICSEARCH_REST_URIS: http://elasticsearch:9200
SPRING_ACTIVEMQ_BROKERURL: nio://activemq:61616
live-indexing-content:
image: alfresco-elasticsearch-live-indexing-content:latest
image: localhost/alfresco-elasticsearch-live-indexing-content:latest
environment:
SPRING_ELASTICSEARCH_REST_URIS: http://elasticsearch:9200
SPRING_ACTIVEMQ_BROKERURL: nio://activemq:61616
Expand Down
7 changes: 2 additions & 5 deletions docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,8 @@ services:
start_period: 1m
transform-router:
mem_limit: 512m
image: quay.io/alfresco/alfresco-transform-router:4.1.2
image: localhost/alfresco-transform-router:latest
environment:
JAVA_OPTS: >-
-XX:MinRAMPercentage=50
-XX:MaxRAMPercentage=80
ACTIVEMQ_URL: nio://activemq:61616
CORE_AIO_URL: http://transform-core-aio:8090
FILE_STORE_URL: >-
Expand Down Expand Up @@ -182,7 +179,7 @@ services:
ports:
- "9090:9090"
live-indexing:
image: alfresco-elasticsearch-live-indexing:latest
image: localhost/alfresco-elasticsearch-live-indexing:latest
environment:
SPRING_ELASTICSEARCH_REST_URIS: http://elasticsearch:9200
SPRING_ACTIVEMQ_BROKERURL: nio://activemq:61616
Expand Down
2 changes: 1 addition & 1 deletion scripts/fetch-artifact.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cd ${REPO_ROOT}/..

for i in $(find . -name artifacts.json -mindepth 2); do
for j in $(jq -r ".artifacts.acs${INDEX_KEY} | keys | .[]" $i); do
ARTIFACT_BASEURL="https://nexus.alfresco.com/nexus/service/local/repositories/enterprise-releases/content"
ARTIFACT_BASEURL="https://nexus.alfresco.com/nexus/service/local/repositories/enterprise-releases"
ARTIFACT_NAME=$(jq -r ".artifacts.acs${INDEX_KEY}[$j].name" $i)
ARTIFACT_VERSION=$(jq -r ".artifacts.acs${INDEX_KEY}[$j].version" $i)
ARTIFACT_EXT=$(jq -r ".artifacts.acs${INDEX_KEY}[$j].classifier" $i)
Expand Down