456354faca1a23010909497de48f4becd4cfb636
[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