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-2875: add search enterprise mediation & reindex + fix tests #57

Merged
merged 21 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from 12 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
37 changes: 31 additions & 6 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ group "content_service" {
}

group "enterprise-search" {
targets = ["search_liveindexing"]
targets = ["search_liveindexing", "search_reindexing"]
}

group "ats" {
Expand Down Expand Up @@ -210,29 +210,38 @@ target "repository" {
target "search_liveindexing" {
matrix = {
liveindexing = [
{
artifact = "alfresco-elasticsearch-live-indexing-mediation",
name = "mediation",
context = "common"
},
{
artifact = "alfresco-elasticsearch-live-indexing-metadata",
name = "metadata"
name = "metadata",
context = "common"
},
{
artifact = "alfresco-elasticsearch-live-indexing-path",
name = "path"
name = "path",
context = "common"
},
{
artifact = "alfresco-elasticsearch-live-indexing-content",
name = "content"
name = "content",
context = "common"
},
{
artifact = "alfresco-elasticsearch-live-indexing",
name = "all-in-one"
name = "all-in-one",
context = "all-in-one"
}
]
}
name = "${liveindexing.artifact}"
args = {
LIVEINDEXING = "${liveindexing.artifact}"
}
context = "./search/enterprise/common"
context = "./search/enterprise/${liveindexing.context}"
dockerfile = "Dockerfile"
inherits = ["java_base"]
contexts = {
Expand All @@ -247,6 +256,22 @@ target "search_liveindexing" {
platforms = split(",", "${TARGETARCH}")
}

target "search_reindexing" {
context = "./search/enterprise/reindexing"
dockerfile = "Dockerfile"
inherits = ["java_base"]
contexts = {
java_base = "target:java_base"
}
labels = {
"org.opencontainers.image.title" = "${PRODUCT_LINE} Enterprise Search - reindexing"
"org.opencontainers.image.description" = "${PRODUCT_LINE} Enterprise Search - reindexing component"
}
tags = ["${REGISTRY}/${REGISTRY_NAMESPACE}/alfresco-elasticsearch-reindexing:${TAG}"]
output = ["type=docker"]
platforms = split(",", "${TARGETARCH}")
}

alxgomz marked this conversation as resolved.
Show resolved Hide resolved
variable "ALFRESCO_TROUTER_USER_NAME" {
default = "trouter"
}
Expand Down
13 changes: 13 additions & 0 deletions search/enterprise/all-in-one/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM java_base

Check warning on line 1 in search/enterprise/all-in-one/Dockerfile

View workflow job for this annotation

GitHub Actions / kics

[HIGH] Missing User Instruction

A user should be specified in the dockerfile, otherwise the image will run as root

ARG LIVEINDEXING
ENV PORT=8080
EXPOSE 8080

ADD ${LIVEINDEXING}*-app.jar /opt/app.jar

Check warning on line 7 in search/enterprise/all-in-one/Dockerfile

View workflow job for this annotation

GitHub Actions / kics

[MEDIUM] Add Instead of Copy

Using ADD to load external installation scripts could lead to an evil web server leveraging this and loading a malicious script.

HEALTHCHECK --interval=30s --timeout=3s --retries=3 --start-period=1m \
CMD curl -f http://localhost:8080/actuator/health || exit 1

COPY entrypoint.sh /entrypoint.sh
CMD ["/entrypoint.sh"]
14 changes: 14 additions & 0 deletions search/enterprise/all-in-one/artifacts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"artifacts": {
"acs23": [
{
"name": "alfresco-elasticsearch-live-indexing",
"version": "4.0.1",
"path": "search/enterprise/all-in-one",
"classifier": "-app.jar",
"repository": "enterprise-releases",
"group": "org.alfresco"
}
]
}
}
3 changes: 3 additions & 0 deletions search/enterprise/all-in-one/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

exec java $JAVA_OPTS -jar /opt/app.jar
alxgomz marked this conversation as resolved.
Show resolved Hide resolved
8 changes: 8 additions & 0 deletions search/enterprise/common/artifacts.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
{
"artifacts": {
"acs23": [
{
"name": "alfresco-elasticsearch-live-indexing-mediation",
"version": "4.0.1",
"path": "search/enterprise/common",
"classifier": "-app.jar",
"repository": "enterprise-releases",
"group": "org.alfresco"
},
{
"name": "alfresco-elasticsearch-live-indexing-metadata",
"version": "4.0.1",
Expand Down
5 changes: 5 additions & 0 deletions search/enterprise/reindexing/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM java_base

Check warning on line 1 in search/enterprise/reindexing/Dockerfile

View workflow job for this annotation

GitHub Actions / kics

[HIGH] Missing User Instruction

A user should be specified in the dockerfile, otherwise the image will run as root

ADD *-app.jar /opt/app.jar

ENTRYPOINT java $JAVA_OPTS -jar /opt/app.jar
14 changes: 14 additions & 0 deletions search/enterprise/reindexing/artifacts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"artifacts": {
"acs23": [
{
"name": "alfresco-elasticsearch-reindexing",
"version": "4.0.1",
"path": "search/enterprise/reindexing",
"classifier": "-app.jar",
"repository": "enterprise-releases",
"group": "org.alfresco"
}
]
}
}
41 changes: 34 additions & 7 deletions test/enterprise-docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ services:
- http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/probes/-ready-
interval: 30s
timeout: 3s
retries: 3
start_period: 1m
retries: 5
start_period: 2m
transform-router:
mem_limit: 512m
image: ${REGISTRY}/${REGISTRY_NAMESPACE}/alfresco-transform-router:${TAG}
Expand Down Expand Up @@ -176,11 +176,38 @@ services:
ports:
- "9090:9090"
live-indexing:
image: ${REGISTRY}/${REGISTRY_NAMESPACE}/alfresco-elasticsearch-live-indexing:${TAG}
environment:
SPRING_ELASTICSEARCH_REST_URIS: http://elasticsearch:9200
SPRING_ACTIVEMQ_BROKERURL: nio://activemq:61616
ALFRESCO_SHAREDFILESTORE_BASEURL: http://shared-file-store:8099/alfresco/api/-default-/private/sfs/versions/1/file/
image: ${REGISTRY}/${REGISTRY_NAMESPACE}/alfresco-elasticsearch-live-indexing:${TAG}
environment:
ALFRESCO_ACCEPTED_CONTENT_MEDIA_TYPES_CACHE_BASE_URL: http://transform-router:8095/transform/config
SPRING_ELASTICSEARCH_REST_URIS: http://elasticsearch:9200
SPRING_ACTIVEMQ_BROKERURL: nio://activemq:61616
ALFRESCO_SHAREDFILESTORE_BASEURL: http://shared-file-store:8099/alfresco/api/-default-/private/sfs/versions/1/file/
depends_on:
activemq:
condition: service_started
elasticsearch:
condition: service_started
reindexing:
image: ${REGISTRY}/${REGISTRY_NAMESPACE}/alfresco-elasticsearch-reindexing:${TAG}
mem_limit: 1g
restart: on-failure:10
environment:
ALFRESCO_ACCEPTED_CONTENT_MEDIA_TYPES_CACHE_BASE_URL: >-
http://transform-core-aio:8090/transform/config
SPRING_ACTIVEMQ_BROKERURL: nio://activemq:61616
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/alfresco
SPRING_DATASOURCE_USERNAME: alfresco
SPRING_DATASOURCE_PASSWORD: alfresco
SPRING_ELASTICSEARCH_REST_URIS: http://elasticsearch:9200
depends_on:
activemq:
condition: service_started
postgres:
condition: service_started
elasticsearch:
condition: service_started
alfresco:
condition: service_healthy
volumes:
shared-file-store-volume:
driver_opts:
Expand Down
8 changes: 8 additions & 0 deletions test/helm/test-overrides.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ share:
repository: localhost/alfresco-share
tag: latest
alfresco-search-enterprise:
reindexing:
image:
repository: localhost/alfresco-elasticsearch-reindexing
tag: latest
liveIndexing:
content:
image:
Expand All @@ -21,6 +25,10 @@ alfresco-search-enterprise:
image:
repository: localhost/alfresco-elasticsearch-live-indexing-path
tag: latest
mediation:
image:
repository: localhost/alfresco-elasticsearch-live-indexing-mediation
tag: latest
alfresco-transform-service:
pdfrenderer:
image:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1423,6 +1423,82 @@
},
"response": []
},
{
"name": "search-api-validation",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.globals.get(\"url\");",
"",
"pm.test(\"canUseSearchAPITest\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"pm.environment.set(\"totalItems\", pm.response.json().list.pagination.totalItems);",
"",
"console.log(\"Total Items:\"+pm.environment.get(\"totalItems\"));",
"",
"pm.test(\"totalItems\", function () {",
" pm.expect(pm.environment.get(\"totalItems\")).not.eql(0)",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "basic",
"basic": [
{
"key": "username",
"value": "admin",
"type": "string"
},
{
"key": "password",
"value": "admin",
"type": "string"
},
{
"key": "saveHelperData",
"type": "any"
},
{
"key": "showPassword",
"value": false,
"type": "boolean"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"query\": {\r\n \"query\": \"name:alfresco\"\r\n }\r\n}"
},
"url": {
"raw": "{{protocol}}://{{url}}/alfresco/api/-default-/public/search/versions/1/search",
"protocol": "{{protocol}}",
"host": [
"{{url}}"
],
"path": [
"alfresco",
"api",
"-default-",
"public",
"search",
"versions",
"1",
"search"
]
}
},
"response": []
},
{
"name": "search-cmis-validation",
"event": [
Expand Down
Loading