add docker build scripts for testing-scheduler 19/60019/5
authorLeoQi <QibinZheng2014@tongji.edu.cn>
Thu, 19 Jul 2018 19:25:40 +0000 (03:25 +0800)
committerLeoQi <QibinZheng2014@tongji.edu.cn>
Fri, 31 Aug 2018 08:53:38 +0000 (16:53 +0800)
JIRA: BOTTLENECK-239

add build and run scripts of docker.

Change-Id: Ide7ff57380039f579fabbd6c18ddd794dcae220b
Signed-off-by: Zheng Qibin <QibinZheng2014@tongji.edu.cn>
19 files changed:
docs/testing/user/userguide/testing_scheduler_user_guide.rst [new file with mode: 0644]
testing-scheduler/.gitignore [new file with mode: 0644]
testing-scheduler/docker/build.sh [new file with mode: 0644]
testing-scheduler/docker/clean.sh [new file with mode: 0644]
testing-scheduler/docker/plugin/Dockerfile [new file with mode: 0644]
testing-scheduler/docker/plugin/build.sh [new file with mode: 0644]
testing-scheduler/docker/plugin/run.sh [new file with mode: 0644]
testing-scheduler/docker/run.sh [new file with mode: 0644]
testing-scheduler/docker/server/Dockerfile [new file with mode: 0644]
testing-scheduler/docker/server/build.sh [new file with mode: 0644]
testing-scheduler/docker/server/clean.sh [new file with mode: 0644]
testing-scheduler/docker/server/run.sh [new file with mode: 0644]
testing-scheduler/docker/ui/Dockerfile [new file with mode: 0644]
testing-scheduler/docker/ui/build.sh [new file with mode: 0644]
testing-scheduler/docker/ui/clean.sh [new file with mode: 0644]
testing-scheduler/docker/ui/pre-builder/Dockerfile [new file with mode: 0644]
testing-scheduler/docker/ui/pre-builder/build.sh [new file with mode: 0644]
testing-scheduler/docker/ui/pre-builder/run.sh [new file with mode: 0644]
testing-scheduler/docker/ui/run.sh [new file with mode: 0644]

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
diff --git a/testing-scheduler/.gitignore b/testing-scheduler/.gitignore
new file mode 100644 (file)
index 0000000..68eeb62
--- /dev/null
@@ -0,0 +1,33 @@
+#################################\r
+##  files in server directory\r
+#################################\r
+\r
+# PYTHON PYC FILE\r
+/server/**/*.pyc\r
+\r
+#############################################################\r
+\r
+\r
+#################################\r
+##  files in ui directory\r
+#################################\r
+/ui/.DS_Store\r
+/ui/node_modules/\r
+/ui/dist/\r
+/ui/npm-debug.log*\r
+/ui/yarn-debug.log*\r
+/ui/yarn-error.log*\r
+\r
+# Editor directories and files\r
+/ui/.idea\r
+/ui/.vscode\r
+/ui/*.suo\r
+/ui/*.ntvs*\r
+/ui/*.njsproj\r
+/ui/*.sln\r
+\r
+#################################\r
+##  files in docker directory\r
+#################################\r
+/docker/plugin/tmp_files/\r
+/docker/ui/dist/
\ No newline at end of file
diff --git a/testing-scheduler/docker/build.sh b/testing-scheduler/docker/build.sh
new file mode 100644 (file)
index 0000000..5ff9dac
--- /dev/null
@@ -0,0 +1,20 @@
+##############################################################################\r
+# Copyright (c) 2018 Huawei Technologies Co.,Ltd and others.\r
+#\r
+# All rights reserved. This program and the accompanying materials\r
+# are made available under the terms of the Apache License, Version 2.0\r
+# which accompanies this distribution, and is available at\r
+# http://www.apache.org/licenses/LICENSE-2.0\r
+##############################################################################\r
+\r
+# get the absolute path of this shell file.\r
+basepath=$(cd `dirname $0`; pwd)\r
+\r
+#build conductor\r
+sh $basepath/plugin/build.sh\r
+\r
+#build server\r
+sh $basepath/server/build.sh\r
+\r
+#build ui\r
+sh $basepath/ui/build.sh
\ No newline at end of file
diff --git a/testing-scheduler/docker/clean.sh b/testing-scheduler/docker/clean.sh
new file mode 100644 (file)
index 0000000..b18e406
--- /dev/null
@@ -0,0 +1,32 @@
+##############################################################################\r
+# Copyright (c) 2018 Huawei Technologies Co.,Ltd and others.\r
+#\r
+# All rights reserved. This program and the accompanying materials\r
+# are made available under the terms of the Apache License, Version 2.0\r
+# which accompanies this distribution, and is available at\r
+# http://www.apache.org/licenses/LICENSE-2.0\r
+##############################################################################\r
+\r
+sudo docker rm -f 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
+sudo docker network rm conductor_default\r
+\r
+sudo docker rmi x-lab/testing-scheduler:server \\r
+                x-lab/testing-scheduler:ui \\r
+                x-lab/conductor:builder \\r
+                conductor:ui \\r
+                conductor:server \\r
+                elasticsearch:2.4 \\r
+                v1r3n/dynomite:latest \\r
+                java:8-jre-alpine \\r
+                python:2.7 \\r
+                node:alpine \\r
+                nginx:latest \\r
+                java:latest \\r
+\r
+echo "--- Clean Finished ---"
\ No newline at end of file
diff --git a/testing-scheduler/docker/plugin/Dockerfile b/testing-scheduler/docker/plugin/Dockerfile
new file mode 100644 (file)
index 0000000..d629793
--- /dev/null
@@ -0,0 +1,24 @@
+##############################################################################\r
+# Copyright (c) 2018 Huawei Technologies Co.,Ltd and others.\r
+#\r
+# All rights reserved. This program and the accompanying materials\r
+# are made available under the terms of the Apache License, Version 2.0\r
+# which accompanies this distribution, and is available at\r
+# http://www.apache.org/licenses/LICENSE-2.0\r
+##############################################################################\r
+\r
+FROM java\r
+MAINTAINER x-lab/Leo\r
+RUN useradd -m noroot -s /bin/bash\r
+USER noroot\r
+WORKDIR /home/noroot\r
+ENV BUILD_DIR build_dir\r
+ENV REPO_DIR ${BUILD_DIR}/conductor\r
+\r
+RUN mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR} && \\r
+    git clone http://github.com/Netflix/conductor.git && \\r
+    cd conductor && git checkout v1.10.4\r
+\r
+RUN cd ${REPO_DIR} && ./gradlew build\r
+\r
+CMD tail -f /dev/null
\ No newline at end of file
diff --git a/testing-scheduler/docker/plugin/build.sh b/testing-scheduler/docker/plugin/build.sh
new file mode 100644 (file)
index 0000000..cfcb98d
--- /dev/null
@@ -0,0 +1,28 @@
+##############################################################################\r
+# Copyright (c) 2018 Huawei Technologies Co.,Ltd and others.\r
+#\r
+# All rights reserved. This program and the accompanying materials\r
+# are made available under the terms of the Apache License, Version 2.0\r
+# which accompanies this distribution, and is available at\r
+# http://www.apache.org/licenses/LICENSE-2.0\r
+##############################################################################\r
+\r
+# get the absolute path of this shell file.\r
+basepath=$(cd `dirname $0`; pwd)\r
+tmppath=$basepath/tmp_files\r
+docker_tmppath=/home/noroot/build_dir/conductor\r
+group="x-lab"\r
+plugin_image="$group/conductor:builder"\r
+plugin_container="conductor-builder"\r
+#build the gradle project in a temp container.\r
+\r
+mkdir -p $tmppath\r
+docker build -t $plugin_image -f $basepath/Dockerfile $basepath\r
+docker run -d --name $plugin_container $plugin_image\r
+docker cp  $plugin_container:$docker_tmppath $tmppath/\r
+docker rm -f $plugin_container\r
+#docker rmi $plugin_image\r
+\r
+#build the images of conductor.\r
+cd $tmppath/conductor/docker\r
+docker-compose build\r
diff --git a/testing-scheduler/docker/plugin/run.sh b/testing-scheduler/docker/plugin/run.sh
new file mode 100644 (file)
index 0000000..8021eef
--- /dev/null
@@ -0,0 +1,14 @@
+##############################################################################\r
+# Copyright (c) 2018 Huawei Technologies Co.,Ltd and others.\r
+#\r
+# All rights reserved. This program and the accompanying materials\r
+# are made available under the terms of the Apache License, Version 2.0\r
+# which accompanies this distribution, and is available at\r
+# http://www.apache.org/licenses/LICENSE-2.0\r
+##############################################################################\r
+\r
+# get the absolute path of this shell file.\r
+basepath=$(cd `dirname $0`; pwd)\r
+tmppath=$basepath/tmp_files\r
+cd $tmppath/conductor/docker\r
+docker-compose -p conductor up -d
\ No newline at end of file
diff --git a/testing-scheduler/docker/run.sh b/testing-scheduler/docker/run.sh
new file mode 100644 (file)
index 0000000..e303dce
--- /dev/null
@@ -0,0 +1,20 @@
+##############################################################################\r
+# Copyright (c) 2018 Huawei Technologies Co.,Ltd and others.\r
+#\r
+# All rights reserved. This program and the accompanying materials\r
+# are made available under the terms of the Apache License, Version 2.0\r
+# which accompanies this distribution, and is available at\r
+# http://www.apache.org/licenses/LICENSE-2.0\r
+##############################################################################\r
+\r
+# get the absolute path of this shell file.\r
+basepath=$(cd `dirname $0`; pwd)\r
+\r
+#run conductor containers\r
+sh $basepath/plugin/run.sh\r
+\r
+#run server\r
+sh $basepath/server/run.sh\r
+\r
+#run ui\r
+sh $basepath/ui/run.sh
\ No newline at end of file
diff --git a/testing-scheduler/docker/server/Dockerfile b/testing-scheduler/docker/server/Dockerfile
new file mode 100644 (file)
index 0000000..e04873e
--- /dev/null
@@ -0,0 +1,29 @@
+##############################################################################\r
+# Copyright (c) 2018 Huawei Technologies Co.,Ltd and others.\r
+#\r
+# All rights reserved. This program and the accompanying materials\r
+# are made available under the terms of the Apache License, Version 2.0\r
+# which accompanies this distribution, and is available at\r
+# http://www.apache.org/licenses/LICENSE-2.0\r
+##############################################################################\r
+\r
+FROM python:2.7\r
+MAINTAINER x-lab/Leo\r
+WORKDIR /home/testing-scheduler/server\r
+COPY ./server .\r
+\r
+RUN pip install -r ./python_modules.txt\r
+\r
+ENV CONDUCTOR_DIR /home/testing-scheduler/conductor\r
+RUN mkdir ${CONDUCTOR_DIR} && cd ${CONDUCTOR_DIR} && \\r
+    git clone http://github.com/Netflix/conductor.git && \\r
+    cd conductor && git checkout v1.10.4\r
+RUN cd ${CONDUCTOR_DIR}/conductor/client/python && \\r
+    python setup.py install\r
+\r
+RUN pip install -U .\r
+\r
+EXPOSE 5310\r
+EXPOSE 5312\r
+CMD sh -c 'python /usr/local/lib/python2.7/site-packages/src/rest/router.py &  \\r
+           python ./src/rest/test_service_demo.py'\r
diff --git a/testing-scheduler/docker/server/build.sh b/testing-scheduler/docker/server/build.sh
new file mode 100644 (file)
index 0000000..27f6de3
--- /dev/null
@@ -0,0 +1,20 @@
+##############################################################################\r
+# Copyright (c) 2018 Huawei Technologies Co.,Ltd and others.\r
+#\r
+# All rights reserved. This program and the accompanying materials\r
+# are made available under the terms of the Apache License, Version 2.0\r
+# which accompanies this distribution, and is available at\r
+# http://www.apache.org/licenses/LICENSE-2.0\r
+##############################################################################\r
+\r
+# get the absolute path of this shell file.\r
+basepath=$(cd `dirname $0`; pwd)\r
+\r
+# get the root directory of this project\r
+projectpath=$basepath/../..\r
+group="x-lab"\r
+\r
+# server image name\r
+server_image="$group/testing-scheduler:server"\r
+\r
+docker build -t $server_image -f $basepath/Dockerfile  $projectpath
\ No newline at end of file
diff --git a/testing-scheduler/docker/server/clean.sh b/testing-scheduler/docker/server/clean.sh
new file mode 100644 (file)
index 0000000..900326b
--- /dev/null
@@ -0,0 +1,17 @@
+##############################################################################\r
+# Copyright (c) 2018 Huawei Technologies Co.,Ltd and others.\r
+#\r
+# All rights reserved. This program and the accompanying materials\r
+# are made available under the terms of the Apache License, Version 2.0\r
+# which accompanies this distribution, and is available at\r
+# http://www.apache.org/licenses/LICENSE-2.0\r
+##############################################################################\r
+\r
+group="x-lab"\r
+# server image name\r
+server_image="$group/testing-scheduler:server"\r
+# server container name\r
+server_container="t-scheduler-server"\r
+\r
+docker rm -f $server_container\r
+docker rmi $server_image
\ No newline at end of file
diff --git a/testing-scheduler/docker/server/run.sh b/testing-scheduler/docker/server/run.sh
new file mode 100644 (file)
index 0000000..d486f86
--- /dev/null
@@ -0,0 +1,17 @@
+##############################################################################\r
+# Copyright (c) 2018 Huawei Technologies Co.,Ltd and others.\r
+#\r
+# All rights reserved. This program and the accompanying materials\r
+# are made available under the terms of the Apache License, Version 2.0\r
+# which accompanies this distribution, and is available at\r
+# http://www.apache.org/licenses/LICENSE-2.0\r
+##############################################################################\r
+\r
+conductor_network='conductor_default'\r
+group="x-lab"\r
+# server image name\r
+server_image="$group/testing-scheduler:server"\r
+# server container name\r
+server_container="t-scheduler-server"\r
+\r
+docker run -d --rm -p 5310:5310 -p 5312:5312 --net=$conductor_network --name $server_container $server_image
\ No newline at end of file
diff --git a/testing-scheduler/docker/ui/Dockerfile b/testing-scheduler/docker/ui/Dockerfile
new file mode 100644 (file)
index 0000000..212394a
--- /dev/null
@@ -0,0 +1,16 @@
+##############################################################################\r
+# Copyright (c) 2018 Huawei Technologies Co.,Ltd and others.\r
+#\r
+# All rights reserved. This program and the accompanying materials\r
+# are made available under the terms of the Apache License, Version 2.0\r
+# which accompanies this distribution, and is available at\r
+# http://www.apache.org/licenses/LICENSE-2.0\r
+##############################################################################\r
+\r
+FROM nginx\r
+MAINTAINER x-lab/Leo\r
+\r
+RUN rm /etc/nginx/conf.d/default.conf\r
+\r
+ADD ./ui/config/default.conf /etc/nginx/conf.d/\r
+COPY ./docker/ui/dist/  /usr/share/nginx/html/
\ No newline at end of file
diff --git a/testing-scheduler/docker/ui/build.sh b/testing-scheduler/docker/ui/build.sh
new file mode 100644 (file)
index 0000000..52286a8
--- /dev/null
@@ -0,0 +1,22 @@
+##############################################################################\r
+# Copyright (c) 2018 Huawei Technologies Co.,Ltd and others.\r
+#\r
+# All rights reserved. This program and the accompanying materials\r
+# are made available under the terms of the Apache License, Version 2.0\r
+# which accompanies this distribution, and is available at\r
+# http://www.apache.org/licenses/LICENSE-2.0\r
+##############################################################################\r
+\r
+# get the absolute path of this shell file.\r
+basepath=$(cd `dirname $0`; pwd)\r
+# get the root directory of this project\r
+projectpath=$basepath/../..\r
+group="x-lab"\r
+# ui image name\r
+ui_image="$group/testing-scheduler:ui"\r
+\r
+# build the ui-project and generate the dist package.\r
+sh $basepath/pre-builder/build.sh\r
+sh $basepath/pre-builder/run.sh\r
+\r
+docker build -t $ui_image -f $basepath/Dockerfile $projectpath
\ No newline at end of file
diff --git a/testing-scheduler/docker/ui/clean.sh b/testing-scheduler/docker/ui/clean.sh
new file mode 100644 (file)
index 0000000..5ab4e21
--- /dev/null
@@ -0,0 +1,19 @@
+##############################################################################\r
+# Copyright (c) 2018 Huawei Technologies Co.,Ltd and others.\r
+#\r
+# All rights reserved. This program and the accompanying materials\r
+# are made available under the terms of the Apache License, Version 2.0\r
+# which accompanies this distribution, and is available at\r
+# http://www.apache.org/licenses/LICENSE-2.0\r
+##############################################################################\r
+\r
+group="x-lab"\r
+# ui image name\r
+ui_image="$group/testing-scheduler:ui"\r
+# ui container name\r
+ui_container="t-scheduler-ui"\r
+docker rm -f $ui_container\r
+docker rmi $ui_image\r
+# get the absolute path of this shell file.\r
+basepath=$(cd `dirname $0`; pwd)\r
+rm -rf $basepath/dist
\ No newline at end of file
diff --git a/testing-scheduler/docker/ui/pre-builder/Dockerfile b/testing-scheduler/docker/ui/pre-builder/Dockerfile
new file mode 100644 (file)
index 0000000..f69667f
--- /dev/null
@@ -0,0 +1,18 @@
+##############################################################################\r
+# Copyright (c) 2018 Huawei Technologies Co.,Ltd and others.\r
+#\r
+# All rights reserved. This program and the accompanying materials\r
+# are made available under the terms of the Apache License, Version 2.0\r
+# which accompanies this distribution, and is available at\r
+# http://www.apache.org/licenses/LICENSE-2.0\r
+##############################################################################\r
+\r
+FROM node:alpine\r
+MAINTAINER x-lab/Leo\r
+WORKDIR /home/testing-scheduler/ui\r
+COPY ./ui .\r
+\r
+RUN npm install\r
+RUN npm run build\r
+\r
+CMD tail -f /dev/null
\ No newline at end of file
diff --git a/testing-scheduler/docker/ui/pre-builder/build.sh b/testing-scheduler/docker/ui/pre-builder/build.sh
new file mode 100644 (file)
index 0000000..7f227ed
--- /dev/null
@@ -0,0 +1,17 @@
+##############################################################################\r
+# Copyright (c) 2018 Huawei Technologies Co.,Ltd and others.\r
+#\r
+# All rights reserved. This program and the accompanying materials\r
+# are made available under the terms of the Apache License, Version 2.0\r
+# which accompanies this distribution, and is available at\r
+# http://www.apache.org/licenses/LICENSE-2.0\r
+##############################################################################\r
+\r
+# get the absolute path of this shell file.\r
+basepath=$(cd `dirname $0`; pwd)\r
+# get the root directory of this project\r
+projectpath=$basepath/../../..\r
+group="x-lab"\r
+# ui image name\r
+ui_image="$group/testing-scheduler:ui-builder"\r
+docker build -t $ui_image -f $basepath/Dockerfile $projectpath
\ No newline at end of file
diff --git a/testing-scheduler/docker/ui/pre-builder/run.sh b/testing-scheduler/docker/ui/pre-builder/run.sh
new file mode 100644 (file)
index 0000000..a16f1c5
--- /dev/null
@@ -0,0 +1,21 @@
+##############################################################################\r
+# Copyright (c) 2018 Huawei Technologies Co.,Ltd and others.\r
+#\r
+# All rights reserved. This program and the accompanying materials\r
+# are made available under the terms of the Apache License, Version 2.0\r
+# which accompanies this distribution, and is available at\r
+# http://www.apache.org/licenses/LICENSE-2.0\r
+##############################################################################\r
+\r
+group="x-lab"\r
+# ui image name\r
+ui_image="$group/testing-scheduler:ui-builder"\r
+# ui container name\r
+ui_container='t-scheduler-ui-builder'\r
+# get the absolute path of this shell file.\r
+basepath=$(cd `dirname $0`; pwd)\r
+docker run -d --name $ui_container $ui_image\r
+\r
+docker cp $ui_container:/home/testing-scheduler/ui/dist $basepath/../\r
+docker rm -f $ui_container\r
+docker rmi $ui_image
\ No newline at end of file
diff --git a/testing-scheduler/docker/ui/run.sh b/testing-scheduler/docker/ui/run.sh
new file mode 100644 (file)
index 0000000..12f4bae
--- /dev/null
@@ -0,0 +1,17 @@
+##############################################################################\r
+# Copyright (c) 2018 Huawei Technologies Co.,Ltd and others.\r
+#\r
+# All rights reserved. This program and the accompanying materials\r
+# are made available under the terms of the Apache License, Version 2.0\r
+# which accompanies this distribution, and is available at\r
+# http://www.apache.org/licenses/LICENSE-2.0\r
+##############################################################################\r
+\r
+conductor_network='conductor_default'\r
+group="x-lab"\r
+# ui image name\r
+ui_image="$group/testing-scheduler:ui"\r
+# ui container name\r
+ui_container="t-scheduler-ui"\r
+\r
+docker run -d --rm -p 5311:5311 --net=$conductor_network --name $ui_container $ui_image
\ No newline at end of file