From 9091cf736833255d111bb75c9caf93c896831cf4 Mon Sep 17 00:00:00 2001 From: Nicolas Maillat Date: Tue, 12 Dec 2023 14:53:57 +0100 Subject: [PATCH 1/2] PHRAS-3980 custom worker (#4438) * PHRAS-3980 removing Blackfire --- .env | 17 ------- Dockerfile | 9 +--- docker-compose.yml | 67 +------------------------- docker/phraseanet/worker/entrypoint.sh | 11 +---- 4 files changed, 4 insertions(+), 100 deletions(-) diff --git a/.env b/.env index c85e3e571a..af66ef92b9 100644 --- a/.env +++ b/.env @@ -897,23 +897,6 @@ NEWRELIC_LICENSE_KEY= # @run NEWRELIC_APP_NAME= - - -# --- Blackfire settings ----------------------------------------------------------------------------------------------- - -# In developpement mode, Enable (or not) the "Blackfire" agent for -# plateform monitoring. -# @run -BLACKFIRE_ENABLED=false - -# @run -BLACKFIRE_SERVER_ID= - -# @run -BLACKFIRE_SERVER_TOKEN= - - - # --- Development purpose ---------------------------------------------------------------------------------------------- # See [Phraseanet development-mode documentation| diff --git a/Dockerfile b/Dockerfile index 00d5748abe..dedb009331 100644 --- a/Dockerfile +++ b/Dockerfile @@ -166,18 +166,13 @@ RUN echo "BUILDING AND INSTALLING FFMPEG" \ && make distclean \ ) #&& rm -rf /tmp/ffmpeg -RUN echo "INSTALLING NEWRELIC AND BLACKFIRE EXTENTIONS" \ +RUN echo "INSTALLING NEWRELIC EXTENTION" \ && echo 'deb http://apt.newrelic.com/debian/ newrelic non-free' | tee /etc/apt/sources.list.d/newrelic.list \ && curl -o- https://download.newrelic.com/548C16BF.gpg | apt-key add - \ && apt-get update \ && apt-get install -y newrelic-php5 \ && NR_INSTALL_SILENT=1 newrelic-install install \ - && touch /etc/newrelic/newrelic.cfg \ - && curl -o- https://packages.blackfire.io/gpg.key |apt-key add - \ - && echo "deb http://packages.blackfire.io/debian any main" |tee /etc/apt/sources.list.d/blackfire.list \ - && apt update \ - && apt install blackfire-agent \ - && apt install blackfire-php + && touch /etc/newrelic/newrelic.cfg RUN echo "FINALIZING BUILD AND CLEANING" \ && apt-get clean \ && rm -rf /var/lib/apt/lists \ diff --git a/docker-compose.yml b/docker-compose.yml index fa829ef567..b6f511b46a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -166,9 +166,6 @@ services: - NEWRELIC_ENABLED - NEWRELIC_LICENSE_KEY - NEWRELIC_APP_NAME - - BLACKFIRE_ENABLED - - BLACKFIRE_SERVER_ID - - BLACKFIRE_SERVER_TOKEN - SESSION_SAVE_HANDLER - SESSION_SAVE_PATH - PHRASEANET_CACHE_TYPE @@ -255,9 +252,6 @@ services: - NEWRELIC_ENABLED - NEWRELIC_LICENSE_KEY - NEWRELIC_APP_NAME - - BLACKFIRE_ENABLED - - BLACKFIRE_SERVER_ID - - BLACKFIRE_SERVER_TOKEN - SESSION_SAVE_HANDLER - SESSION_SAVE_PATH - PHRASEANET_MAINTENANCE @@ -308,6 +302,7 @@ services: - LC_NAME=C.UTF-8 - PHRASEANET_EXPLODE_WORKER - PHRASEANET_WORKERS_LAUNCH_METHOD + - PHRASEANET_WORKER_CUSTOM - PHRASEANET_WORKER_assetsIngest - PHRASEANET_WORKER_createRecord - PHRASEANET_WORKER_deleteRecord @@ -337,9 +332,6 @@ services: - NEWRELIC_ENABLED - NEWRELIC_LICENSE_KEY - NEWRELIC_APP_NAME - - BLACKFIRE_ENABLED - - BLACKFIRE_SERVER_ID - - BLACKFIRE_SERVER_TOKEN volumes: - ${PHRASEANET_CONFIG_DIR}:/var/alchemy/Phraseanet/config:rw - ${PHRASEANET_LOGS_DIR}:/var/alchemy/Phraseanet/logs:rw @@ -391,9 +383,6 @@ services: - NEWRELIC_ENABLED - NEWRELIC_LICENSE_KEY - NEWRELIC_APP_NAME - - BLACKFIRE_ENABLED - - BLACKFIRE_SERVER_ID - - BLACKFIRE_SERVER_TOKEN volumes: - ${PHRASEANET_CONFIG_DIR}:/var/alchemy/Phraseanet/config:rw - ${PHRASEANET_LOGS_DIR}:/var/alchemy/Phraseanet/logs:rw @@ -446,9 +435,6 @@ services: - NEWRELIC_ENABLED - NEWRELIC_LICENSE_KEY - NEWRELIC_APP_NAME - - BLACKFIRE_ENABLED - - BLACKFIRE_SERVER_ID - - BLACKFIRE_SERVER_TOKEN volumes: - ${PHRASEANET_CONFIG_DIR}:/var/alchemy/Phraseanet/config:rw - ${PHRASEANET_LOGS_DIR}:/var/alchemy/Phraseanet/logs:rw @@ -500,9 +486,6 @@ services: - NEWRELIC_ENABLED - NEWRELIC_LICENSE_KEY - NEWRELIC_APP_NAME - - BLACKFIRE_ENABLED - - BLACKFIRE_SERVER_ID - - BLACKFIRE_SERVER_TOKEN volumes: - ${PHRASEANET_CONFIG_DIR}:/var/alchemy/Phraseanet/config:rw - ${PHRASEANET_LOGS_DIR}:/var/alchemy/Phraseanet/logs:rw @@ -555,9 +538,6 @@ services: - NEWRELIC_ENABLED - NEWRELIC_LICENSE_KEY - NEWRELIC_APP_NAME - - BLACKFIRE_ENABLED - - BLACKFIRE_SERVER_ID - - BLACKFIRE_SERVER_TOKEN volumes: - ${PHRASEANET_CONFIG_DIR}:/var/alchemy/Phraseanet/config:rw - ${PHRASEANET_LOGS_DIR}:/var/alchemy/Phraseanet/logs:rw @@ -609,9 +589,6 @@ services: - NEWRELIC_ENABLED - NEWRELIC_LICENSE_KEY - NEWRELIC_APP_NAME - - BLACKFIRE_ENABLED - - BLACKFIRE_SERVER_ID - - BLACKFIRE_SERVER_TOKEN volumes: - ${PHRASEANET_CONFIG_DIR}:/var/alchemy/Phraseanet/config:rw - ${PHRASEANET_LOGS_DIR}:/var/alchemy/Phraseanet/logs:rw @@ -663,9 +640,6 @@ services: - NEWRELIC_ENABLED - NEWRELIC_LICENSE_KEY - NEWRELIC_APP_NAME - - BLACKFIRE_ENABLED - - BLACKFIRE_SERVER_ID - - BLACKFIRE_SERVER_TOKEN volumes: - ${PHRASEANET_CONFIG_DIR}:/var/alchemy/Phraseanet/config:rw - ${PHRASEANET_LOGS_DIR}:/var/alchemy/Phraseanet/logs:rw @@ -717,9 +691,6 @@ services: - NEWRELIC_ENABLED - NEWRELIC_LICENSE_KEY - NEWRELIC_APP_NAME - - BLACKFIRE_ENABLED - - BLACKFIRE_SERVER_ID - - BLACKFIRE_SERVER_TOKEN volumes: - ${PHRASEANET_CONFIG_DIR}:/var/alchemy/Phraseanet/config:rw - ${PHRASEANET_LOGS_DIR}:/var/alchemy/Phraseanet/logs:rw @@ -771,9 +742,6 @@ services: - NEWRELIC_ENABLED - NEWRELIC_LICENSE_KEY - NEWRELIC_APP_NAME - - BLACKFIRE_ENABLED - - BLACKFIRE_SERVER_ID - - BLACKFIRE_SERVER_TOKEN volumes: - ${PHRASEANET_CONFIG_DIR}:/var/alchemy/Phraseanet/config:rw - ${PHRASEANET_LOGS_DIR}:/var/alchemy/Phraseanet/logs:rw @@ -825,9 +793,6 @@ services: - NEWRELIC_ENABLED - NEWRELIC_LICENSE_KEY - NEWRELIC_APP_NAME - - BLACKFIRE_ENABLED - - BLACKFIRE_SERVER_ID - - BLACKFIRE_SERVER_TOKEN volumes: - ${PHRASEANET_CONFIG_DIR}:/var/alchemy/Phraseanet/config:rw - ${PHRASEANET_LOGS_DIR}:/var/alchemy/Phraseanet/logs:rw @@ -879,9 +844,6 @@ services: - NEWRELIC_ENABLED - NEWRELIC_LICENSE_KEY - NEWRELIC_APP_NAME - - BLACKFIRE_ENABLED - - BLACKFIRE_SERVER_ID - - BLACKFIRE_SERVER_TOKEN volumes: - ${PHRASEANET_CONFIG_DIR}:/var/alchemy/Phraseanet/config:rw - ${PHRASEANET_LOGS_DIR}:/var/alchemy/Phraseanet/logs:rw @@ -933,9 +895,6 @@ services: - NEWRELIC_ENABLED - NEWRELIC_LICENSE_KEY - NEWRELIC_APP_NAME - - BLACKFIRE_ENABLED - - BLACKFIRE_SERVER_ID - - BLACKFIRE_SERVER_TOKEN volumes: - ${PHRASEANET_CONFIG_DIR}:/var/alchemy/Phraseanet/config:rw - ${PHRASEANET_LOGS_DIR}:/var/alchemy/Phraseanet/logs:rw @@ -987,9 +946,6 @@ services: - NEWRELIC_ENABLED - NEWRELIC_LICENSE_KEY - NEWRELIC_APP_NAME - - BLACKFIRE_ENABLED - - BLACKFIRE_SERVER_ID - - BLACKFIRE_SERVER_TOKEN volumes: - ${PHRASEANET_CONFIG_DIR}:/var/alchemy/Phraseanet/config:rw - ${PHRASEANET_LOGS_DIR}:/var/alchemy/Phraseanet/logs:rw @@ -1044,9 +1000,6 @@ services: - NEWRELIC_ENABLED - NEWRELIC_LICENSE_KEY - NEWRELIC_APP_NAME - - BLACKFIRE_ENABLED - - BLACKFIRE_SERVER_ID - - BLACKFIRE_SERVER_TOKEN volumes: - ${PHRASEANET_CONFIG_DIR}:/var/alchemy/Phraseanet/config:rw - ${PHRASEANET_LOGS_DIR}:/var/alchemy/Phraseanet/logs:rw @@ -1098,9 +1051,6 @@ services: - NEWRELIC_ENABLED - NEWRELIC_LICENSE_KEY - NEWRELIC_APP_NAME - - BLACKFIRE_ENABLED - - BLACKFIRE_SERVER_ID - - BLACKFIRE_SERVER_TOKEN volumes: - ${PHRASEANET_CONFIG_DIR}:/var/alchemy/Phraseanet/config:rw - ${PHRASEANET_LOGS_DIR}:/var/alchemy/Phraseanet/logs:rw @@ -1152,9 +1102,6 @@ services: - NEWRELIC_ENABLED - NEWRELIC_LICENSE_KEY - NEWRELIC_APP_NAME - - BLACKFIRE_ENABLED - - BLACKFIRE_SERVER_ID - - BLACKFIRE_SERVER_TOKEN volumes: - ${PHRASEANET_CONFIG_DIR}:/var/alchemy/Phraseanet/config:rw - ${PHRASEANET_LOGS_DIR}:/var/alchemy/Phraseanet/logs:rw @@ -1206,9 +1153,6 @@ services: - NEWRELIC_ENABLED - NEWRELIC_LICENSE_KEY - NEWRELIC_APP_NAME - - BLACKFIRE_ENABLED - - BLACKFIRE_SERVER_ID - - BLACKFIRE_SERVER_TOKEN volumes: - ${PHRASEANET_CONFIG_DIR}:/var/alchemy/Phraseanet/config:rw - ${PHRASEANET_LOGS_DIR}:/var/alchemy/Phraseanet/logs:rw @@ -1260,9 +1204,6 @@ services: - NEWRELIC_ENABLED - NEWRELIC_LICENSE_KEY - NEWRELIC_APP_NAME - - BLACKFIRE_ENABLED - - BLACKFIRE_SERVER_ID - - BLACKFIRE_SERVER_TOKEN volumes: - ${PHRASEANET_CONFIG_DIR}:/var/alchemy/Phraseanet/config:rw - ${PHRASEANET_LOGS_DIR}:/var/alchemy/Phraseanet/logs:rw @@ -1314,9 +1255,6 @@ services: - NEWRELIC_ENABLED - NEWRELIC_LICENSE_KEY - NEWRELIC_APP_NAME - - BLACKFIRE_ENABLED - - BLACKFIRE_SERVER_ID - - BLACKFIRE_SERVER_TOKEN volumes: - ${PHRASEANET_CONFIG_DIR}:/var/alchemy/Phraseanet/config:rw - ${PHRASEANET_LOGS_DIR}:/var/alchemy/Phraseanet/logs:rw @@ -1366,9 +1304,6 @@ services: - NEWRELIC_ENABLED - NEWRELIC_LICENSE_KEY - NEWRELIC_APP_NAME - - BLACKFIRE_ENABLED - - BLACKFIRE_SERVER_ID - - BLACKFIRE_SERVER_TOKEN volumes: - ${PHRASEANET_CONFIG_DIR}:/var/alchemy/Phraseanet/config:rw - ${PHRASEANET_LOGS_DIR}:/var/alchemy/Phraseanet/logs:rw diff --git a/docker/phraseanet/worker/entrypoint.sh b/docker/phraseanet/worker/entrypoint.sh index afbbce5596..af441aabb5 100755 --- a/docker/phraseanet/worker/entrypoint.sh +++ b/docker/phraseanet/worker/entrypoint.sh @@ -70,16 +70,6 @@ else rm -f /usr/local/etc/php/conf.d/newrelic.ini fi -if [[ $BLACKFIRE_ENABLED = "true" ]]; then - echo `date +"%Y-%m-%d %H:%M:%S"` " - BlackFire setup." - blackfire-agent --register --server-id=$BLACKFIRE_SERVER_ID --server-token=$BLACKFIRE_SERVER_TOKEN - service blackfire-agent start - echo "Blackfire setup done" -else - echo `date +"%Y-%m-%d %H:%M:%S"` " - blackfire extension deactivation." - rm -f /usr/local/etc/php/conf.d/zz-blackfire.ini -fi - rm -rf bin/run-worker.sh if [ ! -z "$PHRASEANET_SCHEDULER" ] ; then @@ -123,6 +113,7 @@ else fi done + echo $NBR_WORKERS " workers defined" echo $NBR_WORKERS > bin/workers_count.txt chown root:app bin/workers_count.txt From b4536308dfa264947d961b660dbc54849192fd98 Mon Sep 17 00:00:00 2001 From: jygaulier Date: Tue, 12 Dec 2023 19:43:14 +0100 Subject: [PATCH 2/2] PHRAS-3981 add missing "input_disable" attribute to new field defaults (#4439) --- www/scripts/models/field.js | 1 + 1 file changed, 1 insertion(+) diff --git a/www/scripts/models/field.js b/www/scripts/models/field.js index c93365f103..4810927307 100644 --- a/www/scripts/models/field.js +++ b/www/scripts/models/field.js @@ -40,6 +40,7 @@ define([ "vocabulary-type": null, "aggregable": 0, "vocabulary-restricted": false, + "input_disable": false, "labels": { "fr": "", "en": "",