-
Notifications
You must be signed in to change notification settings - Fork 0
Add renditions to docker-compose subproject [ACC-3063] #1630
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
base: main
Are you sure you want to change the base?
Changes from all commits
2af18ad
15dcb23
3ab8a70
4e4fbbd
03dadd0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,10 @@ | ||
| #!/bin/bash | ||
| set -euo pipefail | ||
| for i in jwt-apps jwt-authentication jwt-authentication-encryption-keys; do | ||
| for i in jwt-apps jwt-authentication; do | ||
| mkdir -p "$i" | ||
| pushd "$i" | ||
| openssl genrsa 2048 > active-1.pem | ||
| popd | ||
| done | ||
| mkdir -p jwt-authentication-encryption | ||
| openssl rand 32 > jwt-authentication-encryption/active-1.bin |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,127 @@ | ||||||
| { | ||||||
| "rabbit_version": "3.13.3", | ||||||
| "rabbitmq_version": "3.13.3", | ||||||
| "product_name": "RabbitMQ", | ||||||
| "product_version": "3.13.3", | ||||||
| "vhosts": [ | ||||||
| { | ||||||
| "name": "/" | ||||||
| } | ||||||
| ], | ||||||
| "policies": [ | ||||||
| { | ||||||
| "vhost": "/", | ||||||
| "name": "rendition-requests", | ||||||
| "pattern": "^rendition-requests$", | ||||||
| "apply-to": "queues", | ||||||
| "definition": { | ||||||
| "dead-letter-exchange": "renditions-dlx", | ||||||
| "delivery-limit": 3, | ||||||
| "max-length": 10000, | ||||||
| "message-ttl": 300000, | ||||||
| "overflow": "drop-head" | ||||||
| }, | ||||||
| "priority": 0 | ||||||
| }, | ||||||
| { | ||||||
| "vhost": "/", | ||||||
| "name": "renditions-responses", | ||||||
| "pattern": "^renditions-responses$", | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The queue name is rendition(singular) -responses.
Suggested change
|
||||||
| "apply-to": "queues", | ||||||
| "definition": { | ||||||
| "dead-letter-exchange": "renditions-dlx", | ||||||
| "delivery-limit": 3, | ||||||
| "max-length": 10000, | ||||||
| "message-ttl": 300000, | ||||||
| "overflow": "drop-head" | ||||||
| }, | ||||||
| "priority": 0 | ||||||
| }, | ||||||
| { | ||||||
| "vhost": "/", | ||||||
| "name": "rendition-request-retries", | ||||||
| "pattern": "^rendition-request-retries$", | ||||||
| "apply-to": "queues", | ||||||
| "definition": { | ||||||
| "dead-letter-exchange": "directExchange", | ||||||
| "dead-letter-routing-key": "renditionRequest", | ||||||
| "message-ttl": 15000 | ||||||
| } | ||||||
| } | ||||||
| ], | ||||||
| "queues": [ | ||||||
| { | ||||||
| "name": "rendition-requests", | ||||||
| "vhost": "/", | ||||||
| "durable": true, | ||||||
| "auto_delete": false, | ||||||
| "arguments": { | ||||||
| "x-queue-type": "quorum" | ||||||
| } | ||||||
| }, | ||||||
| { | ||||||
| "name": "rendition-responses", | ||||||
| "vhost": "/", | ||||||
| "durable": true, | ||||||
| "auto_delete": false, | ||||||
| "arguments": { | ||||||
| "x-queue-type": "quorum" | ||||||
| } | ||||||
| }, | ||||||
| { | ||||||
| "name": "rendition-request-retries", | ||||||
| "vhost": "/", | ||||||
| "durable": true, | ||||||
| "auto_delete": false, | ||||||
| "arguments": { | ||||||
| "x-queue-type": "quorum" | ||||||
| } | ||||||
| } | ||||||
| ], | ||||||
| "exchanges": [ | ||||||
| { | ||||||
| "name": "renditions-dlx", | ||||||
| "vhost": "/", | ||||||
| "type": "fanout", | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this dead letter exchange route to anything? I see no binding for this exchange. |
||||||
| "durable": true, | ||||||
| "auto_delete": false, | ||||||
| "internal": false, | ||||||
| "arguments": {} | ||||||
| }, | ||||||
| { | ||||||
| "name": "directExchange", | ||||||
| "vhost": "/", | ||||||
| "type": "direct", | ||||||
| "durable": true, | ||||||
| "auto_delete": false, | ||||||
| "internal": false, | ||||||
| "arguments": {} | ||||||
| } | ||||||
| ], | ||||||
| "bindings": [ | ||||||
| { | ||||||
| "source": "directExchange", | ||||||
| "vhost": "/", | ||||||
| "destination": "rendition-requests", | ||||||
| "destination_type": "queue", | ||||||
| "routing_key": "renditionRequest", | ||||||
| "arguments": {} | ||||||
| }, | ||||||
| { | ||||||
| "source": "directExchange", | ||||||
| "vhost": "/", | ||||||
| "destination": "rendition-responses", | ||||||
| "destination_type": "queue", | ||||||
| "routing_key": "renditionResponse", | ||||||
| "arguments": {} | ||||||
| }, | ||||||
| { | ||||||
| "source": "directExchange", | ||||||
| "vhost": "/", | ||||||
| "destination": "rendition-request-retries", | ||||||
| "destination_type": "queue", | ||||||
| "routing_key": "renditionRequestRetry", | ||||||
| "arguments": {} | ||||||
| } | ||||||
| ] | ||||||
| } | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| #!/bin/bash | ||
| set -euo pipefail | ||
|
|
||
| # Set up definitions | ||
| curl -u user:"$RABBITMQ_PASSWORD" \ | ||
| --fail-with-body \ | ||
| --silent \ | ||
| -X POST \ | ||
| -H "Content-Type: application/json" \ | ||
| -T /tmp/rabbitmq/definitions.json \ | ||
| http://renditions-rabbitmq:15672/api/definitions |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| spring: | ||
| security: | ||
| oauth2: | ||
| resourceserver: | ||
| jwt: | ||
| issuer-uri: http://${docker.host.ip}:8081/authentication/external | ||
| audiences: | ||
| - contentgrid:extension:renditions | ||
| client: | ||
| provider: | ||
| identity: | ||
| issuer-uri: http://${docker.host.ip}:8082/realms/extensions | ||
| delegated-access: | ||
| issuer-uri: http://${docker.host.ip}:8081/authentication/delegated | ||
|
|
||
| s3: | ||
| bucket: renditions | ||
| endpoint: http://renditions-s3:9090/ | ||
| region: eu-west-1 | ||
|
|
||
| transform-service: | ||
| url: http://transformations:8088/available-transformations |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| window.contentGridConfig = { | ||
| v1: { | ||
| apiBaseUrl: "${API_BASE_URL}", | ||
| oidc: { | ||
| authority: "${OIDC_AUTHORITY}", | ||
| client_id: "${OIDC_CLIENT_ID}" | ||
| }, | ||
| renditionUriTemplate: "${RENDITION_URI_TEMPLATE}" | ||
| } | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Configure tokenmonger with renditions extension | ||
| contentgrid.tokenmonger.extensions.registration.renditions: | ||
| extension-id: renditions | ||
| resource-uris: | ||
| - http://${docker.host.ip}:8086/ | ||
| - http://localhost:8086/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| s3: | ||
| bucket: renditions | ||
| endpoint: http://renditions-s3:9090/ | ||
| region: eu-west-1 | ||
|
|
||
| alfresco-transform-core-aio: | ||
| url: http://transformaio:8090/transform | ||
| config-url: http://transformaio:8090/transform/config |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,90 @@ | ||||||
| services: | ||||||
| renditions: | ||||||
| image: docker.xenit.eu/contentgrid/extensions/renditions/contentgrid-rendition-service:0.0.1-SNAPSHOT@sha256:58b3a312cad4ff7824a148895a28900bfb91bd0c8010e9aa8bcafa5edeb0e34b | ||||||
| ports: | ||||||
| - "8086:8080" | ||||||
| environment: | ||||||
| SPRING_CONFIG_IMPORT: file:/etc/renditions/config/application.yml | ||||||
| DOCKER_HOST_IP: "${DOCKER_HOST_IP:-172.17.0.1}" | ||||||
|
|
||||||
| EIT_CLIENT_ID: renditions | ||||||
| EIT_CLIENT_SECRET: renditions_secret_key | ||||||
|
|
||||||
| SPRING_RABBITMQ_HOST: renditions-rabbitmq | ||||||
| SPRING_RABBITMQ_USERNAME: user | ||||||
| SPRING_RABBITMQ_PASSWORD: $RABBITMQ_PASSWORD | ||||||
| volumes: | ||||||
| - ./config/renditions:/etc/renditions/config:ro | ||||||
| depends_on: | ||||||
| renditions-rabbitmq-bootstrap: | ||||||
| condition: service_completed_successfully | ||||||
| restart: true | ||||||
| keycloak: | ||||||
| condition: service_healthy | ||||||
| tokenmonger: | ||||||
| condition: service_started | ||||||
| transformations: | ||||||
| condition: service_started | ||||||
|
|
||||||
| transformations: | ||||||
| image: docker.xenit.eu/contentgrid/extensions/renditions/contentgrid-transform-service:0.0.1-SNAPSHOT@sha256:6026b6e5cb7e4d2a2e0d9bbe2e2e9791424ca3360bb3adc52d09808338c5ed5c | ||||||
| environment: | ||||||
| SPRING_CONFIG_IMPORT: file:/etc/transformations/config/application.yml | ||||||
|
|
||||||
| SPRING_RABBITMQ_HOST: renditions-rabbitmq | ||||||
| SPRING_RABBITMQ_USERNAME: user | ||||||
| SPRING_RABBITMQ_PASSWORD: $RABBITMQ_PASSWORD | ||||||
| volumes: | ||||||
| - ./config/transformations:/etc/transformations/config:ro | ||||||
| depends_on: | ||||||
| renditions-rabbitmq-bootstrap: | ||||||
| condition: service_completed_successfully | ||||||
| restart: true | ||||||
|
|
||||||
| transformaio: | ||||||
| image: docker.io/alfresco/alfresco-transform-core-aio:latest | ||||||
| environment: | ||||||
| JAVA_OPTS: "-XX:MinRAMPercentage=50 -XX:MaxRAMPercentage=80" | ||||||
|
|
||||||
| renditions-rabbitmq: | ||||||
| image: docker.io/library/rabbitmq:4.3-management | ||||||
| environment: | ||||||
| RABBITMQ_DEFAULT_USER: user | ||||||
| RABBITMQ_DEFAULT_PASS: $RABBITMQ_PASSWORD | ||||||
| healthcheck: | ||||||
| test: ["CMD", "rabbitmqctl", "node_health_check"] | ||||||
| start_period: 1m | ||||||
|
|
||||||
| # Set up normal/dead letter exchange, request/response queues, bindings | ||||||
| renditions-rabbitmq-bootstrap: | ||||||
| image: ghcr.io/xenit-eu/kubectl | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you pin the image version? |
||||||
| command: ["bash", "-c", "/tmp/rabbitmq/setup.sh"] | ||||||
| environment: | ||||||
| RABBITMQ_PASSWORD: $RABBITMQ_PASSWORD | ||||||
| volumes: | ||||||
| - ./bootstrap/renditions-rabbitmq:/tmp/rabbitmq | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can this mount be
Suggested change
|
||||||
| depends_on: | ||||||
| renditions-rabbitmq: | ||||||
| condition: service_healthy | ||||||
|
|
||||||
| renditions-s3: | ||||||
| image: docker.io/adobe/s3mock:5.0.0 | ||||||
| environment: | ||||||
| COM_ADOBE_TESTING_S3MOCK_STORE_INITIAL_BUCKETS: renditions | ||||||
| COM_ADOBE_TESTING_S3MOCK_STORE_REGION: eu-west-1 | ||||||
|
|
||||||
| tokenmonger: | ||||||
| environment: | ||||||
| SPRING_CONFIG_IMPORT: file:/etc/tokenmonger/config/application.yml,file:/etc/tokenmonger/extensions/renditions.yml | ||||||
| DOCKER_HOST_IP: "${DOCKER_HOST_IP:-172.17.0.1}" | ||||||
| volumes: | ||||||
| - ./config/renditions/tokenmonger-extensions.yml:/etc/tokenmonger/extensions/renditions.yml | ||||||
|
|
||||||
| # Mount config.js.tmpl (renditionUriTemplate is not in the image) to substitute for liaison | ||||||
| navigator: | ||||||
| environment: | ||||||
| API_BASE_URL: http://${DOCKER_HOST_IP:-172.17.0.1}:8080 | ||||||
| CC_CONFIGJS_TEMPLATE: /etc/navigator/config.js.tmpl | ||||||
| RENDITION_URI_TEMPLATE: "http://${DOCKER_HOST_IP:-172.17.0.1}:8086/renditions/get/pdf{?url}" | ||||||
| volumes: | ||||||
| - ./config/renditions/navigator-config.js.tmpl:/etc/navigator/config.js.tmpl | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The queue name is rendition(singular) -responses.