mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 00:29:38 +08:00
[JavaWorker] Java code lint check and binding to CI (#2225)
* add java code lint check and fix the java code lint error * add java doc lint check and fix the java doc lint error * add java code and doc lint to the CI
This commit is contained in:
committed by
Philipp Moritz
parent
5789a247f9
commit
3b5e700fd7
+87
-87
@@ -1,102 +1,102 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<parent>
|
||||
<groupId>org.ray.parent</groupId>
|
||||
<artifactId>ray-superpom</artifactId>
|
||||
<version>1.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<parent>
|
||||
<groupId>org.ray.parent</groupId>
|
||||
<artifactId>ray-superpom</artifactId>
|
||||
<version>1.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-example</artifactId>
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-example</artifactId>
|
||||
|
||||
<name>java example for ray</name>
|
||||
<description>java example for ray</description>
|
||||
<url></url>
|
||||
<name>java example for ray</name>
|
||||
<description>java example for ray</description>
|
||||
<url></url>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-api</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-api</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-runtime-common</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-runtime-common</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-runtime-native</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-runtime-native</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-runtime-dev</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-runtime-dev</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-common</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-common</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-hook</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.20.1</version>
|
||||
<configuration>
|
||||
<environmentVariables>
|
||||
<RAY_CONFIG>${basedir}/../ray.config.ini</RAY_CONFIG>
|
||||
</environmentVariables>
|
||||
<argLine>-ea
|
||||
-Djava.library.path=${basedir}/../../build/src/plasma:${basedir}/../../build/src/local_scheduler
|
||||
-noverify
|
||||
-DlogOutput=console
|
||||
</argLine>
|
||||
<testSourceDirectory>${basedir}/src/main/java/</testSourceDirectory>
|
||||
<testClassesDirectory>${project.build.directory}/classes/</testClassesDirectory>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<dependency>
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-hook</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.20.1</version>
|
||||
<configuration>
|
||||
<environmentVariables>
|
||||
<RAY_CONFIG>${basedir}/../ray.config.ini</RAY_CONFIG>
|
||||
</environmentVariables>
|
||||
<argLine>-ea
|
||||
-Djava.library.path=${basedir}/../../build/src/plasma:${basedir}/../../build/src/local_scheduler
|
||||
-noverify
|
||||
-DlogOutput=console
|
||||
</argLine>
|
||||
<testSourceDirectory>${basedir}/src/main/java/</testSourceDirectory>
|
||||
<testClassesDirectory>${project.build.directory}/classes/</testClassesDirectory>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-dependencies</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${basedir}/lib</outputDirectory>
|
||||
<overWriteReleases>false</overWriteReleases>
|
||||
<overWriteSnapshots>false</overWriteSnapshots>
|
||||
<overWriteIfNewer>true</overWriteIfNewer>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-dependencies</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${basedir}/lib</outputDirectory>
|
||||
<overWriteReleases>false</overWriteReleases>
|
||||
<overWriteSnapshots>false</overWriteSnapshots>
|
||||
<overWriteIfNewer>true</overWriteIfNewer>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -1,21 +1,14 @@
|
||||
package org.ray.example;
|
||||
|
||||
import java.io.Serializable;
|
||||
import org.ray.api.Ray;
|
||||
import org.ray.api.RayObject;
|
||||
import org.ray.api.RayRemote;
|
||||
import org.ray.core.RayRuntime;
|
||||
import org.ray.util.logger.RayLog;
|
||||
|
||||
import java.io.Serializable;
|
||||
public class HelloWorld implements Serializable {
|
||||
|
||||
public class HelloWorld implements Serializable{
|
||||
|
||||
|
||||
public static String sayHelloWorld() {
|
||||
RayObject<String> hello = Ray.call(HelloWorld::sayHello);
|
||||
RayObject<String> world = Ray.call(HelloWorld::sayWorld);
|
||||
return Ray.call(HelloWorld::merge, hello, world).get();
|
||||
}
|
||||
|
||||
@RayRemote
|
||||
public static String sayHello() {
|
||||
@@ -39,18 +32,22 @@ public class HelloWorld implements Serializable{
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
Ray.init();
|
||||
String helloWorld = HelloWorld.sayHelloWorld();
|
||||
RayLog.rapp.info(helloWorld);
|
||||
assert helloWorld.equals("hello,world!");
|
||||
}
|
||||
catch (Throwable t) {
|
||||
Ray.init();
|
||||
String helloWorld = HelloWorld.sayHelloWorld();
|
||||
RayLog.rapp.info(helloWorld);
|
||||
assert helloWorld.equals("hello,world!");
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
finally {
|
||||
} finally {
|
||||
RayRuntime.getInstance().cleanUp();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static String sayHelloWorld() {
|
||||
RayObject<String> hello = Ray.call(HelloWorld::sayHello);
|
||||
RayObject<String> world = Ray.call(HelloWorld::sayWorld);
|
||||
return Ray.call(HelloWorld::merge, hello, world).get();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user