mirror of
https://github.com/vale981/ray
synced 2025-03-05 10:01:43 -05:00
Remove deprecated module (#4038)
This commit is contained in:
parent
2de31eb489
commit
1fb56a4316
12 changed files with 1 additions and 418 deletions
|
@ -1,3 +1,3 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
mvn clean install -Dmaven.test.skip
|
||||
mvn clean install -Dmaven.test.skip
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
<assembly>
|
||||
<id>ear</id>
|
||||
<formats>
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
<dependencySets>
|
||||
<dependencySet>
|
||||
<useProjectArtifact>true</useProjectArtifact>
|
||||
<outputDirectory>lib</outputDirectory>
|
||||
</dependencySet>
|
||||
</dependencySets>
|
||||
<fileSets>
|
||||
|
||||
</fileSets>
|
||||
</assembly>
|
|
@ -1,90 +0,0 @@
|
|||
<?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</groupId>
|
||||
<artifactId>ray-superpom</artifactId>
|
||||
<version>0.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>ray-cli</artifactId>
|
||||
<name>java cli</name>
|
||||
<description>java cli for ray</description>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.ray</groupId>
|
||||
<artifactId>ray-runtime</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>de.ruedigermoeller</groupId>
|
||||
<artifactId>fst</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.davidmoten</groupId>
|
||||
<artifactId>flatbuffers-java</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>redis.clients</groupId>
|
||||
<artifactId>jedis</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.beust</groupId>
|
||||
<artifactId>jcommander</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>ray-cli</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<configuration>
|
||||
<descriptors>
|
||||
<descriptor>assembly.xml</descriptor>
|
||||
</descriptors>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>make-assembly</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
</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>
|
||||
</project>
|
|
@ -1,15 +0,0 @@
|
|||
package org.ray.cli;
|
||||
|
||||
import com.beust.jcommander.Parameter;
|
||||
import com.beust.jcommander.Parameters;
|
||||
|
||||
/**
|
||||
* Arguments for command start.
|
||||
*/
|
||||
@Parameters(separators = "= ", commandDescription = "start ray daemons")
|
||||
public class CommandStart {
|
||||
|
||||
@Parameter(names = "--head", description = "start the head node")
|
||||
public boolean head;
|
||||
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
package org.ray.cli;
|
||||
|
||||
import com.beust.jcommander.Parameters;
|
||||
|
||||
/**
|
||||
* Arguments for command stop.
|
||||
*/
|
||||
@Parameters(separators = "= ", commandDescription = "stop ray daemons")
|
||||
public class CommandStop {
|
||||
|
||||
}
|
|
@ -1,105 +0,0 @@
|
|||
package org.ray.cli;
|
||||
|
||||
import com.beust.jcommander.JCommander;
|
||||
import java.io.IOException;
|
||||
import org.ray.runtime.config.RayConfig;
|
||||
import org.ray.runtime.runner.RunManager;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
||||
/**
|
||||
* Ray command line interface.
|
||||
*/
|
||||
public class RayCli {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(RayCli.class);
|
||||
|
||||
private static RayCliArgs rayArgs = new RayCliArgs();
|
||||
|
||||
private static RunManager startRayHead() {
|
||||
RayConfig rayConfig = RayConfig.create();
|
||||
RunManager manager = new RunManager(rayConfig);
|
||||
try {
|
||||
manager.startRayProcesses(true);
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("Failed to start head node.", e);
|
||||
throw new RuntimeException("Failed to start Ray head node.", e);
|
||||
}
|
||||
LOGGER.info("Ray head node started. Redis address is {}", rayConfig.getRedisAddress());
|
||||
return manager;
|
||||
}
|
||||
|
||||
private static RunManager startRayNode() {
|
||||
RayConfig rayConfig = RayConfig.create();
|
||||
RunManager manager = new RunManager(rayConfig);
|
||||
try {
|
||||
manager.startRayProcesses(false);
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("Failed to start work node.", e);
|
||||
throw new RuntimeException("Failed to start work node.", e);
|
||||
}
|
||||
|
||||
LOGGER.info("Ray work node started.");
|
||||
return manager;
|
||||
}
|
||||
|
||||
private static RunManager startProcess(CommandStart cmdStart) {
|
||||
RunManager manager;
|
||||
if (cmdStart.head) {
|
||||
manager = startRayHead();
|
||||
} else {
|
||||
manager = startRayNode();
|
||||
}
|
||||
return manager;
|
||||
}
|
||||
|
||||
private static void start(CommandStart cmdStart) {
|
||||
startProcess(cmdStart);
|
||||
}
|
||||
|
||||
private static void stop(CommandStop cmdStop) {
|
||||
String[] cmd = {"/bin/sh", "-c", ""};
|
||||
cmd[2] = "kill $(ps aux | grep ray | grep -v grep | "
|
||||
+ "awk \'{ print $2 }\') 2> /dev/null";
|
||||
try {
|
||||
Runtime.getRuntime().exec(cmd);
|
||||
} catch (IOException e) {
|
||||
LOGGER.error("Exception in killing ray processes.", e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
CommandStart cmdStart = new CommandStart();
|
||||
CommandStop cmdStop = new CommandStop();
|
||||
JCommander rayCommander = JCommander.newBuilder().addObject(rayArgs)
|
||||
.addCommand("start", cmdStart)
|
||||
.addCommand("stop", cmdStop)
|
||||
.build();
|
||||
rayCommander.parse(args);
|
||||
|
||||
if (rayArgs.help) {
|
||||
rayCommander.usage();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
String cmd = rayCommander.getParsedCommand();
|
||||
if (cmd == null) {
|
||||
rayCommander.usage();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
switch (cmd) {
|
||||
case "start":
|
||||
start(cmdStart);
|
||||
break;
|
||||
case "stop":
|
||||
stop(cmdStop);
|
||||
break;
|
||||
default:
|
||||
rayCommander.usage();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package org.ray.cli;
|
||||
|
||||
import com.beust.jcommander.Parameter;
|
||||
|
||||
/**
|
||||
* Arguments for Ray cli.
|
||||
*/
|
||||
public class RayCliArgs {
|
||||
|
||||
@Parameter(names = {"-h", "-help", "--help"}, description = "print this usage", help = true)
|
||||
public boolean help;
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
function for_in_file(){
|
||||
if [ -f $1 ]; then
|
||||
echo "THIS IS THE NEXT TASKID HERE:\n" >> logfilter
|
||||
b="nextTaskId:"
|
||||
for i in `cat $1`
|
||||
do
|
||||
grep -r $i *|awk -v prefix=$b '/Task .+ Object .+ get/{print prefix$(6) >> "logfilter"}'
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
cd ./$1/
|
||||
if [ -f logfilter ]; then
|
||||
rm logfilter
|
||||
fi
|
||||
if [ -f tempobjectid ]; then
|
||||
rm tempobjectid
|
||||
fi
|
||||
grep -r "$2" * > logfilter
|
||||
cat logfilter|awk '/Task .+ Object .+ put/{print $(NF-1) > "tempobjectid"}'
|
||||
for_in_file tempobjectid
|
||||
cat logfilter
|
||||
|
||||
|
||||
|
|
@ -11,7 +11,6 @@
|
|||
<modules>
|
||||
<module>api</module>
|
||||
<module>runtime</module>
|
||||
<module>cli</module>
|
||||
<module>test</module>
|
||||
<module>tutorial</module>
|
||||
</modules>
|
||||
|
|
102
java/prepare.sh
102
java/prepare.sh
|
@ -1,102 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
function usage() {
|
||||
echo " -t|--target-dir <dir> local target directory for prepare a Ray cluster deployment package"
|
||||
echo " [-s|--source-dir] <dir> local source directory to prepare a Ray cluster deployment package"
|
||||
}
|
||||
|
||||
while [ $# -gt 0 ];do
|
||||
key=$1
|
||||
case $key in
|
||||
-h|--help)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
-s|--source-dir)
|
||||
ray_dir=$2
|
||||
shift 2
|
||||
;;
|
||||
-t|--target-dir)
|
||||
t_dir=$2
|
||||
shift 2
|
||||
;;
|
||||
*)
|
||||
echo "ERROR: unknown option $key"
|
||||
echo
|
||||
usage
|
||||
exit -1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
realpath() {
|
||||
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
|
||||
}
|
||||
|
||||
if [ -z $ray_dir ];then
|
||||
scripts_path=`realpath $0`
|
||||
ray_dir=`dirname $scripts_path`
|
||||
ray_dir=`dirname $ray_dir`
|
||||
fi
|
||||
|
||||
# echo "ray_dir = $ray_dir"
|
||||
|
||||
declare -a nativeBinaries=(
|
||||
"./src/ray/thirdparty/redis/src/redis-server"
|
||||
"./src/plasma/plasma_store_server"
|
||||
"./src/ray/raylet/raylet"
|
||||
"./src/ray/raylet/raylet_monitor"
|
||||
)
|
||||
|
||||
declare -a nativeLibraries=(
|
||||
"./src/ray/gcs/redis_module/libray_redis_module.so"
|
||||
"./src/ray/raylet/libraylet_library_java.*"
|
||||
"./src/plasma/libplasma_java.*"
|
||||
"./src/ray/raylet/*lib.a"
|
||||
)
|
||||
|
||||
declare -a javaBinaries=(
|
||||
"api"
|
||||
"common"
|
||||
"worker"
|
||||
"test"
|
||||
)
|
||||
|
||||
function prepare_source()
|
||||
{
|
||||
if [ -z $t_dir ];then
|
||||
echo "--target-dir not specified"
|
||||
usage
|
||||
exit -1
|
||||
fi
|
||||
|
||||
# prepare native components under /ray/native/bin
|
||||
mkdir -p $t_dir"/ray/native/bin/"
|
||||
for i in "${!nativeBinaries[@]}"
|
||||
do
|
||||
cp $ray_dir/build/${nativeBinaries[$i]} $t_dir/ray/native/bin/
|
||||
done
|
||||
|
||||
# prepare native libraries under /ray/native/lib
|
||||
mkdir -p $t_dir"/ray/native/lib/"
|
||||
for i in "${!nativeLibraries[@]}"
|
||||
do
|
||||
cp $ray_dir/build/${nativeLibraries[$i]} $t_dir/ray/native/lib/
|
||||
done
|
||||
|
||||
# prepare java components under /ray/java/lib
|
||||
mkdir -p $t_dir"/ray/java/lib/"
|
||||
unzip -q $ray_dir/java/cli/target/ray-cli-ear.zip -d $ray_dir/java
|
||||
cp $ray_dir/java/ray-cli/lib/* $t_dir/ray/java/lib/
|
||||
rm -rf $ray_dir/java/ray-cli
|
||||
|
||||
cp -rf $ray_dir/java/ray.config.ini $t_dir/ray/
|
||||
|
||||
# prepare java apps directory
|
||||
mkdir -p $t_dir"/ray/java/apps/"
|
||||
|
||||
# prepare run.sh
|
||||
cp $ray_dir/java/run.sh $t_dir/
|
||||
}
|
||||
|
||||
prepare_source
|
|
@ -1,8 +0,0 @@
|
|||
#!/bin/bash
|
||||
scripts_dir=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)
|
||||
cd $scripts_dir
|
||||
|
||||
export RAY_CONFIG=$scripts_dir/ray/ray.config.ini
|
||||
export LD_LIBRARY_PATH=$scripts_dir/ray/native/lib:$LD_LIBRARY_PATH
|
||||
java -ea -classpath ray/java/lib/*:ray/java/lib/commons-cli-1.3.1.jar org.ray.cli.RayCli "$@"
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
#############################
|
||||
# build deploy file and deploy cluster
|
||||
sh cleanup.sh
|
||||
rm -rf local_deploy
|
||||
./prepare.sh -t local_deploy
|
||||
pushd local_deploy
|
||||
local_ip=`ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"`
|
||||
#echo "use local_ip" $local_ip
|
||||
OVERWRITE="ray.java.start.redis_port=34222;ray.java.start.node_ip_address=$local_ip;ray.java.start.deploy=true;ray.java.start.run_mode=CLUSTER"
|
||||
echo OVERWRITE is $OVERWRITE
|
||||
./run.sh start --head --overwrite=$OVERWRITE > cli.log 2>&1 &
|
||||
popd
|
||||
sleep 10
|
||||
|
||||
# auto-pack zip for app example
|
||||
pushd example
|
||||
if [ ! -d "app1/" ];then
|
||||
mkdir app1
|
||||
fi
|
||||
cp -rf target/ray-tutorial-1.0.jar app1/
|
||||
zip -r app1.zip app1
|
||||
popd
|
||||
|
||||
# run with cluster mode
|
||||
pushd local_deploy
|
||||
export RAY_CONFIG=ray/ray.config.ini
|
||||
ARGS=" --package ../example/app1.zip --class org.ray.example.HelloWorld --args=test1,test2 --redis-address=$local_ip:34222"
|
||||
../local_deploy/run.sh submit $ARGS
|
||||
popd
|
Loading…
Add table
Reference in a new issue