|
@@ -124,7 +124,14 @@ DEVSERVICES_CONFIG_DIR = os.path.normpath(
|
|
|
os.path.join(PROJECT_ROOT, os.pardir, os.pardir, "config")
|
|
|
)
|
|
|
|
|
|
-CLICKHOUSE_CONFIG_PATH = os.path.join(DEVSERVICES_CONFIG_DIR, "clickhouse", "config.xml")
|
|
|
+SENTRY_DISTRIBUTED_CLICKHOUSE_TABLES = False
|
|
|
+_common_clickhouse_settings = {
|
|
|
+ "image": "yandex/clickhouse-server:20.3.9.70",
|
|
|
+ "pull": True,
|
|
|
+ "ports": {"9000/tcp": 9000, "9009/tcp": 9009, "8123/tcp": 8123},
|
|
|
+ "ulimits": [{"name": "nofile", "soft": 262144, "hard": 262144}],
|
|
|
+ "environment": {"MAX_MEMORY_USAGE_RATIO": "0.3"},
|
|
|
+}
|
|
|
|
|
|
RELAY_CONFIG_DIR = os.path.join(DEVSERVICES_CONFIG_DIR, "relay")
|
|
|
|
|
@@ -1662,23 +1669,24 @@ SENTRY_DEVSERVICES = {
|
|
|
),
|
|
|
},
|
|
|
"clickhouse": {
|
|
|
- "image": "yandex/clickhouse-server:20.3.9.70",
|
|
|
- "pull": True,
|
|
|
- "ports": {"9000/tcp": 9000, "9009/tcp": 9009, "8123/tcp": 8123},
|
|
|
- "ulimits": [{"name": "nofile", "soft": 262144, "hard": 262144}],
|
|
|
+ **_common_clickhouse_settings,
|
|
|
"volumes": {
|
|
|
"clickhouse": {"bind": "/var/lib/clickhouse"},
|
|
|
- CLICKHOUSE_CONFIG_PATH: {"bind": "/etc/clickhouse-server/config.d/sentry.xml"},
|
|
|
+ os.path.join(DEVSERVICES_CONFIG_DIR, "clickhouse", "loc_config.xml"): {
|
|
|
+ "bind": "/etc/clickhouse-server/config.d/sentry.xml"
|
|
|
+ },
|
|
|
},
|
|
|
- "environment": {
|
|
|
- # This limits Clickhouse's memory to 30% of the host memory
|
|
|
- # If you have high volume and your search return incomplete results
|
|
|
- # You might want to change this to a higher value (and ensure your host has enough memory)
|
|
|
- "MAX_MEMORY_USAGE_RATIO": "0.3"
|
|
|
+ "only_if": lambda settings, options: (not settings.SENTRY_DISTRIBUTED_CLICKHOUSE_TABLES),
|
|
|
+ },
|
|
|
+ "clickhouse_dist": {
|
|
|
+ **_common_clickhouse_settings,
|
|
|
+ "volumes": {
|
|
|
+ "clickhouse_dist": {"bind": "/var/lib/clickhouse"},
|
|
|
+ os.path.join(DEVSERVICES_CONFIG_DIR, "clickhouse", "dist_config.xml"): {
|
|
|
+ "bind": "/etc/clickhouse-server/config.d/sentry.xml"
|
|
|
+ },
|
|
|
},
|
|
|
- "only_if": lambda settings, options: (
|
|
|
- "snuba" in settings.SENTRY_EVENTSTREAM or "kafka" in settings.SENTRY_EVENTSTREAM
|
|
|
- ),
|
|
|
+ "only_if": lambda settings, options: (settings.SENTRY_DISTRIBUTED_CLICKHOUSE_TABLES),
|
|
|
},
|
|
|
"snuba": {
|
|
|
"image": "getsentry/snuba:nightly",
|