From 0a847ed53dd6f63efe23e008c65c249372abe64a Mon Sep 17 00:00:00 2001 From: vcarroy Date: Fri, 4 Oct 2024 15:52:04 +0200 Subject: [PATCH] feat: add xdebug to dispatcher and sql --- components/hydra-sql/files/50_xdebug.ini | 8 ++++++++ components/hydra-sql/kustomization.yaml | 7 +++++++ .../resources/hydra-sql-deployment.yaml | 12 +++++------ .../hydra-dispatcher/files/50_xdebug.ini | 8 ++++++++ resources/hydra-dispatcher/kustomization.yaml | 9 ++++++++- .../hydra-dispatcher-deployment.yaml | 20 +++++++------------ 6 files changed, 44 insertions(+), 20 deletions(-) create mode 100644 components/hydra-sql/files/50_xdebug.ini create mode 100644 resources/hydra-dispatcher/files/50_xdebug.ini diff --git a/components/hydra-sql/files/50_xdebug.ini b/components/hydra-sql/files/50_xdebug.ini new file mode 100644 index 0000000..f0a7de6 --- /dev/null +++ b/components/hydra-sql/files/50_xdebug.ini @@ -0,0 +1,8 @@ +# Prevent execution timeout due to the large amount of data to process during profling sessions +max_execution_time=300 +# Extension +zend_extension=xdebug.so +# Xdebug configuration +xdebug.mode=${XDEBUG_MODE} +xdebug.client_host=${XDEBUG_CLIENT_HOST} +xdebug.start_with_request=${XDEBUG_START_WITH_REQUEST} \ No newline at end of file diff --git a/components/hydra-sql/kustomization.yaml b/components/hydra-sql/kustomization.yaml index 0504eb2..44fa7e6 100644 --- a/components/hydra-sql/kustomization.yaml +++ b/components/hydra-sql/kustomization.yaml @@ -24,9 +24,16 @@ configMapGenerator: - DB_PASSWORD="makeMeASecret" - REDIS_DSN="redis://redis:6379" - PEPPER="MakeMeABigSecret" + - OPCACHE_VALIDATE_TIMESTAMP="0" + - OPCACHE_REVALIDATE_FREQ="0" + - XDEBUG_MODE=off - name: sql-login-config files: - ./files/sql_login.yaml - name: hydra-sql-php-ini files: - ./files/03_base.ini +- name: xdebug-sql-config + behavior: create + files: + - ./files/50_xdebug.ini diff --git a/components/hydra-sql/resources/hydra-sql-deployment.yaml b/components/hydra-sql/resources/hydra-sql-deployment.yaml index 610ac62..1ead16b 100644 --- a/components/hydra-sql/resources/hydra-sql-deployment.yaml +++ b/components/hydra-sql/resources/hydra-sql-deployment.yaml @@ -55,10 +55,6 @@ spec: value: 128m - name: PHP_FPM_LOG_LEVEL value: warning - - name: OPCACHE_VALIDATE_TIMESTAMP - value: "0" - - name: OPCACHE_REVALIDATE_FREQ - value: "0" volumeMounts: - name: sql-login-config mountPath: "/app/config/sql_login_configuration/sql_login.yaml" @@ -66,7 +62,9 @@ spec: - name: hydra-sql-php-ini mountPath: /etc/php81/conf.d/03_base.ini subPath: 03_base.ini - + - name: xdebug-sql-config + mountPath: /etc/php81/conf.d/50_xdebug.ini + subPath: 50_xdebug.ini - name: hydra-sql-caddy image: reg.cadoles.com/cadoles/hydra-sql-base:2024.10.10-develop.1026.8e56433 imagePullPolicy: Always @@ -118,5 +116,7 @@ spec: - name: hydra-sql-php-ini configMap: name: hydra-sql-php-ini - + - name: xdebug-sql-config + configMap: + name: xdebug-sql-config restartPolicy: Always diff --git a/resources/hydra-dispatcher/files/50_xdebug.ini b/resources/hydra-dispatcher/files/50_xdebug.ini new file mode 100644 index 0000000..f0a7de6 --- /dev/null +++ b/resources/hydra-dispatcher/files/50_xdebug.ini @@ -0,0 +1,8 @@ +# Prevent execution timeout due to the large amount of data to process during profling sessions +max_execution_time=300 +# Extension +zend_extension=xdebug.so +# Xdebug configuration +xdebug.mode=${XDEBUG_MODE} +xdebug.client_host=${XDEBUG_CLIENT_HOST} +xdebug.start_with_request=${XDEBUG_START_WITH_REQUEST} \ No newline at end of file diff --git a/resources/hydra-dispatcher/kustomization.yaml b/resources/hydra-dispatcher/kustomization.yaml index 7ab4a1d..4df71af 100644 --- a/resources/hydra-dispatcher/kustomization.yaml +++ b/resources/hydra-dispatcher/kustomization.yaml @@ -26,9 +26,16 @@ configMapGenerator: - DEFAULT_LOCALE=fr - APP_LOCALES=fr,en - REDIS_DSN="redis://redis:6379" + - OPCACHE_VALIDATE_TIMESTAMP="0" + - OPCACHE_REVALIDATE_FREQ="0" + - XDEBUG_MODE=off - name: hydra-dispatcher-apps files: - apps.yaml=./files/hydra/default.yaml - name: hydra-dispatcher-php-ini files: - - ./files/03_base.ini \ No newline at end of file + - ./files/03_base.ini +- name: xdebug-dispatcher-config + behavior: create + files: + - ./files/50_xdebug.ini \ No newline at end of file diff --git a/resources/hydra-dispatcher/resources/hydra-dispatcher-deployment.yaml b/resources/hydra-dispatcher/resources/hydra-dispatcher-deployment.yaml index 5006247..58ae9e0 100644 --- a/resources/hydra-dispatcher/resources/hydra-dispatcher-deployment.yaml +++ b/resources/hydra-dispatcher/resources/hydra-dispatcher-deployment.yaml @@ -41,10 +41,6 @@ spec: value: 128m - name: PHP_FPM_MEMORY_LIMIT value: 128m - - name: OPCACHE_VALIDATE_TIMESTAMP - value: "0" - - name: OPCACHE_REVALIDATE_FREQ - value: "0" envFrom: - configMapRef: name: hydra-dispatcher-env @@ -54,6 +50,9 @@ spec: - name: hydra-dispatcher-php-ini mountPath: /etc/php81/conf.d/03_base.ini subPath: 03_base.ini + - name: xdebug-dispatcher-config + mountPath: /etc/php81/conf.d/50_xdebug.ini + subPath: 50_xdebug.ini resources: {} securityContext: runAsNonRoot: true @@ -62,15 +61,7 @@ spec: - name: hydra-dispatcher-caddy image: reg.cadoles.com/cadoles/hydra-dispatcher-base:2024.9.24-develop.1122.f88a5eb imagePullPolicy: Always - args: - [ - "/usr/sbin/caddy", - "run", - "--adapter", - "caddyfile", - "--config", - "/etc/caddy/Caddyfile", - ] + args: ["/usr/sbin/caddy", "run", "--adapter", "caddyfile", "--config", "/etc/caddy/Caddyfile"] readinessProbe: httpGet: path: /health @@ -115,3 +106,6 @@ spec: - name: hydra-dispatcher-php-ini configMap: name: hydra-dispatcher-php-ini + - name: xdebug-dispatcher-config + configMap: + name: xdebug-dispatcher-config -- 2.17.1