UI initial implementation.
[validation.git] / docker / README.rst
1 .. ############################################################################
2 .. Copyright (c) 2019 AT&T, ENEA AB, Nokia and others                         #
3 ..                                                                            #
4 .. Licensed under the Apache License, Version 2.0 (the "License");            #
5 .. you maynot use this file except in compliance with the License.            #
6 ..                                                                            #
7 .. You may obtain a copy of the License at                                    #
8 ..       http://www.apache.org/licenses/LICENSE-2.0                           #
9 ..                                                                            #
10 .. Unless required by applicable law or agreed to in writing, software        #
11 .. distributed under the License is distributed on an "AS IS" BASIS, WITHOUT  #
12 .. WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.           #
13 .. See the License for the specific language governing permissions and        #
14 .. limitations under the License.                                             #
15 .. ############################################################################
16
17
18 Overview
19 ========
20
21 The Makefile in this directory is used to build and push all
22 the validation containers. The default registry is **akraino** on
23 dockerhub, but only CI jenkins slaves are authorized to push
24 images to that registry. If you want to push to your own test registry, set
25 the REGISTRY variables as in the commands below.
26
27 To build and push the images:
28
29 .. code-block:: console
30
31     make all [ REGISTRY=<dockerhub_registry> ]
32
33 To just build the containers, use the command:
34
35 .. code-block:: console
36
37     make build-all [ REGISTRY=<dockerhub_registry> ]
38
39 The k8s container
40 =================
41
42 Building and pushing the container
43 ----------------------------------
44
45 To build just the k8s container, use the command:
46
47 .. code-block:: console
48
49     make k8s-build [ REGISTRY=<dockerhub_registry> ]
50
51 To both build and push the container, use the command:
52
53 .. code-block:: console
54
55     make k8s [ REGISTRY=<dockerhub_registry> ]
56
57 Using the container
58 -------------------
59
60 The k8s image is meant to be ran from a server that has access to the
61 kubernetes cluster (jenkins slave, jumpserver, etc).
62
63 Before running the image, copy the folder ~/.kube from your kubernetes
64 master node to a local folder (e.g. /home/jenkins/k8s_access).
65
66 Container needs to be started with the kubernetes access folder mounted.
67 Optionally, the results folder can be mounted as well; this way the logs are
68 stored on the local server.
69
70 .. code-block:: console
71
72     docker run -ti -v /home/jenkins/k8s_access:/root/.kube/ \
73     -v /home/jenkins/k8s_results:/opt/akraino/validation/results/ \
74     akraino/validation:k8s-latest
75
76 By default, the container will run the k8s conformance test. If you want to
77 enter the container, add */bin/sh* at the end of the command above
78
79
80 The postgresql container
81 =================
82
83 Building and pushing the container
84 ----------------------------------
85
86 To build just the postgresql container, use the command:
87
88 .. code-block:: console
89
90    make postgresql-build [ REGISTRY=<dockerhub_registry> NAME=<image_name>]
91
92 To both build and push the container, use the command:
93
94 .. code-block:: console
95
96    make postgresql [ REGISTRY=<dockerhub_registry> NAME=<image_name>]
97
98 Using the container
99 -------------------
100 If you want to deploy the container, you can run the corresponding deploy.sh script with the appropriate parameters.
101
102 Example:
103
104 .. code-block:: console
105     ./deploy.sh POSTGRES_PASSWORD=password
106
107
108 The ui container
109 =================
110
111 Building and pushing the container
112 ----------------------------------
113
114 To build just the ui container, you must first compile the ui project.
115 Then use the command:
116
117 .. code-block:: console
118
119    make ui-build [ REGISTRY=<dockerhub_registry> NAME=<image_name>]
120
121 To both build and push the container, use the command:
122
123 .. code-block:: console
124
125    make ui [ REGISTRY=<dockerhub_registry> NAME=<image_name>]
126
127 Using the container
128 -------------------
129 If you want to deploy the container, you can run the corresponding deploy.sh script with the appropriate parameters.
130 Note, that you must also build and run the postgresql container for a functional UI.
131
132 Example:
133
134 .. code-block:: console
135     ./deploy.sh postgres_db_user_pwd=password jenkins_url=http://192.168.2.2:8080 jenkins_user_name=name jenkins_user_pwd=jenkins_pwd jenkins_job_name=job1 nexus_results_url=https://nexus.akraino.org/content/sites/logs proxy_ip=172.28.40.9 proxy_port=3128