README.md
1# VTS Dashboard
2
3## Introduction
4
5The VTS Dashboard displays the summarized results of the Multi Device Tests along with graphs.
6
7## Installation
8
9### Steps to run locally:
10
111. Google App Engine uses Java 8. Install Java 8 before running running locally:
12 'sudo apt install openjdk-8-jdk'
13
14 To use java 8:
15 Copy the following lines in ~/.bashrc :
16
17```
18 function setup_jdk() {
19 # Remove the current JDK from PATH
20 if [ -n "$JAVA_HOME" ] ; then
21 PATH=${PATH/$JAVA_HOME\/bin:/}
22 fi
23 export JAVA_HOME=$1
24 export PATH=$JAVA_HOME/bin:$PATH
25 }
26
27 function use_java8() {
28 # setup_jdk /usr/java/jre1.8.0_73
29 setup_jdk /usr/lib/jvm/java-8-openjdk-amd64
30 }
31
32 Then from cmd:
33 $ use_java8
34```
35
362. Maven is used for build. Install Maven 3.3.9:
37 Download maven from:
38 https://maven.apache.org/download.cgi
39
40 Steps to Install Maven:
41 1) Unzip the Binary tar:
42 tar -zxf apache-maven-3.3.3-bin.tar.gz
43
44 2) Move the application directory to /usr/local
45 sudo cp -R apache-maven-3.3.3 /usr/local
46
47 3) Make a soft link in /usr/bin for universal access of mvn
48 sudo ln -s /usr/local/apache-maven-3.3.3/bin/mvn /usr/bin/mvn
49
50 4) Verify maven installation:
51 $ mvn -v
52
53 The output should resemble this:
54
55 Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T08:41:47-08:00)
56 Maven home: /opt/apache-maven-3.3.9
57 Java version: 1.8.0_45-internal, vendor: Oracle Corporation
58 Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre
59 Default locale: en_US, platform encoding: UTF-8
60 OS name: "linux", version: "3.13.0-88-generic", arch: "amd64", family: "unix"
61
623. Install Google Cloud SDK. Follow the instructions listed on official source:
63 https://cloud.google.com/sdk/docs/quickstart-linux
64
65 The default location where the application searches for a google-cloud-sdk is:
66 /usr/local/share/google/google-cloud-sdk
67
68 Therefore move the extracted folder to this location: /usr/local/share/google/
69
70 Otherwise, to have a custom location, specify the location of
71 google-cloud-sdk in /vts/web/dashboard/appengine/servlet/pom.xml by putting the configuration:
72
73```
74 <configuration>
75 <gcloud_directory>PATH/TO/GCLOUD_DIRECTORY</gcloud_directory>
76 </configuration>
77```
78 within the 'com.google.appengine' plugin tag :
79
80## To run GAE on local machine:
81
82$ cd web/dashboard/appengine/servlet
83$ mvn clean gcloud:run
84
85## To deploy to Google App Engine
86
87$ cd web/dashboard/appengine/servlet
88$ mvn clean gcloud:deploy
89
90visit https://<YOUR-PROJECT-NAME>.appspot.com
91
92## Monitoring
93
94The following steps list how to create a monitoring service for the VTS Dashboard.
95
96### Create a Stackdriver account
97
981. Go to Google Cloud Platform Console:
99 http://console.developers.google.com
100
1012. In the Google Cloud Platform Console, select Stackdriver > Monitoring.
102 If your project is not in a Stackdriver account you'll see a message to
103 create a new project.
104
1053. Click Create new Stackdriver account and then Continue.
106
1074. With your project shown, click Create account.
108
1095. In the page, "Add Google Cloud Platform projects to monitor", click Continue to skip ahead.
110
1116. In the page, "Monitor AWS accounts", click Done to skip ahead.
112
1137. In a few seconds you see the following message:
114 "Finished Initial collection"
115 Click Launch Monitoring.
116
1178. In the page, "Get reports by email", click No reports and Continue.
118
1199. You will see your Stackdriver account dashboard.
120 Close the "Welcome to Stackdriver" banner if you don't need it.
121
122### Steps to create an uptime check and an alerting policy
123
1241. Go to Stack Monitoring console:
125 https://app.google.stackdriver.com/
126
1272. Go to Alerting > Uptime Checks in the top menu and then click Add Uptime Check.
128 You see the New Uptime Check panel.
129
1303. Fill in the following fields for the uptime check:
131
132 Check type: HTTP
133 Resource Type: Instance
134 Applies To: Single, lamp-1-vm
135 Leave the other fields with their default values.
136
1374. Click Test to verify your uptime check is working.
138
1395. Click Save. After you click on save you'll see a panel to
140 'Create Alerting Policy'
141
1426. Fill out the configuration for notifications and click save policy.
143
144### Test the check and alert
145
146This procedure can take up to fifteen minutes.
147
148To test the check and alert, go to the VM Instances page, select your instance, and click Stop from the top menu.
149You'll have to wait up to five minutes for the next uptime check to fail. The alert and notification don't happen until the next failure occurs.
150
151To correct the "problem," return to the VM Instances page, select your instance, and click Start from the top menu.
152