From 085526abb2a080d3adaabdf40c4faf4294bd407c Mon Sep 17 00:00:00 2001 From: Justin Clareburt <122523970+justo-mend@users.noreply.github.com> Date: Thu, 11 Jul 2024 16:54:26 +0200 Subject: [PATCH] docs: recommended settings for multi-server deployments (#534) * Added supported platform to the README * docs: recommended Server settings when running multiple Server instances are to disable startup actions for AppSync and EnqueueJobs --- docs/configuration-options.md | 27 ++++++++++++---- .../renovate-ee-server-ha-postgres.yml | 31 +++++++++++++------ 2 files changed, 43 insertions(+), 15 deletions(-) diff --git a/docs/configuration-options.md b/docs/configuration-options.md index 933d25c5..c6c7ef5a 100644 --- a/docs/configuration-options.md +++ b/docs/configuration-options.md @@ -72,7 +72,20 @@ job_queue migrations org repo task_queue sqlite> ``` -**`MEND_RNV_SYNC_ON_STARTUP`**: Defines if App Sync will be performed when the server starts. Defaults to true. +### Startup and Sync behavior + +> [!IMPORTANT] +> +> When running Renovate Enterprise with multiple Server instances, unpredictable behavior can occur when more than one server attempts to sync repos or enqueue jobs. +> Therefore, it is recommended NOT to run App Sync or to enqueue jobs when the server starts, and instead to rely on the primary server to perform these tasks when the related cron jobs are triggered. +> +> **Recommended settings when running with multiple Server instances:** +> - Set `MEND_RNV_SYNC_ON_STARTUP` = false +> - Set `MEND_RNV_ENQUEUE_JOBS_ON_STARTUP` = disabled + +**`MEND_RNV_SYNC_ON_STARTUP`**: Defines if App Sync will be performed when the server starts. Defaults to `true`. + +Note: This should be set to `false` when running multiple Server instances. **`MEND_RNV_SYNC_MODE`**: [GitHub only] Performance tuning for the App Sync operation. Set to 'batch' for orgs with very large numbers of repos. @@ -82,16 +95,18 @@ values: **`MEND_RNV_CRON_APP_SYNC`**: Optional: Accepts a 5-part cron schedule. Defaults to `0 0,4,8,12,16,20 * * *` (every 4 hours, on the hour). This cron job performs autodiscovery against the platform and fills the SQLite database with projects. -**`MEND_RNV_AUTODISCOVER_FILTER`**: a string of a comma separated values (e.g. `org1/*, org2/test*, org2/test*`). Same behavior as Renovate [autodiscoverFilter](https://docs.renovatebot.com/self-hosted-configuration/#autodiscoverfilter) - -> [!WARNING] -> The Renovate CLI [autodiscover](https://docs.renovatebot.com/self-hosted-configuration/#autodiscover) configuration option is disabled at the client level. Repository filtering should solely rely on server-side filtering using `MEND_RNV_AUTODISCOVER_FILTER`. - **`MEND_RNV_ENQUEUE_JOBS_ON_STARTUP`**: The job enqueue behavior on start (or restart). Defaults to `discovered`. (Note that the behavior can be different if the database is persisted or not) - `enabled`: enqueue a job for all available repositories - `discovered`: enqueue a job only for newly discovered repositories - `disabled`: No jobs are enqueued +Note: This should be set to `disabled` when running multiple Server instances. + +**`MEND_RNV_AUTODISCOVER_FILTER`**: a string of a comma separated values (e.g. `org1/*, org2/test*, org2/test*`). Same behavior as Renovate [autodiscoverFilter](https://docs.renovatebot.com/self-hosted-configuration/#autodiscoverfilter) + +> [!WARNING] +> The Renovate CLI [autodiscover](https://docs.renovatebot.com/self-hosted-configuration/#autodiscover) configuration option is disabled at the client level. Repository filtering should solely rely on server-side filtering using `MEND_RNV_AUTODISCOVER_FILTER`. + ### Job Scheduling Options > [!IMPORTANT] diff --git a/examples/docker-compose/renovate-ee-server-ha-postgres.yml b/examples/docker-compose/renovate-ee-server-ha-postgres.yml index 7b5097e4..e6484555 100644 --- a/examples/docker-compose/renovate-ee-server-ha-postgres.yml +++ b/examples/docker-compose/renovate-ee-server-ha-postgres.yml @@ -15,22 +15,35 @@ x-shared-variables: &shared_variables ## Server variables x-server-variables: &server_variables - # Enable Merge Confidence package rules + ## Enable Merge Confidence package rules MEND_RNV_MC_TOKEN: auto # Provide token or set to 'auto' - # Renovate App connection details (eg. GitHub, GitLab, Bitbucket) - # GitHub configuration variables provided below for convenience. - # See Renovate-CE-EE documentation for connection details for all platforms. + ## Renovate App connection details (eg. GitHub, GitLab, Bitbucket) + ## GitHub configuration variables provided below for convenience. + ## See Renovate-CE-EE documentation for connection details for all platforms. # MEND_RNV_PLATFORM: github # MEND_RNV_GITHUB_APP_ID: # App ID # MEND_RNV_GITHUB_APP_KEY: # Private key # MEND_RNV_WEBHOOK_SECRET: # Webhook secret (Defaults to 'renovate') - ## Mend Renovate Application settings - MEND_RNV_ADMIN_API_ENABLED: true # Enable incoming API calls - MEND_RNV_LOG_HISTORY_DIR: /logs # Write Renovate job logs to file. Enable volume mount on Server and Worker! - MEND_RNV_ENQUEUE_JOBS_ON_STARTUP: disabled # Options: 'enabled', 'disabled', 'discovered' (default) + ## Mend Renovate Application settings (Optional) + ## Sync and Job scheduling + MEND_RNV_SYNC_ON_STARTUP: false # Set to `false` when running multiple Server instances + MEND_RNV_ENQUEUE_JOBS_ON_STARTUP: disabled # Set to `disabled` when running multiple Server instances # MEND_RNV_AUTODISCOVER_FILTER: org1/*, org2/test* # Renovate will only run on these repos + ## APIs + MEND_RNV_ADMIN_API_ENABLED: true # Enable incoming API calls. Must set MEND_RNV_SERVER_API_SECRET. + MEND_RNV_SERVER_API_SECRET: abc123 # Required to enable APIs + MEND_RNV_REPORTING_ENABLED: true # Defaults to false. Note: Enable RENOVATE_REPOSITORY_CACHE on Worker to activate /pulls API. + ## Job Logs + MEND_RNV_LOG_HISTORY_DIR: /logs # Persist Renovate job logs - organized by org/rep/timestamp. Enable volume mount! + # MEND_RNV_LOG_HISTORY_S3: s3://job-logs # Define the S3 bucket/folder configuration. Format: s3:///dir1/dir2 + +## Worker variables +x-worker-variables: &worker-variables + ## Core Renovate settings + # GITHUB_COM_TOKEN: # Personal Access Token for github.com (used for retrieving changelogs) + RENOVATE_REPOSITORY_CACHE: enabled # Enable Repo cache to use the /repos/:org(*)/-/:repo/pulls API. Only supported for GitHub. services: @@ -73,7 +86,7 @@ services: depends_on: - rnv-ee-server environment: - <<: *shared_variables + <<: [*shared-variables, *worker-variables] LOG_LEVEL: debug # Defaults to 'info' # LOG_FORMAT: json # Defaults to 'pretty' volumes: