Skip to content

Commit 54e215d

Browse files
---
yaml --- r: 8255 b: refs/heads/master c: 1ed22fa h: refs/heads/master i: 8253: 824ecfd 8251: f033397 8247: a335894 8239: c6d7983 8223: cc35eec 8191: 8fe6b6e
1 parent 8097740 commit 54e215d

4 files changed

Lines changed: 84 additions & 5 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 4484c073e6ac3248c6e6eb7f71c37f1261132da4
2+
refs/heads/master: 1ed22fab31b5812f04e32295b3ce8afa25136fef
33
refs/heads/travis: 47e4fee4fd5af9b2a8ce46f23c72ec95f9b195b2
44
refs/heads/gh-pages: 0114589947fea527ea3831330789accedbecf45c
55
refs/tags/0.0.9: 22f1839238f66c39e67ed4dfdcd273b1ae2e8444

trunk/google-cloud-util/google-cloud-compat-checker/README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,19 @@ OS details:
2323
os.detected.classifier: linux-x86_64
2424
os.detected.release: ubuntu
2525
os.detected.release.version: 14.04
26+
JVM details:
27+
Java version: 1.8.0_144-b01
28+
Java specification version: 1.8
29+
JVM bit mode: 64
30+
OpenSSL details:
31+
open ssl is available: true
32+
ALPN is supported: true
2633
Checking compatibility...
27-
This OS + architecture is supported by Forked Tomcat Native.
34+
[PASS] This OS + architecture is supported.
35+
[PASS] 64-bit JVM is supported.
36+
[PASS] Open SSL is available
37+
[PASS] Open SSL ALPN is supported
2838
Result: UNKNOWN (checker implementation not complete)
39+
Based on what was checked, nothing was identified that would
40+
prevent you from using grpc-based APIs.
2941
```

trunk/google-cloud-util/google-cloud-compat-checker/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@
3636
<groupId>org.codehaus.plexus</groupId>
3737
<artifactId>plexus-utils</artifactId>
3838
</dependency>
39+
<dependency>
40+
<groupId>io.netty</groupId>
41+
<artifactId>netty-handler</artifactId>
42+
<version>4.1.11.Final</version>
43+
</dependency>
3944
</dependencies>
4045
<dependencyManagement>
4146
<dependencies>

trunk/google-cloud-util/google-cloud-compat-checker/src/main/java/com/google/cloud/compatchecker/GoogleCloudCompatChecker.java

Lines changed: 65 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import com.google.common.collect.ImmutableSet;
1919
import com.google.common.collect.Lists;
20+
import io.netty.handler.ssl.OpenSsl;
2021
import java.util.List;
2122
import java.util.Properties;
2223
import java.util.Set;
@@ -43,30 +44,91 @@ protected void logProperty(String s, String s1) {
4344
}
4445

4546
public static void main(String[] args) {
47+
if (!check()) {
48+
System.exit(1);
49+
}
50+
}
51+
52+
public static boolean check() {
4653
Properties osProperties = new Properties();
4754
new OsDetector().detect(osProperties, Lists.<String>newArrayList());
55+
56+
String bitMode = System.getProperty("sun.arch.data.model");
57+
58+
boolean openSslIsAvailable = OpenSsl.isAvailable();
59+
boolean openSslAlpnIsSupported = OpenSsl.isAlpnSupported();
60+
String javaVersion = Runtime.class.getPackage().getImplementationVersion();
61+
String javaSpecificationVersion = System.getProperty("java.specification.version");
62+
4863
System.out.println("OS details:");
4964
System.out.println(" " + Detector.DETECTED_NAME + ": " + osProperties.get(Detector.DETECTED_NAME));
5065
System.out.println(" " + Detector.DETECTED_ARCH + ": " + osProperties.get(Detector.DETECTED_ARCH));
5166
System.out.println(" " + Detector.DETECTED_CLASSIFIER + ": " + osProperties.get(Detector.DETECTED_CLASSIFIER));
5267
System.out.println(" " + Detector.DETECTED_RELEASE + ": " + osProperties.get(Detector.DETECTED_RELEASE));
5368
System.out.println(" " + Detector.DETECTED_RELEASE_VERSION + ": " + osProperties.get(Detector.DETECTED_RELEASE_VERSION));
69+
System.out.println("JVM details:");
70+
System.out.println(" Java version: " + javaVersion);
71+
System.out.println(" Java specification version: " + javaSpecificationVersion);
72+
System.out.println(" JVM bit mode: " + bitMode);
73+
System.out.println("OpenSSL details:");
74+
System.out.println(" open ssl is available: " + openSslIsAvailable);
75+
System.out.println(" ALPN is supported: " + openSslAlpnIsSupported);
5476

5577
String osClassifier = (String)osProperties.get(Detector.DETECTED_CLASSIFIER);
5678

5779
boolean compatible = true;
80+
boolean warnings = false;
5881
System.out.println("Checking compatibility...");
5982
if (supportedClassifiers.contains(osClassifier)) {
60-
System.out.println(" This OS + architecture is supported by Forked Tomcat Native.");
83+
System.out.println(" [PASS] This OS + architecture is supported.");
6184
} else {
62-
System.out.println(" This OS + architecture is NOT supported by Forked Tomcat Native.");
63-
System.out.println(" See http://netty.io/wiki/forked-tomcat-native.html for details.");
85+
System.out.println(" [FAIL] This OS + architecture is NOT supported.");
86+
compatible = false;
87+
}
88+
if (bitMode.equals("64")) {
89+
System.out.println(" [PASS] 64-bit JVM is supported.");
90+
} else {
91+
System.out.println(" [FAIL] " + bitMode + "-bit JVM is NOT supported.");
6492
compatible = false;
6593
}
94+
if (openSslIsAvailable) {
95+
System.out.println(" [PASS] Open SSL is available");
96+
} else {
97+
System.out.println(" [FAIL] Open SSL is NOT available");
98+
if (OpenSsl.unavailabilityCause() != null) {
99+
System.out.println(" Open SSL Unavailability cause:");
100+
OpenSsl.unavailabilityCause().printStackTrace(System.out);
101+
}
102+
compatible = false;
103+
}
104+
if (openSslAlpnIsSupported) {
105+
System.out.println(" [PASS] Open SSL ALPN is supported");
106+
} else {
107+
System.out.println(" [FAIL] Open SSL ALPN is NOT supported");
108+
compatible = false;
109+
}
110+
if (javaSpecificationVersion == null) {
111+
System.out.println(" [WARN] Couldn't detect java specification version.");
112+
warnings = true;
113+
} else if (javaSpecificationVersion.equals("1.7")) {
114+
System.out.println(" [WARN] gRPC doesn't work on Google App Engine Standard under Java 1.7");
115+
warnings = true;
116+
}
66117
if (!compatible) {
67118
System.out.println("Result: FAIL");
119+
System.out.println(" Your environment is not supported by Forked Tomcat Native.");
120+
System.out.println(" See http://netty.io/wiki/forked-tomcat-native.html for details.");
121+
System.out.println(" This means that you won't be able to use grpc-based APIs, but");
122+
System.out.println(" http1-based APIs should still work.");
68123
} else {
69124
System.out.println("Result: UNKNOWN (checker implementation not complete)");
125+
System.out.println(" Based on what was checked, nothing was identified that would");
126+
System.out.println(" prevent you from using grpc-based APIs.");
127+
if (warnings) {
128+
System.out.println(" However, there were some warnings to watch out for.");
129+
}
70130
}
131+
132+
return compatible;
71133
}
72134
}

0 commit comments

Comments
 (0)