Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions devops/yarn/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
Prerequisites
=============

1. Yarn app of Ray is run under the Hadoop environment version 2.8.0.
You can get the Hadoop binary from
`here <http://archive.apache.org/dist/hadoop/common/hadoop-2.8.0/hadoop-2.8.0.tar.gz>`__.

Walkthrough
===========

Yarn environment and configuration
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Firstly, you should have an available hadoop yarn environment and
configuration.

Prepare ray on yarn jar file
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code:: shell

$ make clean package

Prepare deploy zip file
^^^^^^^^^^^^^^^^^^^^^^^

.. code:: shell

$ cd deploy
$ zip -r deploy.zip .

Please modify the script 'deploy/run.sh' on-demand.

Run
^^^

.. code:: shell

$ /path/to/hadoop-2.8.0/bin/yarn jar ./target/ray-on-yarn-1.0.jar org.ray.on.yarn.Client --jar ./target/ray-on-yarn-1.0.jar --rayArchive ./deploy/deploy.zip --containerVcores 2 --containerMemory 2048 --priority 10 --shellCmdPriority 10 --numRoles 1 1 --queue ray --headNodeStaticArgs "'--num-cpus 4 --num-gpus 4'" --workNodeStaticArgs "'--num-cpus 2 --num-gpus 2'"

Please modify the command line on-demand. Some detail about the input
args is in the help doc.

.. code:: shell

/path/to/hadoop-2.8.0/bin/yarn jar ./target/ray-on-yarn-1.0.jar org.ray.on.yarn.Client --help

Monitoring
^^^^^^^^^^

Please check the logs depend on your yarn platform.

Stop
^^^^

.. code:: shell

$ /path/to/hadoop-2.8.0/bin/yarn application -kill {app_id}

``{app_id}`` shall be replaced by the ID of the corresponding Yarn
application, e.g. ``application_1505745052163_0107``.
11 changes: 11 additions & 0 deletions devops/yarn/deploy/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#! /bin/sh
Copy link
Collaborator

Choose a reason for hiding this comment

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

Whether we need the sub directory deploy, is it ok just put the file of run.sh under the "devops/yarn" directory?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe there will be any other resource in the sub directory deploy. So we need this.

echo "######## The script running... ########"
echo "input args are:"
for arg in "$@"
do
echo " " $arg
done
# Please add your shell
ray start "$@"
echo "######## End of sleep ... ########"
sleep 1h
84 changes: 84 additions & 0 deletions devops/yarn/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.ray</groupId>
<artifactId>ray-on-yarn</artifactId>
<version>1.0</version>

<properties>
<hadoop.version>2.8.0</hadoop.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-yarn-common</artifactId>
<version>${hadoop.version}</version>
</dependency>

<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<version>${hadoop.version}</version>
</dependency>

<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-yarn-client</artifactId>
<version>${hadoop.version}</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-yarn-common</artifactId>
<type>test-jar</type>
<version>${hadoop.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.17</version>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>6.19</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>validate</id>
<phase>validate</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<configuration>
Copy link
Collaborator

Choose a reason for hiding this comment

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

We may need add the style check to CI, you could have a look at test.sh under java package.

Copy link
Collaborator

Choose a reason for hiding this comment

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

And whether we could add some unit test case, which prove the code of deploy on yarn is working, and bind to CI.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This test case is to hard to implement, because we need an available hadoop and yarn env. Maybe we can improvement that later?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok.

<configLocation>../../java/checkstyle.xml</configLocation>
<encoding>UTF-8</encoding>
<consoleOutput>true</consoleOutput>
<failsOnError>false</failsOnError>
<failOnViolation>false</failOnViolation>
<violationSeverity>warning</violationSeverity>
<format>xml</format>
<format>html</format>
<outputFile>${project.build.directory}/test/checkstyle-errors.xml</outputFile>
<linkXRef>false</linkXRef>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
Loading