Skip to content

Commit c217f39

Browse files
authored
Fix tests (#419)
* change docker work due to changes introduced in 24 * add workflow_dispatch to build-and-test (#417) (#418) * try patched version
1 parent 4fab1f4 commit c217f39

File tree

5 files changed

+32
-86
lines changed

5 files changed

+32
-86
lines changed

.github/workflows/build-and-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
strategy:
6060
fail-fast: false
6161
matrix:
62-
clickhouse: [ 22.3, 22.8, 23.3, 23.8, 24.3, 24.6 ]
62+
clickhouse: [ 22.3, 22.8, 23.3, 23.8, 24.3.12, 24.6 ]
6363
env:
6464
CLICKHOUSE_IMAGE: clickhouse/clickhouse-server:${{ matrix.clickhouse }}
6565
steps:

clickhouse-core/src/testFixtures/conf/clickhouse-cluster/clickhouse-s2r2-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ services:
2121

2222
clickhouse-s1r1:
2323
image: ${CLICKHOUSE_IMAGE}
24+
environment:
25+
"CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT": "1"
2426
hostname: clickhouse-s1r1
2527
ports:
2628
- 8123

clickhouse-core/src/testFixtures/conf/clickhouse-cluster/config.xml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,14 @@
1212
See the License for the specific language governing permissions and
1313
limitations under the License. See accompanying LICENSE file.
1414
-->
15-
<yandex>
15+
<clickhouse>
16+
<!-- User configuration path - REQUIRED for ClickHouse 24 -->
17+
<user_directories>
18+
<users_xml>
19+
<path>/etc/clickhouse-server/users.xml</path>
20+
</users_xml>
21+
</user_directories>
22+
1623
<logger>
1724
<level>debug</level>
1825
<log>/var/log/clickhouse-server/clickhouse-server.log</log>
@@ -67,8 +74,6 @@
6774
<!-- Directory in <clickhouse-path> containing schema files for various input formats. The directory will be created if it doesn't exist. -->
6875
<format_schema_path>/var/lib/clickhouse/format_schema/</format_schema_path>
6976

70-
<users_config>users.xml</users_config>
71-
7277
<default_profile>default</default_profile>
7378
<default_database>default</default_database>
7479

@@ -95,4 +100,4 @@
95100
</distributed_ddl>
96101
<default_replica_path>/clickhouse/tables/{shard}/{database}/{table}</default_replica_path>
97102
<default_replica_name>{replica}</default_replica_name>
98-
</yandex>
103+
</clickhouse>

clickhouse-core/src/testFixtures/conf/clickhouse-cluster/users.xml

Lines changed: 19 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -12,108 +12,46 @@
1212
See the License for the specific language governing permissions and
1313
limitations under the License. See accompanying LICENSE file.
1414
-->
15-
<yandex>
16-
<!-- Profiles of settings. -->
17-
<profiles>
18-
<!-- Default settings. -->
19-
<default>
20-
<!-- Maximum memory usage for processing single query, in bytes. -->
21-
<max_memory_usage>10000000000</max_memory_usage>
22-
23-
<!-- How to choose between replicas during distributed query processing.
24-
random - choose random replica from set of replicas with minimum number of errors
25-
nearest_hostname - from set of replicas with minimum number of errors, choose replica
26-
with minimum number of different symbols between replica's hostname and local hostname
27-
(Hamming distance).
28-
in_order - first live replica is chosen in specified order.
29-
first_or_random - if first replica one has higher number of errors, pick a random one from replicas with minimum number of errors.
30-
-->
31-
<load_balancing>random</load_balancing>
32-
<!-- Enable Map support -->
33-
<allow_experimental_map_type>1</allow_experimental_map_type>
34-
</default>
35-
36-
<!-- Profile that allows only read queries. -->
37-
<readonly>
38-
<readonly>1</readonly>
39-
</readonly>
40-
</profiles>
41-
15+
<clickhouse>
4216
<!-- Users and ACL. -->
4317
<users>
44-
<!-- If user name was not specified, 'default' user is used. -->
4518
<default>
46-
<!-- Password could be specified in plaintext or in SHA256 (in hex format).
47-
48-
If you want to specify password in plaintext (not recommended), place it in 'password' element.
49-
Example: <password>qwerty</password>.
50-
Password could be empty.
51-
52-
If you want to specify SHA256, place it in 'password_sha256_hex' element.
53-
Example: <password_sha256_hex>65e84be33532fb784c48129675f9eff3a682b27168c0ea744b2cf58ee02337c5</password_sha256_hex>
54-
Restrictions of SHA256: impossibility to connect to ClickHouse using MySQL JS client (as of July 2019).
55-
56-
If you want to specify double SHA1, place it in 'password_double_sha1_hex' element.
57-
Example: <password_double_sha1_hex>e395796d6546b1b65db9d665cd43f0e858dd4303</password_double_sha1_hex>
58-
59-
If you want to specify a previously defined LDAP server (see 'ldap_servers' in main config) for authentication, place its name in 'server' element inside 'ldap' element.
60-
Example: <ldap><server>my_ldap_server</server></ldap>
61-
62-
How to generate decent password:
63-
Execute: PASSWORD=$(base64 < /dev/urandom | head -c8); echo "$PASSWORD"; echo -n "$PASSWORD" | sha256sum | tr -d '-'
64-
In first line will be password and in second - corresponding SHA256.
65-
66-
How to generate double SHA1:
67-
Execute: PASSWORD=$(base64 < /dev/urandom | head -c8); echo "$PASSWORD"; echo -n "$PASSWORD" | sha1sum | tr -d '-' | xxd -r -p | sha1sum | tr -d '-'
68-
In first line will be password and in second - corresponding double SHA1.
69-
-->
19+
<!-- Password could be empty. If so, any password is allowed. -->
7020
<password></password>
7121

72-
<!-- List of networks with open access.
73-
74-
To open access from everywhere, specify:
75-
<ip>::/0</ip>
76-
77-
To open access only from localhost, specify:
78-
<ip>::1</ip>
79-
<ip>127.0.0.1</ip>
22+
<!-- Or you can specify password hash (see authentication methods section). -->
23+
<!-- <password_sha256_hex></password_sha256_hex> -->
8024

81-
Each element of list has one of the following forms:
82-
<ip> IP-address or network mask. Examples: 213.180.204.3 or 10.0.0.1/8 or 10.0.0.1/255.255.255.0
83-
2a02:6b8::3 or 2a02:6b8::3/64 or 2a02:6b8::3/ffff:ffff:ffff:ffff::.
84-
<host> Hostname. Example: server01.yandex.ru.
85-
To check access, DNS query is performed, and all received addresses compared to peer address.
86-
<host_regexp> Regular expression for host names. Example, ^server\d\d-\d\d-\d\.yandex\.ru$
87-
To check access, DNS PTR query is performed for peer address and then regexp is applied.
88-
Then, for result of PTR query, another DNS query is performed and all received addresses compared to peer address.
89-
Strongly recommended that regexp is ends with $
90-
All results of DNS requests are cached till server restart.
91-
-->
25+
<!-- List of networks with open access. -->
9226
<networks>
9327
<ip>::/0</ip>
9428
</networks>
9529

96-
<!-- Settings profile for user. -->
30+
<!-- Settings profile for the user. -->
9731
<profile>default</profile>
9832

99-
<!-- Quota for user. -->
33+
<!-- Quota for the user. -->
10034
<quota>default</quota>
10135

102-
<!-- User can create other users and grant rights to them. -->
103-
<!-- <access_management>1</access_management> -->
36+
<!-- Access management for the user. -->
37+
<access_management>1</access_management>
10438
</default>
10539
</users>
10640

41+
<!-- Profiles of settings. -->
42+
<profiles>
43+
<default>
44+
<max_memory_usage>10000000000</max_memory_usage>
45+
<use_uncompressed_cache>0</use_uncompressed_cache>
46+
<load_balancing>random</load_balancing>
47+
</default>
48+
</profiles>
49+
10750
<!-- Quotas. -->
10851
<quotas>
109-
<!-- Name of quota. -->
11052
<default>
111-
<!-- Limits for time interval. You could specify many intervals with different limits. -->
11253
<interval>
113-
<!-- Length of interval. -->
11454
<duration>3600</duration>
115-
116-
<!-- No limits. Just calculate resource usage for time interval. -->
11755
<queries>0</queries>
11856
<errors>0</errors>
11957
<result_rows>0</result_rows>
@@ -122,4 +60,4 @@
12260
</interval>
12361
</default>
12462
</quotas>
125-
</yandex>
63+
</clickhouse>

clickhouse-core/src/testFixtures/scala/com/clickhouse/spark/base/ClickHouseSingleMixIn.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ trait ClickHouseSingleMixIn extends AnyFunSuite with ForAllTestContainer with Cl
6363
.withEnv("CLICKHOUSE_USER", CLICKHOUSE_USER)
6464
.withEnv("CLICKHOUSE_PASSWORD", CLICKHOUSE_PASSWORD)
6565
.withEnv("CLICKHOUSE_DB", CLICKHOUSE_DB)
66+
.withEnv("CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT", "1")
6667
.withExposedPorts(CLICKHOUSE_HTTP_PORT, CLICKHOUSE_TPC_PORT)
6768
.withFileSystemBind(s"${sys.env("ROOT_PROJECT_DIR")}/log/clickhouse-server", "/var/log/clickhouse-server")
6869
.withCopyFileToContainer(

0 commit comments

Comments
 (0)