Public Repository

Last pushed: a year ago
Short Description
APSARAS (Allocation of PhySicAl devices foR Android teSting)
Full Description

Apsaras docker image


It is a docker image for Apsaras. Run it now:

docker run -it --privileged --net host  --device /dev/fuse apsaras

Dependences

In this image, the following tools are installed:

  1. Android SDK: It is in /opt/sdk. If you get command not found when use adb, you should use source /etc/profile command firstly.
  2. JRE: Java is needed in this project.
  3. MooseFS: We use moosefs as our distributed file system. You may use the following command to start the moosefs.

In file /etc/mfs, you will find the configuration file for moosefs, so configure them with proper arguments. Most of configurations are default values. While in mfschunkserver.cfg, we set MASTER_HOST = mfsmaster, mfsmaster defined in /etc/hosts ( we use --net host here). In mfshdd.cfg, we add line /home/aps/mfs here. Of course, you can change the configurations to whatever you want.

Start mfsmaster in one mfs master node:

$ mfsmaster start     //Start mfsmaster
$ mfsmaster stop   //Stop mfsmaster

Start mfscgiserv (optional), you can monitor the mfs status in http://127.0.0.1:9425:

$ mfscgiserv start
$ mfscgiserv stop

Start mfschunkserver in every mfs slave node:

$ mfschunkserver start  
$ mfschunkserver stop

Mount mfs file to local file, you can use this local file to share files now. We use /home/aps/share as an example here:

$ sudo mfsmount /home/aps/share -H mfsmaster

You can run mfsmaster and mfschunkserver in standalone containers, but you have to mount the correct file, which can be accessed by Apsaras, to the mfsmaster.

  1. MongoDB MongoDB is not in this image, so you should start a mongodb server in your host or in a container (tutum/mongodb).
docker run -d -p 27017:27017 -p 28017:28017 -e AUTH=no tutum/mongodb

Apsaras Run

In file /home/aps/apsaras/, there are two files, server and slave. You should run server in one master node and slave in slave nodes that are conneted with many Android devices.

Server

Firstly, configure your server node.

In /home/aps/apsaras/server/config/app.conf, set the http server configurations:

appname = apsaras
httpport = 8023
runmode = dev
CopyRequestBody = true
AutoRender = false
TemplateLeft = {{<
TemplateRight = >}}

You can change the httpport to a better one.

In /home/aps/apsaras/server/config/master.json, set the proper configurations for Apsaras master:

{
        "SharePath":"/home/aps/share",
        "Port":"6666",
        "DBUrl":"localhost",
        "DBName":"aptweb-dev"
}

SharePath: It is the file to save testing files, which are shared by MooseFS. We mount /home/aps/share to mfsmaster here as mentioned before.

Port: The port is used by master node to communicate with slave node.

DBUrl: It is the url of Mongodb server.

DBName: Set the DB name.

It is time to run server:

./server

Now you can get your web client in http://localhost:8023/jobs.

Slave

Same with the server, you should config it.
{
"SharePath":"/home/aps/share",
"ServerIP":"localhost:6666",
"SDKPath":"/opt/sdk"
}
SharePath: It is the file to save testing files, which are shared by MooseFS. We mount /home/aps/share to mfsmaster here as mentioned before.

ServerIP: The ip:port of the master node.

SDKPath: The Android sdk path. We have installed adb in this container with path /opt/sdk.

Connect some Android devices to this slave node, you can run this slave node now:

./slave

You will see all of your connected Android devices in the web client.

Usage

Apsaras is easy to use. With a beautiful web client, you will enjoy the features of Apsaras :).

Docker Pull Command
Owner
apsaras

Comments (0)