Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: update profiles for DirectPath & traffic director #1974

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,20 @@ If you are using Maven without the BOM, add this to your dependencies:
If you are using Gradle 5.x or later, add this to your dependencies:

```Groovy
implementation platform('com.google.cloud:libraries-bom:26.24.0')
implementation platform('com.google.cloud:libraries-bom:26.25.0')

implementation 'com.google.cloud:google-cloud-bigtable'
```
If you are using Gradle without BOM, add this to your dependencies:

```Groovy
implementation 'com.google.cloud:google-cloud-bigtable:2.27.4'
implementation 'com.google.cloud:google-cloud-bigtable:2.28.0'
```

If you are using SBT, add this to your dependencies:

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-bigtable" % "2.27.4"
libraryDependencies += "com.google.cloud" % "google-cloud-bigtable" % "2.28.0"
```
<!-- {x-version-update-end} -->

Expand Down Expand Up @@ -609,7 +609,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigtable/java11.html
[stability-image]: https://img.shields.io/badge/stability-stable-green
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigtable.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigtable/2.27.4
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigtable/2.28.0
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
Expand Down
38 changes: 38 additions & 0 deletions google-cloud-bigtable/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<reuseForks>false</reuseForks>
<forkCount>1</forkCount>
<parallel>none</parallel>
</configuration>
Expand Down Expand Up @@ -556,6 +557,43 @@
</build>
</profile>

<profile>
<id>bigtable-traffic-director-cfe-it</id>
<build>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<id>traffic-director-cfe-it</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<skip>false</skip>

<systemPropertyVariables>
<bigtable.env>cloud</bigtable.env>
<bigtable.data-endpoint>${bigtable.cfe-data-endpoint}</bigtable.data-endpoint>
<bigtable.admin-endpoint>${bigtable.cfe-admin-endpoint}</bigtable.admin-endpoint>
<bigtable.enable-grpc-logs>${bigtable.enable-grpc-logs}</bigtable.enable-grpc-logs>
<bigtable.grpc-log-dir>${project.build.directory}/test-grpc-logs/traffic-director-cfe-it</bigtable.grpc-log-dir>
<bigtable.connection-mode>REQUIRE_TRAFFIC_DIRECTOR_CFE</bigtable.connection-mode>
</systemPropertyVariables>
<includes>
<include>com.google.cloud.bigtable.**.it.*IT</include>
</includes>
<summaryFile>${project.build.directory}/failsafe-reports/failsafe-summary-traffic-director-cfe-it.xml</summaryFile>
<reportsDirectory>${project.build.directory}/failsafe-reports/traffic-director-cfe-it</reportsDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>


<profile>
<id>bigtable-directpath-ipv4only-it</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public abstract class AbstractTestEnv {
public enum ConnectionMode {
DEFAULT,
REQUIRE_CFE,
REQUIRE_TRAFFIC_DIRECTOR_CFE,
REQUIRE_DIRECT_PATH,
REQUIRE_DIRECT_PATH_IPV4
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ private CloudEnv(

setupRemoteAddrInterceptor(dataSettings.stubSettings());
configureUserAgent(dataSettings.stubSettings());
configureDirectPath(dataSettings.stubSettings());

this.tableAdminSettings =
BigtableTableAdminSettings.newBuilder().setProjectId(projectId).setInstanceId(instanceId);
Expand Down Expand Up @@ -159,6 +160,7 @@ private void setupRemoteAddrInterceptor(StubSettings.Builder stubSettings) {
buildRemoteAddrInterceptor("DirectPath IPv4", Predicates.or(DIRECT_PATH_IPV4_MATCHER));
break;
case REQUIRE_CFE:
case REQUIRE_TRAFFIC_DIRECTOR_CFE:
interceptor =
buildRemoteAddrInterceptor(
"a CFE ip",
Expand Down Expand Up @@ -239,6 +241,7 @@ private void configureUserAgent(EnhancedBigtableStubSettings.Builder stubSetting
// nothing special
break;
case REQUIRE_CFE:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to confirm, is this expected to change the settings for the REQUIRE_CFE case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

case REQUIRE_TRAFFIC_DIRECTOR_CFE:
parts.add("bigtable-directpath-disable");
break;
case REQUIRE_DIRECT_PATH:
Expand All @@ -265,6 +268,29 @@ private void configureUserAgent(EnhancedBigtableStubSettings.Builder stubSetting
stubSettings.setHeaderProvider(FixedHeaderProvider.create(newHeaders));
}

private void configureDirectPath(EnhancedBigtableStubSettings.Builder stubSettings) {
InstantiatingGrpcChannelProvider transportChannelProvider =
(InstantiatingGrpcChannelProvider) stubSettings.getTransportChannelProvider();

switch (getConnectionMode()) {
case REQUIRE_DIRECT_PATH:
case REQUIRE_DIRECT_PATH_IPV4:
case REQUIRE_TRAFFIC_DIRECTOR_CFE:
transportChannelProvider =
transportChannelProvider
.toBuilder()
.setAttemptDirectPath(true)
.setAttemptDirectPathXds()
.build();
break;
case DEFAULT:
case REQUIRE_CFE:
default:
// noop
}
stubSettings.setTransportChannelProvider(transportChannelProvider);
}

@Override
void start() throws IOException {
dataClient = BigtableDataClient.create(dataSettings.build());
Expand Down