Install the YARN
Application

The YARN application listens for model deployment requests. Models are exposed as REST
microservices that expose your model application as an endpoint. The YARN application takes
the submitted request that specifies the model payload that includes a shell script and other
model collateral which will start the microservice. Upon execution of the shell script that
starts the model, the YARN application registers the endpoints in ZooKeeper.

If you are using or depending an API library in your model such as Flask and Jinja2,
the library must be installed on every data node. This is because the model is executed by
a shell script which must be able to run successfully on every node.

In order to know on
which port that the REST service is listening, the model must create a file in the
current working directory which indicates the URL for the model. Because you might have
more than one copy of the model, it is a good idea to find an open port and bind to
that. An example of how to do that in Python is as follows:

Create a directory called "sample" in the root user's home directory where you
will put a very simple model.

Now, you can create a simple shell script that will expose a REST endpoint called
"echo" that will echo back the arguments passed to it. Create a file in the "sample"
directory named "echo.sh", and copy the following information into the file.

Note

In this simple REST service, we are always binding to port 1500. In a real REST
service which would expose your model, we would be more intelligent about the
choice of the port.

Users and groups that allowed to modify the time line entities in the
given domain

-ma,--master_vcores <arg>

Amount of virtual cores to be requested to run the application master

-mm,--master_memory

Amount of memory in MB to be requested to run the application master

-nle,--node_label_expression <arg>

Node label expression to determine the nodes where all the containers of
this application will be allocated, "" means containers can be allocated
anywhere, if you don't specify the option, default node_label_expression
of queue will be used.

-q,--queue <arg>

RM Queue in which this application is to be submitted

-t,--timeout <arg>

Application timeout in milliseconds

-va,--view_acls <arg>

Users and groups that allowed to view the time line entities in the given
domain

-zq,--zk_quorum <arg>

ZooKeeper Quorum

-zr,--zk_root <arg>

ZooKeeper Root

Test the configuration to ensure that the MaaS service is running correctly.

For example, you would enter the following:

Start one instance of a sample echo service (named 'sample' version '1.0') in
a container of 500m: