Skip to content

Commit

Permalink
Initial commit with what Antithesis provided
Browse files Browse the repository at this point in the history
  • Loading branch information
pamarcos committed Nov 7, 2024
0 parents commit e15ec3c
Show file tree
Hide file tree
Showing 15,126 changed files with 589,309 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
3 changes: 3 additions & 0 deletions config/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM scratch
COPY docker-compose.yml /docker-compose.yml
COPY volumes /volumes
124 changes: 124 additions & 0 deletions config/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
services:
clickhouse-01:
image: "clickhouse/clickhouse-server:${CHVER:-latest}"
user: "101:101"
container_name: clickhouse-01
hostname: clickhouse-01
environment:
- SERVER_DISPLAY_NAME="cluster_1S_2R node 2"
- SERVER_REPLICA=01
networks:
ant-network:
ipv4_address: 10.20.0.10
volumes:
- ./volumes/config/config.d:/etc/clickhouse-server/config.d
- ./volumes/clickhouse-server/config.xml:/etc/clickhouse-server/config.d/config.xml
- ./volumes/config/users.d:/etc/clickhouse-server/users.d
- ./volumes/clickhouse-server/users.xml:/etc/clickhouse-server/users.d/users.xml
- ./volumes/config/test_files:/etc/clickhouse-server/test_files
- ./volumes/config/top_level_domains:/etc/clickhouse-server/top_level_domains
- ./volumes/config/test_files/server.crt:/etc/clickhouse-server/server.crt
- ./volumes/config/test_files/server.key:/etc/clickhouse-server/server.key
cap_add:
- CAP_SYS_NICE
depends_on:
- clickhouse-keeper-01
- clickhouse-keeper-02
- clickhouse-keeper-03
clickhouse-02:
image: "clickhouse/clickhouse-server:${CHVER:-latest}"
user: "101:101"
container_name: clickhouse-02
hostname: clickhouse-02
environment:
- SERVER_DISPLAY_NAME="cluster_1S_2R node 2"
- SERVER_REPLICA=02
networks:
ant-network:
ipv4_address: 10.20.0.20
volumes:
- ./volumes/config/config.d:/etc/clickhouse-server/config.d
- ./volumes/clickhouse-server/config.xml:/etc/clickhouse-server/config.d/config.xml
- ./volumes/config/users.d:/etc/clickhouse-server/users.d
- ./volumes/clickhouse-server/users.xml:/etc/clickhouse-server/users.d/users.xml
- ./volumes/config/test_files:/etc/clickhouse-server/test_files
- ./volumes/config/top_level_domains:/etc/clickhouse-server/top_level_domains
- ./volumes/config/test_files/server.crt:/etc/clickhouse-server/server.crt
- ./volumes/config/test_files/server.key:/etc/clickhouse-server/server.key
# ports:
# - "127.0.0.1:8124:8123"
# - "127.0.0.1:9001:9000"
cap_add:
- CAP_SYS_NICE
depends_on:
- clickhouse-keeper-01
- clickhouse-keeper-02
- clickhouse-keeper-03
clickhouse-keeper-01:
image: "clickhouse/clickhouse-keeper:${CHKVER:-latest}"
user: "101:101"
container_name: clickhouse-keeper-01
hostname: clickhouse-keeper-01
environment:
- SERVER_NUM=1
volumes:
- ./volumes/clickhouse-keeper/keeper_config.xml:/etc/clickhouse-keeper/keeper_config.xml
networks:
ant-network:
ipv4_address: 10.20.0.50
cap_add:
- CAP_SYS_NICE
# ports:
# - "127.0.0.1:9181:9181"
clickhouse-keeper-02:
image: "clickhouse/clickhouse-keeper:${CHKVER:-latest}"
user: "101:101"
container_name: clickhouse-keeper-02
hostname: clickhouse-keeper-02
environment:
- SERVER_NUM=2
volumes:
- ./volumes/clickhouse-keeper/keeper_config.xml:/etc/clickhouse-keeper/keeper_config.xml
cap_add:
- CAP_SYS_NICE
# ports:
# - "127.0.0.1:9182:9181"
networks:
ant-network:
ipv4_address: 10.20.0.60
clickhouse-keeper-03:
image: "clickhouse/clickhouse-keeper:${CHKVER:-latest}"
user: "101:101"
container_name: clickhouse-keeper-03
hostname: clickhouse-keeper-03
environment:
- SERVER_NUM=3
volumes:
- ./volumes/clickhouse-keeper/keeper_config.xml:/etc/clickhouse-keeper/keeper_config.xml
cap_add:
- CAP_SYS_NICE
# ports:
# - "127.0.0.1:9183:9181"
networks:
ant-network:
ipv4_address: 10.20.0.70
workload:
image: "functional_workload:latest"
container_name: workload
hostname: workload
environment:
- CLICKHOUSE_HOST=clickhouse-01 # need to make this randomized
- CLICKHOUSE_PORT=9000
# volumes: ../../../../../projects/ClickHouse:/ClickHouse
cap_add:
- CAP_SYS_NICE
networks:
ant-network:
ipv4_address: 10.20.0.80
networks:
ant-network:
driver: bridge
ipam:
config:
- subnet: 10.20.0.0/24
gateway: 10.20.0.1
35 changes: 35 additions & 0 deletions config/volumes/clickhouse-keeper/keeper_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<clickhouse replace="true">
<logger>
<level>information</level>
<console>1</console>
</logger>
<listen_host>0.0.0.0</listen_host>
<keeper_server>
<tcp_port>9181</tcp_port>
<server_id from_env="SERVER_NUM"/>
<log_storage_path>/var/lib/clickhouse/coordination/log</log_storage_path>
<snapshot_storage_path>/var/lib/clickhouse/coordination/snapshots</snapshot_storage_path>
<coordination_settings>
<operation_timeout_ms>10000</operation_timeout_ms>
<session_timeout_ms>30000</session_timeout_ms>
<raft_logs_level>information</raft_logs_level>
</coordination_settings>
<raft_configuration>
<server>
<id>1</id>
<hostname>clickhouse-keeper-01</hostname>
<port>9234</port>
</server>
<server>
<id>2</id>
<hostname>clickhouse-keeper-02</hostname>
<port>9234</port>
</server>
<server>
<id>3</id>
<hostname>clickhouse-keeper-03</hostname>
<port>9234</port>
</server>
</raft_configuration>
</keeper_server>
</clickhouse>
55 changes: 55 additions & 0 deletions config/volumes/clickhouse-server/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<clickhouse replace="true">
<logger>
<level>information</level>
<console>1</console>
</logger>
<display_name from_env="SERVER_DISPLAY_NAME"/>
<listen_host>0.0.0.0</listen_host>
<http_port>8123</http_port>
<tcp_port>9000</tcp_port>
<user_directories>
<users_xml>
<path>users.xml</path>
</users_xml>
<local_directory>
<path>/var/lib/clickhouse/access/</path>
</local_directory>
</user_directories>
<distributed_ddl>
<path>/clickhouse/task_queue/ddl</path>
</distributed_ddl>
<remote_servers>
<cluster_1S_2R>
<shard>
<internal_replication>true</internal_replication>
<replica>
<host>clickhouse-01</host>
<port>9000</port>
</replica>
<replica>
<host>clickhouse-02</host>
<port>9000</port>
</replica>
</shard>
</cluster_1S_2R>
</remote_servers>
<zookeeper>
<node>
<host>clickhouse-keeper-01</host>
<port>9181</port>
</node>
<node>
<host>clickhouse-keeper-02</host>
<port>9181</port>
</node>
<node>
<host>clickhouse-keeper-03</host>
<port>9181</port>
</node>
</zookeeper>
<macros>
<shard>01</shard>
<replica from_env="SERVER_REPLICA"/>
<cluster>cluster_1S_2R</cluster>
</macros>
</clickhouse>
37 changes: 37 additions & 0 deletions config/volumes/clickhouse-server/users.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0"?>
<clickhouse replace="true">
<profiles>
<default>
<max_memory_usage>10000000000</max_memory_usage>
<use_uncompressed_cache>0</use_uncompressed_cache>
<load_balancing>in_order</load_balancing>
<log_queries>1</log_queries>
</default>
</profiles>
<users>
<default>
<access_management>1</access_management>
<profile>default</profile>
<networks>
<ip>::/0</ip>
</networks>
<quota>default</quota>
<access_management>1</access_management>
<named_collection_control>1</named_collection_control>
<show_named_collections>1</show_named_collections>
<show_named_collections_secrets>1</show_named_collections_secrets>
</default>
</users>
<quotas>
<default>
<interval>
<duration>3600</duration>
<queries>0</queries>
<errors>0</errors>
<result_rows>0</result_rows>
<read_rows>0</read_rows>
<execution_time>0</execution_time>
</interval>
</default>
</quotas>
</clickhouse>
8 changes: 8 additions & 0 deletions config/volumes/config/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# ClickHouse configs for test environment

## How to use
CI use these configs in all checks installing them with `install.sh` script. If you want to run all tests from `tests/queries/0_stateless` and `test/queries/1_stateful` on your local machine you have to set up configs from this directory for your `clickhouse-server`. The easiest way is to install them using `install.sh` script. Another option is to copy files into your clickhouse config directory.

## How to add new config

Place file `.xml` with new config in the appropriate directory and add `ln` command into `install.sh` script. CI will use then this config in all test runs.
20 changes: 20 additions & 0 deletions config/volumes/config/config.d/CORS.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<clickhouse>
<http_options_response>
<header>
<name>Access-Control-Allow-Origin</name>
<value>*</value>
</header>
<header>
<name>Access-Control-Allow-Headers</name>
<value>origin, x-requested-with</value>
</header>
<header>
<name>Access-Control-Allow-Methods</name>
<value>POST, GET, OPTIONS</value>
</header>
<header>
<name>Access-Control-Max-Age</name>
<value>86400</value>
</header>
</http_options_response>
</clickhouse>
5 changes: 5 additions & 0 deletions config/volumes/config/config.d/backoff_failed_mutation.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<clickhouse>
<merge_tree>
<max_postpone_time_for_failed_mutations_ms>200</max_postpone_time_for_failed_mutations_ms>
</merge_tree>
</clickhouse>
13 changes: 13 additions & 0 deletions config/volumes/config/config.d/backups.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<clickhouse>
<storage_configuration>
<disks>
<backups>
<type>local</type>
<path>/var/lib/clickhouse/disks/backups/</path>
</backups>
</disks>
</storage_configuration>
<backups>
<allowed_disk>backups</allowed_disk>
</backups>
</clickhouse>
9 changes: 9 additions & 0 deletions config/volumes/config/config.d/blob_storage_log.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<clickhouse>
<blob_storage_log>
<database>system</database>
<table>blob_storage_log</table>
<partition_by>toYYYYMM(event_date)</partition_by>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
<ttl>event_date + INTERVAL 30 DAY</ttl>
</blob_storage_log>
</clickhouse>
7 changes: 7 additions & 0 deletions config/volumes/config/config.d/block_number.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<clickhouse>
<merge_tree>
<!-- Setting randomized for stress test, it is disabled here and this line is used to randomize it in the script -->
<enable_block_number_column>0</enable_block_number_column>
<enable_block_offset_column>0</enable_block_offset_column>
</merge_tree>
</clickhouse>
Loading

0 comments on commit e15ec3c

Please sign in to comment.