add docker build scripts for testing-scheduler
[bottlenecks.git] / docs / testing / user / userguide / testing_scheduler_user_guide.rst
diff --git a/docs/testing/user/userguide/testing_scheduler_user_guide.rst b/docs/testing/user/userguide/testing_scheduler_user_guide.rst
new file mode 100644 (file)
index 0000000..bcf63ef
--- /dev/null
@@ -0,0 +1,180 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.\r
+.. http://creativecommons.org/licenses/by/4.0\r
+.. (c) Huawei Technologies Co.,Ltd and others.\r
+\r
+****************************\r
+Testing-scheduler User Guide\r
+****************************\r
+\r
+\r
+Testing-scheduler Introduction\r
+==============================\r
+\r
+Testing scheduler aims to schedule the testing process on NFV(Network\r
+Function Virtualizaion) platform or MSA(Microservice Architecture)\r
+application.By creating a testcase, you can implements a testing\r
+process integrates and schedules the other testing frameworks and tools.\r
+You can also create a testsuite which contains several testcases, and run\r
+all the testcases at a time.\r
+\r
+\r
+Preinstall Packages\r
+===================\r
+\r
+* Docker: https://docs.docker.com/engine/installation/\r
+    * For Ubuntu, please refer to https://docs.docker.com/engine/installation/linux/ubuntu/\r
+\r
+* Docker-Compose: https://docs.docker.com/compose/\r
+\r
+.. code-block:: bash\r
+\r
+    if [ -d usr/local/bin/docker-compose ]; then\r
+        rm -rf usr/local/bin/docker-compose\r
+    fi\r
+    curl -L https://github.com/docker/compose/releases/download/1.11.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose\r
+    chmod +x /usr/local/bin/docker-compose\r
+\r
+\r
+Run Testing-scheduler\r
+=====================\r
+\r
+There are a few steps to do.\r
+\r
+\r
+Download Bottlenecks Software\r
+-----------------------------\r
+\r
+.. code-block:: bash\r
+\r
+    mkdir -p /some/dir\r
+    git clone https://gerrit.opnfv.org/gerrit/bottlenecks\r
+    cd bottlenecks/testing-scheduler\r
+\r
+\r
+Build And Run Docker Containers\r
+-------------------------------\r
+\r
+.. code-block:: bash\r
+\r
+    cd docker\r
+    sh build.sh\r
+    sh run.sh\r
+\r
+\r
+build.sh is used to build the images, and run.sh is use to\r
+run the containers based on the images.\r
+If you are not the root user, you need to use 'sudo', like:\r
+\r
+.. code-block:: bash\r
+\r
+    cd docker\r
+    sudo sh build.sh\r
+    sudo sh run.sh\r
+\r
+\r
+Otherwise there will be a problem of "Permission Denied".\r
+The second command takes approximately 1h to finish(\r
+so need some patience :) ), and the latter one just takes a few minutes.\r
+\r
+You can use command the check whether all the containers are in running.\r
+\r
+.. code-block:: bash\r
+\r
+    docker ps\r
+\r
+if the output contains 6 containers as below, then the project\r
+runs successfully:\r
+\r
+* t-scheduler-server\r
+* t-scheduler-ui\r
+* conductor_conductor-server_1\r
+* conductor_conductor-ui_1\r
+* conductor_dynomite_1\r
+* conductor_elasticsearch_1\r
+\r
+Sometimes, the command execution fails, and you need to read the sections:\r
+*(Optional)Commands Explanation* ,\r
+*(Optional) Build And Run Containers Seperately* to solve it.\r
+\r
+\r
+Start To Use Via Web\r
+--------------------\r
+You can visit the web pages via the url: http://your-host-ip:5311/.\r
+\r
+You can do these operations:\r
+\r
+* test suite CRUD\r
+* test case CRUD\r
+* execute a single test case\r
+* execute several chosen test cases\r
+* execute a single test suite\r
+* test service CRUD\r
+* context setting\r
+\r
+Cleaning Up Environment\r
+-----------------------\r
+\r
+.. code-block:: bash\r
+\r
+    cd docker\r
+    sh clean.sh\r
+\r
+\r
+(Optional)Commands Explanation\r
+------------------------------\r
+\r
+The directory(**docker**) contains the shell scripts which are used\r
+to build this project(**testing-scheduler**) as a dockerized application.\r
+Built by these scripts, the dockerized application will contain\r
+6 containers(1 + 1 + 4). They can be divided as three components:\r
+\r
+* 1 server container: server component of **testing-scheduler**.\r
+* 1 webUI container: ui component of **testing-scheduler**.\r
+* a group of 4 containers of Conductor.\r
+\r
+Correspondingly, there are three subdirectories in the current\r
+directory(**docker**):\r
+\r
+* server: contains scirpts of running server container.\r
+* ui: contains scirpts of running ui container.\r
+* plugin:  contains scirpts of running Conductor containers.\r
+\r
+The three subdirectories contains scripts respectively.The scripts\r
+(in one subdirectory) are used to build image and start container\r
+for the single component.\r
+\r
+Essentially,  the **build.sh**  and **run.sh** (in the directory(**docker**))\r
+call the subdirectory scripts to build all three components.\r
+\r
+\r
+(Optional) Build And Run Containers Seperately\r
+----------------------------------------------\r
+\r
+If you run the containers successfully, you can skip this section.\r
+As said in *Build And Run Docker Containers*, build step will need about 1h to\r
+finish.But it sometime will failed due to the network, and the rebuild will\r
+take a great time cost.So we can build and run the containers seperately\r
+according to the three subdirectories(**server**, **ui**, **plugin**).The\r
+steps are similar to *Build And Run Docker Containers*.\r
+\r
+*IMPORTANT: There are relationships in these components(some need to be\r
+created before other).So you can only build the components below in the\r
+order:* **plugin** -> **server** -> **ui** .\r
+\r
+* enter the subdirectory(**$dir** stands for **server**, **ui**, **plugin**).\r
+\r
+.. code-block:: bash\r
+\r
+    cd $dir\r
+\r
+* build the docker images.\r
+\r
+.. code-block:: bash\r
+\r
+    sh build.sh\r
+\r
+* run the docker containers.\r
+\r
+.. code-block:: bash\r
+\r
+    sh run.sh
\ No newline at end of file