Skip to content

Commit 5471bb1

Browse files
authored
chore(bigtable): migrate java-bigtable to monorepo (#12986)
Using script from here: #12962.
2 parents ddef7d2 + 441214e commit 5471bb1

1,209 files changed

Lines changed: 589114 additions & 2 deletions

File tree

Some content is hidden

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

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515
/java-storage/ @googleapis/gcs-team @googleapis/cloud-sdk-java-team
1616
/java-storage-nio/ @googleapis/gcs-team @googleapis/cloud-sdk-java-team
1717
/java-pubsub/ @googleapis/pubsub-team @googleapis/cloud-sdk-java-team
18+
/java-bigtable/ @googleapis/bigtable-team @googleapis/cloud-sdk-java-team

.github/workflows/ci.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ jobs:
3636
with:
3737
filters: |
3838
src:
39-
- '!(google-auth-library-java|java-bigquery|java-bigquerystorage|java-datastore|java-logging|java-logging-logback|java-pubsub|java-spanner|java-storage)/**/*.java'
40-
- '!(google-auth-library-java|java-bigquery|java-bigquerystorage|java-datastore|java-logging|java-logging-logback|java-pubsub|java-spanner|java-storage)/**/pom.xml'
39+
- '!(google-auth-library-java|java-bigquery|java-bigquerystorage|java-bigtable|java-datastore|java-logging|java-logging-logback|java-pubsub|java-spanner|java-storage)/**/*.java'
40+
- '!(google-auth-library-java|java-bigquery|java-bigquerystorage|java-bigtable|java-datastore|java-logging|java-logging-logback|java-pubsub|java-spanner|java-storage)/**/pom.xml'
4141
- 'pom.xml'
4242
ci:
4343
- '.github/workflows/ci.yaml'
@@ -178,6 +178,13 @@ jobs:
178178
- 'sdk-platform-java/**/*.java'
179179
- 'sdk-platform-java/java-shared-dependencies/**/pom.xml'
180180
- 'sdk-platform-java/gapic-generator-java-pom-parent/pom.xml'
181+
java-bigtable:
182+
- 'java-bigtable/**'
183+
- 'google-auth-library-java/**/*.java'
184+
- 'google-auth-library-java/**/pom.xml'
185+
- 'sdk-platform-java/**/*.java'
186+
- 'sdk-platform-java/java-shared-dependencies/**/pom.xml'
187+
- 'sdk-platform-java/gapic-generator-java-pom-parent/pom.xml'
181188
split-units:
182189
runs-on: ubuntu-latest
183190
needs: changes
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
# Copyright 2022 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
# Github action job to test core java library features on
15+
# downstream client libraries before they are released.
16+
on:
17+
push:
18+
branches:
19+
- main
20+
pull_request:
21+
name: java-bigtable ci
22+
env:
23+
BUILD_SUBDIR: java-bigtable
24+
jobs:
25+
filter:
26+
runs-on: ubuntu-latest
27+
outputs:
28+
library: ${{ steps.filter.outputs.library }}
29+
steps:
30+
- uses: actions/checkout@v4
31+
- uses: dorny/paths-filter@v3
32+
id: filter
33+
with:
34+
filters: |
35+
library:
36+
- 'java-bigtable/**'
37+
units:
38+
needs: filter
39+
if: ${{ needs.filter.outputs.library == 'true' }}
40+
runs-on: ubuntu-latest
41+
strategy:
42+
fail-fast: false
43+
matrix:
44+
java: [11, 17, 21, 25]
45+
steps:
46+
- uses: actions/checkout@v4
47+
- uses: actions/setup-java@v4
48+
with:
49+
distribution: temurin
50+
java-version: ${{matrix.java}}
51+
- run: java -version
52+
- run: .kokoro/build.sh
53+
env:
54+
JOB_TYPE: test
55+
units-java8:
56+
needs: filter
57+
if: ${{ needs.filter.outputs.library == 'true' }}
58+
# Building using Java 17 and run the tests with Java 8 runtime
59+
name: "units (8)"
60+
runs-on: ubuntu-latest
61+
steps:
62+
- uses: actions/checkout@v4
63+
- uses: actions/setup-java@v4
64+
with:
65+
java-version: 11
66+
distribution: temurin
67+
- name: "Set jvm system property environment variable for surefire plugin (unit tests)"
68+
# Maven surefire plugin (unit tests) allows us to specify JVM to run the tests.
69+
# https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jvm
70+
run: echo "SUREFIRE_JVM_OPT=-Djvm=${JAVA_HOME}/bin/java -P !java17" >> $GITHUB_ENV
71+
shell: bash
72+
- uses: actions/setup-java@v4
73+
with:
74+
java-version: 17
75+
distribution: temurin
76+
- run: .kokoro/build.sh
77+
env:
78+
JOB_TYPE: test
79+
windows:
80+
needs: filter
81+
if: ${{ needs.filter.outputs.library == 'true' }}
82+
runs-on: windows-latest
83+
steps:
84+
- name: Support longpaths
85+
run: git config --system core.longpaths true
86+
- uses: actions/checkout@v4
87+
- uses: actions/setup-java@v4
88+
with:
89+
distribution: temurin
90+
java-version: 11
91+
- run: java -version
92+
- run: .kokoro/build.sh
93+
env:
94+
JOB_TYPE: test
95+
dependencies:
96+
needs: filter
97+
if: ${{ needs.filter.outputs.library == 'true' }}
98+
runs-on: ubuntu-latest
99+
strategy:
100+
matrix:
101+
java: [17]
102+
steps:
103+
- uses: actions/checkout@v4
104+
- uses: actions/setup-java@v4
105+
with:
106+
distribution: temurin
107+
java-version: ${{matrix.java}}
108+
- run: java -version
109+
- run: .kokoro/dependencies.sh
110+
javadoc:
111+
needs: filter
112+
if: ${{ needs.filter.outputs.library == 'true' }}
113+
runs-on: ubuntu-latest
114+
steps:
115+
- uses: actions/checkout@v4
116+
- uses: actions/setup-java@v4
117+
with:
118+
distribution: temurin
119+
java-version: 17
120+
- run: java -version
121+
- run: .kokoro/build.sh
122+
env:
123+
JOB_TYPE: javadoc
124+
lint:
125+
needs: filter
126+
if: ${{ needs.filter.outputs.library == 'true' }}
127+
runs-on: ubuntu-latest
128+
steps:
129+
- uses: actions/checkout@v4
130+
with:
131+
fetch-depth: 0
132+
- uses: actions/setup-java@v4
133+
with:
134+
distribution: temurin
135+
java-version: 17
136+
- run: java -version
137+
- run: .kokoro/build.sh
138+
env:
139+
JOB_TYPE: lint
140+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
141+
BASE_SHA: ${{ github.event.pull_request.base.sha }}
142+
clirr:
143+
needs: filter
144+
if: ${{ needs.filter.outputs.library == 'true' }}
145+
runs-on: ubuntu-latest
146+
steps:
147+
- uses: actions/checkout@v4
148+
- uses: actions/setup-java@v4
149+
with:
150+
distribution: temurin
151+
java-version: 11
152+
- run: java -version
153+
- run: .kokoro/build.sh
154+
env:
155+
JOB_TYPE: clirr
156+
BUILD_SUBDIR: java-bigtable
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Copyright 2023 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
# Github action job to test core java library features on
15+
# downstream client libraries before they are released.
16+
on:
17+
push:
18+
branches:
19+
- main
20+
pull_request:
21+
name: java-bigtable conformance
22+
env:
23+
BUILD_SUBDIR: java-bigtable
24+
jobs:
25+
filter:
26+
runs-on: ubuntu-latest
27+
outputs:
28+
library: ${{ steps.filter.outputs.library }}
29+
steps:
30+
- uses: actions/checkout@v4
31+
- uses: dorny/paths-filter@v3
32+
id: filter
33+
with:
34+
filters: |
35+
library:
36+
- 'java-bigtable/**'
37+
conformance:
38+
needs: filter
39+
if: ${{ needs.filter.outputs.library == 'true' }}
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v4
43+
- uses: actions/checkout@v4
44+
with:
45+
repository: googleapis/cloud-bigtable-clients-test
46+
ref: main
47+
path: cloud-bigtable-clients-test
48+
- uses: actions/setup-java@v4
49+
with:
50+
distribution: zulu
51+
java-version: 11
52+
- uses: actions/setup-go@v5
53+
with:
54+
go-version: '>=1.20.2'
55+
- run: java -version
56+
- run: go version
57+
- run: .kokoro/bigtable-conformance.sh

.kokoro/bigtable-conformance.sh

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
#!/bin/bash
2+
# Copyright 2023 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
set -eo pipefail
17+
18+
## Get the directory of the build script
19+
scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}"))
20+
## cd to the parent directory, i.e. the root of the git repo
21+
cd ${scriptDir}/..
22+
23+
# include common functions
24+
source ${scriptDir}/common.sh
25+
26+
# Print out Maven & Java version
27+
mvn -version
28+
echo ${JOB_TYPE}
29+
30+
echo "Installing toolchain and external prerequisites recursively using monorepo install_modules..."
31+
install_modules "java-monitoring/google-cloud-monitoring-bom,java-monitoring/google-cloud-monitoring"
32+
33+
pushd java-bigtable
34+
# attempt to install 3 times with exponential backoff (starting with 10 seconds)
35+
retry_with_backoff 3 10 \
36+
mvn install -U -B -V -ntp \
37+
-DskipTests=true \
38+
-Dclirr.skip=true \
39+
-Denforcer.skip=true \
40+
-Dmaven.javadoc.skip=true \
41+
-Dgcloud.download.skip=true \
42+
-T 1C
43+
popd
44+
45+
RETURN_CODE=0
46+
set +e
47+
48+
# Build the proxy
49+
pushd .
50+
cd java-bigtable/test-proxy
51+
mvn clean install -U -DskipTests
52+
popd
53+
54+
declare -a configs=("default" "enable_all")
55+
for config in "${configs[@]}"
56+
do
57+
# Start the proxy in a separate process
58+
nohup java -Dport=9999 -jar java-bigtable/test-proxy/target/google-cloud-bigtable-test-proxy-0.0.1-SNAPSHOT.jar &
59+
proxyPID=$!
60+
61+
# Run the conformance test
62+
if [[ ${config} = "enable_all" ]]
63+
then
64+
echo "Testing the client with all optional features enabled..."
65+
configFlag="--enable_features_all"
66+
else
67+
echo "Testing the client with default settings for optional features..."
68+
# skipping routing cookie and retry info tests. When the feature is disabled, these
69+
# tests are expected to fail
70+
configFlag="-skip _Retry_WithRoutingCookie\|_Retry_WithRetryInfo"
71+
fi
72+
73+
pushd .
74+
cd cloud-bigtable-clients-test/tests
75+
eval "go test -v -proxy_addr=:9999 ${configFlag} -skip '`cat ../../java-bigtable/test-proxy/known_failures.txt`'"
76+
returnCode=$?
77+
popd
78+
79+
# Stop the proxy
80+
kill ${proxyPID} && sleep 5
81+
82+
if [[ ${returnCode} -gt 0 ]]
83+
then
84+
echo "Conformance test failed for config: ${config}"
85+
RETURN_CODE=${returnCode}
86+
else
87+
echo "Conformance test passed for config: ${config}"
88+
fi
89+
done
90+
91+
# fix output location of logs
92+
bash .kokoro/coerce_logs.sh
93+
94+
exit ${RETURN_CODE}

.kokoro/build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ case ${JOB_TYPE} in
263263
[[ "$(basename "${dir}")" != "dependency-analyzer" ]] && \
264264
[[ "$(basename "${dir}")" != "dependency-convergence-check" ]] && \
265265
[[ "$(basename "${dir}")" != "unmanaged-dependency-check" ]] && \
266+
[[ "$(basename "${dir}")" != *"test-proxy"* ]] && \
266267
[[ "$(basename "${dir}")" != "google-cloud-jar-parent" ]]; then
267268

268269
changed_modules+=("${dir}")

.kokoro/common.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ excluded_modules=(
3636
'google-auth-library-java/oauth2_http'
3737
'java-storage'
3838
'java-storage-nio'
39+
'java-bigtable'
3940
'java-pubsub'
4041
)
4142

@@ -407,6 +408,8 @@ function install_modules() {
407408
printf "Installing submodules:\n%s\n" "$all_submodules"
408409

409410
always_install_deps_list=(
411+
'java-monitoring/google-cloud-monitoring'
412+
'java-monitoring/google-cloud-monitoring-bom'
410413
'google-auth-library-java/appengine'
411414
'google-auth-library-java/bom'
412415
'google-auth-library-java/cab-token-generator'

0 commit comments

Comments
 (0)