Skip to content

Commit 0b2b2a5

Browse files
committed
Merge branch 'vector-support' into vector-arbitrary-support
2 parents 7ef44b6 + fa75d69 commit 0b2b2a5

File tree

85 files changed

+1749
-349
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+1749
-349
lines changed

.asf.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ notifications:
1919
2020
2121
pullrequests: [email protected]
22+
jira_options: link worklog
2223

2324
github:
2425
description: "Java Driver for Apache Cassandra®"
@@ -31,6 +32,5 @@ github:
3132
wiki: false
3233
issues: false
3334
projects: false
34-
35-
notifications:
36-
jira_options: link worklog
35+
autolink_jira:
36+
- CASSANDRA

Jenkinsfile-asf

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
#!groovy
2+
3+
/*
4+
* Licensed to the Apache Software Foundation (ASF) under one
5+
* or more contributor license agreements. See the NOTICE file
6+
* distributed with this work for additional information
7+
* regarding copyright ownership. The ASF licenses this file
8+
* to you under the Apache License, Version 2.0 (the
9+
* "License"); you may not use this file except in compliance
10+
* with the License. You may obtain a copy of the License at
11+
*
12+
* http://www.apache.org/licenses/LICENSE-2.0
13+
*
14+
* Unless required by applicable law or agreed to in writing,
15+
* software distributed under the License is distributed on an
16+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
* KIND, either express or implied. See the License for the
18+
* specific language governing permissions and limitations
19+
* under the License.
20+
*/
21+
22+
pipeline {
23+
agent {
24+
label 'cassandra-small'
25+
}
26+
27+
triggers {
28+
// schedules only run against release branches (i.e. 3.x, 4.x, 4.5.x, etc.)
29+
cron(branchPatternCron().matcher(env.BRANCH_NAME).matches() ? '@weekly' : '')
30+
}
31+
32+
stages {
33+
stage('Matrix') {
34+
matrix {
35+
axes {
36+
axis {
37+
name 'TEST_JAVA_VERSION'
38+
values '[email protected]', '[email protected]', 'openjdk@17'
39+
}
40+
axis {
41+
name 'SERVER_VERSION'
42+
values '3.11',
43+
'4.0',
44+
'4.1',
45+
'5.0'
46+
}
47+
}
48+
stages {
49+
stage('Tests') {
50+
agent {
51+
label 'cassandra-medium'
52+
}
53+
steps {
54+
script {
55+
executeTests()
56+
junit testResults: '**/target/surefire-reports/TEST-*.xml', allowEmptyResults: true
57+
junit testResults: '**/target/failsafe-reports/TEST-*.xml', allowEmptyResults: true
58+
}
59+
}
60+
}
61+
}
62+
}
63+
}
64+
}
65+
}
66+
67+
def executeTests() {
68+
def testJavaMajorVersion = (TEST_JAVA_VERSION =~ /@(?:1\.)?(\d+)/)[0][1]
69+
sh """
70+
container_id=\$(docker run -td -e TEST_JAVA_VERSION=${TEST_JAVA_VERSION} -e SERVER_VERSION=${SERVER_VERSION} -e TEST_JAVA_MAJOR_VERSION=${testJavaMajorVersion} -v \$(pwd):/home/docker/cassandra-java-driver apache.jfrog.io/cassan-docker/apache/cassandra-java-driver-testing-ubuntu2204 'sleep 2h')
71+
docker exec --user root \$container_id bash -c \"sudo bash /home/docker/cassandra-java-driver/ci/create-user.sh docker \$(id -u) \$(id -g) /home/docker/cassandra-java-driver\"
72+
docker exec --user docker \$container_id './cassandra-java-driver/ci/run-tests.sh'
73+
( nohup docker stop \$container_id >/dev/null 2>/dev/null & )
74+
"""
75+
}
76+
77+
// branch pattern for cron
78+
// should match 3.x, 4.x, 4.5.x, etc
79+
def branchPatternCron() {
80+
~'((\\d+(\\.[\\dx]+)+))'
81+
}

Jenkinsfile renamed to Jenkinsfile-datastax

Lines changed: 47 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def initializeEnvironment() {
6161
. ${JABBA_SHELL}
6262
jabba which 1.8''', returnStdout: true).trim()
6363

64-
sh label: 'Download Apache CassandraⓇ or DataStax Enterprise',script: '''#!/bin/bash -le
64+
sh label: 'Download Apache CassandraⓇ, DataStax Enterprise or DataStax HCD ',script: '''#!/bin/bash -le
6565
. ${JABBA_SHELL}
6666
jabba use 1.8
6767
. ${CCM_ENVIRONMENT_SHELL} ${SERVER_VERSION}
@@ -75,13 +75,26 @@ CCM_CASSANDRA_VERSION=${DSE_FIXED_VERSION} # maintain for backwards compatibilit
7575
CCM_VERSION=${DSE_FIXED_VERSION}
7676
CCM_SERVER_TYPE=dse
7777
DSE_VERSION=${DSE_FIXED_VERSION}
78-
CCM_IS_DSE=true
7978
CCM_BRANCH=${DSE_FIXED_VERSION}
8079
DSE_BRANCH=${DSE_FIXED_VERSION}
8180
ENVIRONMENT_EOF
8281
'''
8382
}
8483

84+
if (env.SERVER_VERSION.split('-')[0] == 'hcd') {
85+
env.HCD_FIXED_VERSION = env.SERVER_VERSION.split('-')[1]
86+
sh label: 'Update environment for DataStax HCD', script: '''#!/bin/bash -le
87+
cat >> ${HOME}/environment.txt << ENVIRONMENT_EOF
88+
CCM_CASSANDRA_VERSION=${HCD_FIXED_VERSION} # maintain for backwards compatibility
89+
CCM_VERSION=${HCD_FIXED_VERSION}
90+
CCM_SERVER_TYPE=hcd
91+
HCD_VERSION=${HCD_FIXED_VERSION}
92+
CCM_BRANCH=${HCD_FIXED_VERSION}
93+
HCD_BRANCH=${HCD_FIXED_VERSION}
94+
ENVIRONMENT_EOF
95+
'''
96+
}
97+
8598
sh label: 'Display Java and environment information',script: '''#!/bin/bash -le
8699
# Load CCM environment variables
87100
set -o allexport
@@ -144,7 +157,7 @@ def executeTests() {
144157
-Dmaven.test.failure.ignore=true \
145158
-Dmaven.javadoc.skip=${SKIP_JAVADOCS} \
146159
-Dccm.version=${CCM_CASSANDRA_VERSION} \
147-
-Dccm.dse=${CCM_IS_DSE} \
160+
-Dccm.distribution=${CCM_SERVER_TYPE:cassandra} \
148161
-Dproxy.path=${HOME}/proxy \
149162
${SERIAL_ITS_ARGUMENT} \
150163
${ISOLATED_ITS_ARGUMENT} \
@@ -255,19 +268,17 @@ pipeline {
255268
</table>''')
256269
choice(
257270
name: 'ADHOC_BUILD_AND_EXECUTE_TESTS_SERVER_VERSION',
258-
choices: ['2.1', // Legacy Apache CassandraⓇ
259-
'2.2', // Legacy Apache CassandraⓇ
260-
'3.0', // Previous Apache CassandraⓇ
261-
'3.11', // Previous Apache CassandraⓇ
262-
'4.0', // Previous Apache CassandraⓇ
263-
'4.1', // Current Apache CassandraⓇ
264-
'5.0-beta1', // Development Apache CassandraⓇ
271+
choices: ['4.0', // Previous Apache CassandraⓇ
272+
'4.1', // Previous Apache CassandraⓇ
273+
'5.0', // Current Apache CassandraⓇ
265274
'dse-4.8.16', // Previous EOSL DataStax Enterprise
266275
'dse-5.0.15', // Long Term Support DataStax Enterprise
267276
'dse-5.1.35', // Legacy DataStax Enterprise
268277
'dse-6.0.18', // Previous DataStax Enterprise
269278
'dse-6.7.17', // Previous DataStax Enterprise
270279
'dse-6.8.30', // Current DataStax Enterprise
280+
'dse-6.9.0', // Current DataStax Enterprise
281+
'hcd-1.0.0', // Current DataStax HCD
271282
'ALL'],
272283
description: '''Apache Cassandra&reg; and DataStax Enterprise server version to use for adhoc <b>BUILD-AND-EXECUTE-TESTS</b> builds
273284
<table style="width:100%">
@@ -277,22 +288,6 @@ pipeline {
277288
<th align="left">Choice</th>
278289
<th align="left">Description</th>
279290
</tr>
280-
<tr>
281-
<td><strong>2.1</strong></td>
282-
<td>Apache Cassandra&reg; v2.1.x</td>
283-
</tr>
284-
<tr>
285-
<td><strong>2.2</strong></td>
286-
<td>Apache Cassandra&reg; v2.2.x</td>
287-
</tr>
288-
<tr>
289-
<td><strong>3.0</strong></td>
290-
<td>Apache Cassandra&reg; v3.0.x</td>
291-
</tr>
292-
<tr>
293-
<td><strong>3.11</strong></td>
294-
<td>Apache Cassandra&reg; v3.11.x</td>
295-
</tr>
296291
<tr>
297292
<td><strong>4.0</strong></td>
298293
<td>Apache Cassandra&reg; v4.0.x</td>
@@ -301,6 +296,10 @@ pipeline {
301296
<td><strong>4.1</strong></td>
302297
<td>Apache Cassandra&reg; v4.1.x</td>
303298
</tr>
299+
<tr>
300+
<td><strong>5.0</strong></td>
301+
<td>Apache Cassandra&reg; v5.0.x</td>
302+
</tr>
304303
<tr>
305304
<td><strong>dse-4.8.16</strong></td>
306305
<td>DataStax Enterprise v4.8.x (<b>END OF SERVICE LIFE</b>)</td>
@@ -325,6 +324,14 @@ pipeline {
325324
<td><strong>dse-6.8.30</strong></td>
326325
<td>DataStax Enterprise v6.8.x</td>
327326
</tr>
327+
<tr>
328+
<td><strong>dse-6.9.0</strong></td>
329+
<td>DataStax Enterprise v6.9.x</td>
330+
</tr>
331+
<tr>
332+
<td><strong>hcd-1.0.0</strong></td>
333+
<td>DataStax HCD v1.0.x</td>
334+
</tr>
328335
</table>''')
329336
choice(
330337
name: 'ADHOC_BUILD_AND_EXECUTE_TESTS_JABBA_VERSION',
@@ -412,13 +419,10 @@ pipeline {
412419
// schedules only run against release branches (i.e. 3.x, 4.x, 4.5.x, etc.)
413420
parameterizedCron(branchPatternCron().matcher(env.BRANCH_NAME).matches() ? """
414421
# Every weekend (Saturday, Sunday) around 2:00 AM
415-
### JDK8 tests against 2.1, 3.0, 4.0, DSE 4.8, DSE 5.0, DSE 5.1, dse-6.0.18 and DSE 6.7
416-
H 2 * * 0 %CI_SCHEDULE=WEEKENDS;CI_SCHEDULE_SERVER_VERSIONS=2.1 3.0 4.0 dse-4.8.16 dse-5.0.15 dse-5.1.35 dse-6.0.18 dse-6.7.17;CI_SCHEDULE_JABBA_VERSION=1.8
422+
H 2 * * 0 %CI_SCHEDULE=WEEKENDS;CI_SCHEDULE_SERVER_VERSIONS=4.0 4.1 5.0 dse-4.8.16 dse-5.0.15 dse-5.1.35 dse-6.0.18 dse-6.7.17;CI_SCHEDULE_JABBA_VERSION=1.8
417423
# Every weeknight (Monday - Friday) around 12:00 PM noon
418-
### JDK11 tests against 3.11, 4.1, 5.0-beta1 and DSE 6.8
419-
H 12 * * 1-5 %CI_SCHEDULE=WEEKNIGHTS;CI_SCHEDULE_SERVER_VERSIONS=3.11 4.1 5.0-beta1 dse-6.8.30;[email protected]
420-
### JDK17 tests against 3.11, 4.1, 5.0-beta1 and DSE 6.8
421-
H 12 * * 1-5 %CI_SCHEDULE=WEEKNIGHTS;CI_SCHEDULE_SERVER_VERSIONS=3.11 4.1 5.0-beta1 dse-6.8.30;[email protected]
424+
H 12 * * 1-5 %CI_SCHEDULE=WEEKNIGHTS;CI_SCHEDULE_SERVER_VERSIONS=4.1 5.0 dse-6.8.30 dse-6.9.0 hcd-1.0.0;[email protected]
425+
H 12 * * 1-5 %CI_SCHEDULE=WEEKNIGHTS;CI_SCHEDULE_SERVER_VERSIONS=4.1 5.0 dse-6.8.30 dse-6.9.0 hcd-1.0.0;[email protected]
422426
""" : "")
423427
}
424428

@@ -452,9 +456,11 @@ pipeline {
452456
axes {
453457
axis {
454458
name 'SERVER_VERSION'
455-
values '3.11', // Latest stable Apache CassandraⓇ
456-
'4.1', // Development Apache CassandraⓇ
457-
'dse-6.8.30' // Current DataStax Enterprise
459+
values '4.0', // Previous Apache CassandraⓇ
460+
'5.0', // Current Apache CassandraⓇ
461+
'dse-6.8.30', // Current DataStax Enterprise
462+
'dse-6.9.0', // Current DataStax Enterprise
463+
'hcd-1.0.0' // Current DataStax HCD
458464
}
459465
axis {
460466
name 'JABBA_VERSION'
@@ -560,18 +566,17 @@ pipeline {
560566
axes {
561567
axis {
562568
name 'SERVER_VERSION'
563-
values '2.1', // Legacy Apache CassandraⓇ
564-
'3.0', // Previous Apache CassandraⓇ
565-
'3.11', // Previous Apache CassandraⓇ
566-
'4.0', // Previous Apache CassandraⓇ
567-
'4.1', // Current Apache CassandraⓇ
568-
'5.0-beta1', // Development Apache CassandraⓇ
569+
values '4.0', // Previous Apache CassandraⓇ
570+
'4.1', // Previous Apache CassandraⓇ
571+
'5.0', // Current Apache CassandraⓇ
569572
'dse-4.8.16', // Previous EOSL DataStax Enterprise
570573
'dse-5.0.15', // Last EOSL DataStax Enterprise
571574
'dse-5.1.35', // Legacy DataStax Enterprise
572575
'dse-6.0.18', // Previous DataStax Enterprise
573576
'dse-6.7.17', // Previous DataStax Enterprise
574-
'dse-6.8.30' // Current DataStax Enterprise
577+
'dse-6.8.30', // Current DataStax Enterprise
578+
'dse-6.9.0', // Current DataStax Enterprise
579+
'hcd-1.0.0' // Current DataStax HCD
575580
}
576581
}
577582
when {

ci/create-user.sh

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/bin/bash
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
18+
################################
19+
#
20+
# Prep
21+
#
22+
################################
23+
24+
if [ "$1" == "-h" ]; then
25+
echo "$0 [-h] <username> <uid> <gid>"
26+
echo " this script is used internally by other scripts in the same directory to create a user with the running host user's same uid and gid"
27+
exit 1
28+
fi
29+
30+
# arguments
31+
username=$1
32+
uid=$2
33+
gid=$3
34+
BUILD_HOME=$4
35+
36+
################################
37+
#
38+
# Main
39+
#
40+
################################
41+
42+
# disable git directory ownership checks
43+
su ${username} -c "git config --global safe.directory '*'"
44+
45+
if grep "^ID=" /etc/os-release | grep -q 'debian\|ubuntu' ; then
46+
deluser docker
47+
adduser --quiet --disabled-login --no-create-home --uid $uid --gecos ${username} ${username}
48+
groupmod --non-unique -g $gid $username
49+
gpasswd -a ${username} sudo >/dev/null
50+
else
51+
adduser --no-create-home --uid $uid ${username}
52+
fi
53+
54+
# sudo priviledges
55+
echo "${username} ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/${username}
56+
chmod 0440 /etc/sudoers.d/${username}
57+
58+
# proper permissions
59+
chown -R ${username}:${username} /home/docker
60+
chmod og+wx ${BUILD_HOME}

ci/run-tests.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash -x
2+
3+
. ~/.jabba/jabba.sh
4+
. ~/env.txt
5+
cd $(dirname "$(readlink -f "$0")")/..
6+
printenv | sort
7+
mvn -B -V install -DskipTests -Dmaven.javadoc.skip=true
8+
jabba use ${TEST_JAVA_VERSION}
9+
# Find out the latest patch version of Cassandra
10+
PATCH_SERVER_VERSION=$(curl -s https://downloads.apache.org/cassandra/ | grep -oP '(?<=href=\")[0-9]+\.[0-9]+\.[0-9]+(?=)' | sort -rV | uniq -w 3 | grep $SERVER_VERSION)
11+
printenv | sort
12+
mvn -B -V verify -T 1 -Ptest-jdk-${TEST_JAVA_MAJOR_VERSION} -DtestJavaHome=$(jabba which ${TEST_JAVA_VERSION}) -Dccm.version=${PATCH_SERVER_VERSION} -Dccm.dse=false -Dmaven.test.failure.ignore=true -Dmaven.javadoc.skip=true

0 commit comments

Comments
 (0)