From 81f63135e5114c20a1cb173ab8407d463e0d338b Mon Sep 17 00:00:00 2001 From: pmacius Date: Thu, 25 Jul 2024 17:55:15 +0200 Subject: [PATCH 1/4] OPSEXP-2723 Add ARS SFS image Dockerfile --- ats/{trouter => }/README.md | 0 ats/sfs/Dockerfile | 29 ++++++++++++ ats/sfs/artifacts.json | 13 +++++ ats/sfs/entrypoint.sh | 3 ++ docker-bake.hcl | 50 ++++++++++++++------ docker-compose/docker-compose-components.yml | 5 +- docker-compose/docker-compose.yml | 5 +- 7 files changed, 82 insertions(+), 23 deletions(-) rename ats/{trouter => }/README.md (100%) create mode 100644 ats/sfs/Dockerfile create mode 100644 ats/sfs/artifacts.json create mode 100755 ats/sfs/entrypoint.sh diff --git a/ats/trouter/README.md b/ats/README.md similarity index 100% rename from ats/trouter/README.md rename to ats/README.md diff --git a/ats/sfs/Dockerfile b/ats/sfs/Dockerfile new file mode 100644 index 00000000..1df824ec --- /dev/null +++ b/ats/sfs/Dockerfile @@ -0,0 +1,29 @@ +FROM java_base + +EXPOSE 8099 +ENV JAVA_OPTS_CONTAINER_FLAGS=-XX:MaxRAMPercentage=80 + +ARG ALFRESCO_SFS_GROUP_NAME +ARG ALFRESCO_SFS_GROUP_ID +ARG ALFRESCO_SFS_USER_NAME +ARG ALFRESCO_SFS_USER_ID + +ADD ats/sfs/alfresco-shared-file-store-controller*.jar /opt/app.jar + +# Set default environment args +ARG FILE_STORE_DIR=/tmp/Alfresco + +RUN mkdir -p ${FILE_STORE_DIR} && \ + groupadd -g ${ALFRESCO_SFS_GROUP_ID} ${ALFRESCO_SFS_GROUP_NAME} && \ + useradd -u ${ALFRESCO_SFS_USER_ID} -G ${ALFRESCO_SFS_GROUP_NAME} ${ALFRESCO_SFS_USER_NAME} && \ + chgrp -R ${ALFRESCO_SFS_GROUP_NAME} ${FILE_STORE_DIR} && \ + chmod g+rwx ${FILE_STORE_DIR} && \ + chgrp ${ALFRESCO_SFS_GROUP_NAME} /opt/app.jar + +USER ${ALFRESCO_SFS_USER_NAME} + +HEALTHCHECK --interval=30s --timeout=10s --retries=3 --start-period=1m \ + CMD curl -f http://localhost:8099/actuator/health || exit 1 + +COPY ats/sfs/entrypoint.sh /entrypoint.sh +CMD ["/entrypoint.sh"] diff --git a/ats/sfs/artifacts.json b/ats/sfs/artifacts.json new file mode 100644 index 00000000..3b76fdfd --- /dev/null +++ b/ats/sfs/artifacts.json @@ -0,0 +1,13 @@ +{ + "artifacts": { + "acs23": [ + { + "name": "alfresco-shared-file-store-controller", + "version": "4.1.3", + "path": "ats/sfs", + "classifier": ".jar", + "group": "org.alfresco" + } + ] + } +} diff --git a/ats/sfs/entrypoint.sh b/ats/sfs/entrypoint.sh new file mode 100755 index 00000000..1f50ab1c --- /dev/null +++ b/ats/sfs/entrypoint.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +exec java $JAVA_OPTS $JAVA_OPTS_CONTAINER_FLAGS -jar /opt/app.jar diff --git a/docker-bake.hcl b/docker-bake.hcl index af80712e..146b2ee0 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -11,7 +11,7 @@ group "enterprise-search" { } group "ats" { - targets = ["ats_trouter"] + targets = ["ats_trouter", "ats_sfs"] } variable "LABEL_VENDOR" { @@ -66,11 +66,11 @@ variable "LIVEINDEXING" { default = "metadata" } -variable "ALFRESCO_REPO_GROUP_ID" { +variable "ALFRESCO_GROUP_ID" { default = "1000" } -variable "ALFRESCO_REPO_GROUP_NAME" { +variable "ALFRESCO_GROUP_NAME" { default = "alfresco" } @@ -166,8 +166,8 @@ target "repository" { tomcat_base = "target:tomcat_base" } args = { - ALFRESCO_REPO_GROUP_ID = "${ALFRESCO_REPO_GROUP_ID}" - ALFRESCO_REPO_GROUP_NAME = "${ALFRESCO_REPO_GROUP_NAME}" + ALFRESCO_REPO_GROUP_ID = "${ALFRESCO_GROUP_ID}" + ALFRESCO_REPO_GROUP_NAME = "${ALFRESCO_GROUP_NAME}" ALFRESCO_REPO_USER_ID = "${ALFRESCO_REPO_USER_ID}" ALFRESCO_REPO_USER_NAME = "${ALFRESCO_REPO_USER_NAME}" } @@ -217,14 +217,6 @@ target "search_liveindexing" { output = ["type=docker"] } -variable "ALFRESCO_TROUTER_GROUP_NAME" { - default = "Alfresco" -} - -variable "ALFRESCO_TROUTER_GROUP_ID" { - default = "1000" -} - variable "ALFRESCO_TROUTER_USER_NAME" { default = "trouter" } @@ -240,8 +232,8 @@ target "ats_trouter" { java_base = "target:java_base" } args = { - ALFRESCO_TROUTER_GROUP_NAME = "${ALFRESCO_TROUTER_GROUP_NAME}" - ALFRESCO_TROUTER_GROUP_ID = "${ALFRESCO_TROUTER_GROUP_ID}" + ALFRESCO_TROUTER_GROUP_NAME = "${ALFRESCO_GROUP_NAME}" + ALFRESCO_TROUTER_GROUP_ID = "${ALFRESCO_GROUP_ID}" ALFRESCO_TROUTER_USER_NAME = "${ALFRESCO_TROUTER_USER_NAME}" ALFRESCO_TROUTER_USER_ID = "${ALFRESCO_TROUTER_USER_ID}" } @@ -252,3 +244,31 @@ target "ats_trouter" { tags = ["localhost/alfresco-transform-router:latest"] output = ["type=docker"] } + +variable "ALFRESCO_SFS_USER_NAME" { + default = "sfs" +} + +variable "ALFRESCO_SFS_USER_ID" { + default = "33030" +} + +target "ats_sfs" { + dockerfile = "./ats/sfs/Dockerfile" + inherits = ["java_base"] + contexts = { + java_base = "target:java_base" + } + args = { + ALFRESCO_SFS_GROUP_NAME = "${ALFRESCO_GROUP_NAME}" + ALFRESCO_SFS_GROUP_ID = "${ALFRESCO_GROUP_ID}" + ALFRESCO_SFS_USER_NAME = "${ALFRESCO_SFS_USER_NAME}" + ALFRESCO_SFS_USER_ID = "${ALFRESCO_SFS_USER_ID}" + } + labels = { + "org.opencontainers.image.title" = "${PRODUCT_LINE} ATS Shared File Store" + "org.opencontainers.image.description" = "Alfresco Transform Service ATS Shared File Store" + } + tags = ["localhost/alfresco-shared-file-store:latest"] + output = ["type=docker"] +} diff --git a/docker-compose/docker-compose-components.yml b/docker-compose/docker-compose-components.yml index 45ea9bdf..31a449ef 100644 --- a/docker-compose/docker-compose-components.yml +++ b/docker-compose/docker-compose-components.yml @@ -74,12 +74,9 @@ services: depends_on: - activemq shared-file-store: - image: quay.io/alfresco/alfresco-shared-file-store:4.1.2 + image: localhost/alfresco-shared-file-store:latest mem_limit: 512m environment: - JAVA_OPTS: >- - -XX:MinRAMPercentage=50 - -XX:MaxRAMPercentage=80 scheduler.content.age.millis: 86400000 scheduler.cleanup.interval: 86400000 ports: diff --git a/docker-compose/docker-compose.yml b/docker-compose/docker-compose.yml index 769326c6..c0377629 100644 --- a/docker-compose/docker-compose.yml +++ b/docker-compose/docker-compose.yml @@ -74,12 +74,9 @@ services: depends_on: - activemq shared-file-store: - image: quay.io/alfresco/alfresco-shared-file-store:4.1.2 + image: localhost/alfresco-shared-file-store:latest mem_limit: 512m environment: - JAVA_OPTS: >- - -XX:MinRAMPercentage=50 - -XX:MaxRAMPercentage=80 scheduler.content.age.millis: 86400000 scheduler.cleanup.interval: 86400000 ports: From 9a2e5ea17ba759da584f3de93ff748e6434554e0 Mon Sep 17 00:00:00 2001 From: pmacius Date: Fri, 26 Jul 2024 09:45:16 +0200 Subject: [PATCH 2/4] Add readme --- ats/README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/ats/README.md b/ats/README.md index 4812059f..491e14e9 100644 --- a/ats/README.md +++ b/ats/README.md @@ -39,3 +39,34 @@ transform-router: - `LIBREOFFICE_URL` - The URL for the LibreOffice service - `TIKA_URL` - The URL for the Tika service - `MISC_URL` - The URL for Mics service + +## sfs + +```yaml + + shared-file-store: + image: localhost/alfresco-shared-file-store:YOUR-TAG + mem_limit: 512m + environment: + JAVA_OPTS: + scheduler.content.age.millis: 86400000 + scheduler.cleanup.interval: 86400000 + scheduler.contract.path: /tmp/scheduler.json + fileStorePath: /tmp/Alfresco + ports: + - "8099:8099" + volumes: + - shared-file-store-volume:/tmp/Alfresco/sfs +volumes: + shared-file-store-volume: + driver_opts: + type: tmpfs + device: tmpfs + +``` + +- `JAVA_OPTS` - Additional java options +- `scheduler.content.age.millis` - Content retention period. The default value is `86400000` +- `scheduler.cleanup.interval` - Cleanup Scheduler interval. The default value is `86400000` +- `scheduler.contract.path` - Cleanup Scheduler contract path. The default value is `/tmp/scheduler.json` +- `fileStorePath` - Shared File Store content storing path. The default value is `/tmp/Alfresco` From 4b386b1ff2181e64162f5a185b2bb8e8e69a88e1 Mon Sep 17 00:00:00 2001 From: pmacius Date: Fri, 26 Jul 2024 12:00:56 +0200 Subject: [PATCH 3/4] rebase --- ats/sfs/artifacts.json | 1 + 1 file changed, 1 insertion(+) diff --git a/ats/sfs/artifacts.json b/ats/sfs/artifacts.json index 3b76fdfd..0e2ad1e7 100644 --- a/ats/sfs/artifacts.json +++ b/ats/sfs/artifacts.json @@ -6,6 +6,7 @@ "version": "4.1.3", "path": "ats/sfs", "classifier": ".jar", + "repository": "enterprise-releases", "group": "org.alfresco" } ] From 32030ec0778a8e3a831a17c39569e86f98d2b1f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Maciusiak?= <158472457+pmacius@users.noreply.github.com> Date: Fri, 26 Jul 2024 13:03:30 +0200 Subject: [PATCH 4/4] Update ats/README.md Co-authored-by: Giovanni Toraldo <71768+gionn@users.noreply.github.com> --- ats/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ats/README.md b/ats/README.md index 491e14e9..a9e1b422 100644 --- a/ats/README.md +++ b/ats/README.md @@ -49,10 +49,10 @@ transform-router: mem_limit: 512m environment: JAVA_OPTS: - scheduler.content.age.millis: 86400000 - scheduler.cleanup.interval: 86400000 - scheduler.contract.path: /tmp/scheduler.json - fileStorePath: /tmp/Alfresco + scheduler.content.age.millis: 86400000 + scheduler.cleanup.interval: 86400000 + scheduler.contract.path: /tmp/scheduler.json + fileStorePath: /tmp/Alfresco ports: - "8099:8099" volumes: