335 if (jvmciCompiler == null || !jvmciCompiler.equals("graal")) { 336 return "false"; 337 } 338 339 Boolean tieredCompilation = WB.getBooleanVMFlag("TieredCompilation"); 340 Long compLevel = WB.getIntxVMFlag("TieredStopAtLevel"); 341 // if TieredCompilation is enabled and compilation level is <= 3 then no Graal is used 342 if (tieredCompilation != null && tieredCompilation && compLevel != null && compLevel <= 3) 343 return "false"; 344 345 return "true"; 346 } 347 348 349 /** 350 * A simple check for docker support 351 * 352 * @return true if docker is supported in a given environment 353 */ 354 protected String dockerSupport() { 355 // currently docker testing is only supported for Linux-x64 and Linux-ppc64le 356 String arch = System.getProperty("os.arch"); 357 if (! (Platform.isLinux() && (Platform.isX64() || arch.equals("ppc64le")))) { 358 return "false"; 359 } 360 361 boolean isSupported; 362 try { 363 isSupported = checkDockerSupport(); 364 } catch (Exception e) { 365 isSupported = false; 366 } 367 368 return (isSupported) ? "true" : "false"; 369 } 370 371 private boolean checkDockerSupport() throws IOException, InterruptedException { 372 ProcessBuilder pb = new ProcessBuilder("docker", "ps"); 373 Process p = pb.start(); 374 p.waitFor(10, TimeUnit.SECONDS); 375 376 return (p.exitValue() == 0); 377 } 378 379 380 381 /** 382 * Dumps the map to the file if the file name is given as the property. 383 * This functionality could be helpful to know context in the real 384 * execution. 385 * | 335 if (jvmciCompiler == null || !jvmciCompiler.equals("graal")) { 336 return "false"; 337 } 338 339 Boolean tieredCompilation = WB.getBooleanVMFlag("TieredCompilation"); 340 Long compLevel = WB.getIntxVMFlag("TieredStopAtLevel"); 341 // if TieredCompilation is enabled and compilation level is <= 3 then no Graal is used 342 if (tieredCompilation != null && tieredCompilation && compLevel != null && compLevel <= 3) 343 return "false"; 344 345 return "true"; 346 } 347 348 349 /** 350 * A simple check for docker support 351 * 352 * @return true if docker is supported in a given environment 353 */ 354 protected String dockerSupport() { 355 boolean isSupported = false; 356 if (Platform.isLinux()) { 357 // currently docker testing is only supported for Linux, 358 // on x64, AArch64 and ppc64le platforms 359 360 String arch = System.getProperty("os.arch"); 361 362 if (Platform.isX64()) { 363 isSupported = true; 364 } 365 else if (Platform.isAArch64()) { 366 isSupported = true; 367 } 368 else if (arch.equals("ppc64le")) { 369 isSupported = true; 370 } 371 } 372 373 if (isSupported) { 374 try { 375 isSupported = checkDockerSupport(); 376 } catch (Exception e) { 377 isSupported = false; 378 } 379 } 380 381 return (isSupported) ? "true" : "false"; 382 } 383 384 private boolean checkDockerSupport() throws IOException, InterruptedException { 385 ProcessBuilder pb = new ProcessBuilder("docker", "ps"); 386 Process p = pb.start(); 387 p.waitFor(10, TimeUnit.SECONDS); 388 389 return (p.exitValue() == 0); 390 } 391 392 393 394 /** 395 * Dumps the map to the file if the file name is given as the property. 396 * This functionality could be helpful to know context in the real 397 * execution. 398 * |