From 670f8601a07b785dec12d7ae1592e2b63030695f Mon Sep 17 00:00:00 2001 From: Nicolas Maillat Date: Thu, 30 Nov 2023 13:46:16 +0100 Subject: [PATCH] PHRAS-3945 download async config change (#4423) * PHRAS-3945 change deployment for download async mode and pusher * wip * Missing var in setup container - WIP * quiet option for sensitives values --- .env | 4 +--- config/configuration.sample.yml | 10 ++++------ docker-compose.yml | 4 ++++ docker/phraseanet/setup/entrypoint.sh | 18 ++++++++++++++---- lib/conf.d/configuration.yml | 3 +++ 5 files changed, 26 insertions(+), 13 deletions(-) diff --git a/.env b/.env index f75c0a2115..c85e3e571a 100644 --- a/.env +++ b/.env @@ -134,7 +134,7 @@ PHRASEANET_DOCKER_REGISTRY=local # Docker images tag. # @run -PHRASEANET_DOCKER_TAG=4.1.8-rc6 +PHRASEANET_DOCKER_TAG=4.1.8-rc7 # Stack Name # An optionnal Name for the stack @@ -433,8 +433,6 @@ DB_BACKUP_GZIP_LEVEL=9 # --- Pusher settings -------------------------------------------------------------------------------------- # Pusher settings used when PHRASEANET_DOWNLOAD_ASYNC=true (configuration.yml: download_async / enabled=true) - -# pusher key # @run PUSHER_AUTH_KEY diff --git a/config/configuration.sample.yml b/config/configuration.sample.yml index f488003af9..3562d2f678 100644 --- a/config/configuration.sample.yml +++ b/config/configuration.sample.yml @@ -391,12 +391,10 @@ workers: verify_ssl: true externalservice: - ginger: - AutoSubtitling: - service_base_url: https://base.uri - token: 39c6011d - transcript_format: text/vtt - subdef_source: preview + pusher: + auth_key: 'pusher-auth_key' + secret: 'pusher-secret' + app_id: 'pusher-app_id' user_account: deleting_policies: diff --git a/docker-compose.yml b/docker-compose.yml index 1d031a38e2..fa829ef567 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -137,6 +137,10 @@ services: - PHRASEANET_SMTP_USER - PHRASEANET_SMTP_PASSWORD - PHRASEANET_DOWNLOAD_DIR + - PHRASEANET_DOWNLOAD_ASYNC + - PUSHER_APP_ID + - PUSHER_SECRET + - PUSHER_AUTH_KEY - PHRASEANET_LAZARET_DIR - PHRASEANET_CAPTION_DIR - PHRASEANET_WORKER_TMP diff --git a/docker/phraseanet/setup/entrypoint.sh b/docker/phraseanet/setup/entrypoint.sh index 5b70408f70..101cfeed96 100755 --- a/docker/phraseanet/setup/entrypoint.sh +++ b/docker/phraseanet/setup/entrypoint.sh @@ -177,11 +177,21 @@ if [[ -f "$FILE" && $PHRASEANET_SETUP = 1 ]]; then bin/setup system:config set -q workers.queue.worker-queue.user $PHRASEANET_RABBITMQ_USER bin/setup system:config set -q workers.queue.worker-queue.password $PHRASEANET_RABBITMQ_PASSWORD - echo `date +"%Y-%m-%d %H:%M:%S"` " - Phraseanet setting DOWNLOAD_ASYNC & PUSHER" + echo `date +"%Y-%m-%d %H:%M:%S"` " - Phraseanet setting Download Async" + if [ -z "$PHRASEANET_DOWNLOAD_ASYNC" ]; then + echo "$(date +"%Y-%m-%d %H:%M:%S") - DownloadAsync not set, PHRASEANET_DOWNLOAD_ASYNC is null " + else bin/setup system:config set download_async.enabled $PHRASEANET_DOWNLOAD_ASYNC - bin/setup system:config set pusher.auth_key $PUSHER_AUTH_KEY - bin/setup system:config set pusher.secret $PUSHER_SECRET - bin/setup system:config set pusher.app_id $PUSHER_APP_ID + fi + + echo `date +"%Y-%m-%d %H:%M:%S"` " - Define external service Pusher" + if [ -z "$PUSHER_APP_ID" ]; then + echo "$(date +"%Y-%m-%d %H:%M:%S") - Pusher service not defined, PUSHER_APP_ID is null" + else + bin/setup system:config set -q externalservice.pusher.auth_key $PUSHER_AUTH_KEY + bin/setup system:config set -q externalservice.pusher.secret $PUSHER_SECRET + bin/setup system:config set -q externalservice.pusher.app_id $PUSHER_APP_ID + fi diff --git a/lib/conf.d/configuration.yml b/lib/conf.d/configuration.yml index 057bce26a3..2f90b5bf4f 100644 --- a/lib/conf.d/configuration.yml +++ b/lib/conf.d/configuration.yml @@ -387,6 +387,9 @@ workers: exportMail: max_retry: 3 ttl_retry: 10000 + downloadAsync: + max_retry: 3 + ttl_retry: 10000 exposeUpload: max_retry: 3 ttl_retry: 10000