Skip to content

Commit

Permalink
Added status.js and its tests (#238)
Browse files Browse the repository at this point in the history
Adds status.js to update the status message to json format. 
Adds the unit tests for status.js module. 
Moves the configuration variables from code into environment variables; updates the playbooks as well.
Updates the configuration JSON files to a consistent format.
  • Loading branch information
AnkshitJain authored and prasadtalasila committed Jan 9, 2018
1 parent 85677ba commit 7b0e7f4
Show file tree
Hide file tree
Showing 31 changed files with 529 additions and 163 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -5,6 +5,7 @@ main_server/lab_backups/
main_server/test/npm-debug.log
main_server/test/node_modules/
tests/functional_tests/node_modules/
util/node_modules/
.vagrant
docker-images/*.tar
ubuntu-xenial-16.04-cloudimg-console.log
Expand Down
6 changes: 5 additions & 1 deletion deploy/configs/execution_nodes/execution_node_1/conf.json
@@ -1,13 +1,17 @@
{ "load_balancer" :{
"role": "load_balancer",
"hostname": "localhost",
"port": "8081"
},
"gitlab" :{
"role": "gitlab",
"hostname": "localhost",
"port": "80"
},
"host_port" :
"execution_node" :
{
"role": "execution_node",
"hostname": "localhost",
"port" : "8082"
}
}
@@ -1,6 +1,7 @@
{
"node_details":
{
"role": "execution_node",
"hostname": "localhost",
"port": "8082"
},
Expand Down
6 changes: 5 additions & 1 deletion deploy/configs/execution_nodes/execution_node_2/conf.json
@@ -1,13 +1,17 @@
{ "load_balancer" :{
"role": "load_balancer",
"hostname": "localhost",
"port": "8081"
},
"gitlab" :{
"role": "gitlab",
"hostname": "localhost",
"port": "80"
},
"host_port" :
"execution_node" :
{
"role": "execution_node",
"hostname": "localhost",
"port" : "8083"
}
}
@@ -1,6 +1,7 @@
{
"node_details":
{
"role": "execution_node",
"hostname": "localhost",
"port": "8083"
},
Expand Down
6 changes: 5 additions & 1 deletion deploy/configs/execution_nodes/execution_node_3/conf.json
@@ -1,13 +1,17 @@
{ "load_balancer" :{
"role": "load_balancer",
"hostname": "localhost",
"port": "8081"
},
"gitlab" :{
"role": "gitlab",
"hostname": "localhost",
"port": "80"
},
"host_port" :
"execution_node" :
{
"role": "execution_node",
"hostname": "localhost",
"port" : "8084"
}
}
@@ -1,6 +1,7 @@
{
"node_details":
{
"role": "execution_node",
"hostname": "localhost",
"port": "8084"
},
Expand Down
6 changes: 5 additions & 1 deletion deploy/configs/execution_nodes/execution_node_4/conf.json
@@ -1,13 +1,17 @@
{ "load_balancer" :{
"role": "load_balancer",
"hostname": "localhost",
"port": "8081"
},
"gitlab" :{
"role": "gitlab",
"hostname": "localhost",
"port": "80"
},
"host_port" :
"execution_node" :
{
"role": "execution_node",
"hostname": "localhost",
"port" : "8085"
}
}
@@ -1,6 +1,7 @@
{
"node_details":
{
"role": "execution_node",
"hostname": "localhost",
"port": "8085"
},
Expand Down
6 changes: 5 additions & 1 deletion deploy/configs/execution_nodes/execution_node_5/conf.json
@@ -1,13 +1,17 @@
{ "load_balancer" :{
"role": "load_balancer",
"hostname": "localhost",
"port": "8081"
},
"gitlab" :{
"role": "gitlab",
"hostname": "localhost",
"port": "80"
},
"host_port" :
"execution_node" :
{
"role": "execution_node",
"hostname": "localhost",
"port" : "8086"
}
}
@@ -1,6 +1,7 @@
{
"node_details":
{
"role": "execution_node",
"hostname": "localhost",
"port": "8086"
},
Expand Down
12 changes: 11 additions & 1 deletion deploy/configs/load_balancer/nodes_data_conf.json
@@ -1,41 +1,51 @@
{
"Nodes": [
{
"role": "execution_node",
"hostname": "localhost",
"port": "8082"
},
{
"role": "execution_node",
"hostname": "localhost",
"port": "8083"
},
{
"role": "execution_node",
"hostname": "localhost",
"port": "8084"
},
{
"role": "execution_node",
"hostname": "localhost",
"port": "8085"
},
{
"role": "execution_node",
"hostname": "localhost",
"port": "8086"
}
],
"server_info": {
"role": "main_server",
"hostname": "localhost",
"port": "9000"
},
"database": {
"role": "database",
"host": "localhost",
"user": "root",
"password": "root",
"database": "Autolab"
},
"gitlab": {
"role": "gitlab",
"hostname": "localhost",
"port": "80"
},
"host_port": {
"load_balancer": {
"role": "load_balancer",
"hostname": "localhost",
"port": "8081"
}
}
7 changes: 6 additions & 1 deletion deploy/configs/main_server/conf.json
@@ -1,22 +1,27 @@
{
"load_balancer": {
"role": "load_balancer",
"hostname": "localhost",
"port": "8081"
},
"database" :
{
"role": "database",
"host" : "localhost",
"user" : "root",
"password" : "root",
"database" : "Autolab"
},
"gitlab" :
{
"role": "gitlab",
"username":"root",
"password" : "12345678"
},
"host_port" :
"main_server" :
{
"role": "main_server",
"hostname": "localhost",
"port" : "9000"
}
}
3 changes: 3 additions & 0 deletions deploy/inventory
@@ -1,3 +1,6 @@
[all:vars]
reject_unauthorised=0

[mysql]
localhost ansible_connection=local ansible_python_interpreter=/usr/bin/python2 sqldata=/opt/autolabjs/mysql mysql_root_pass=root

Expand Down
23 changes: 23 additions & 0 deletions deploy/playbook-single.yml
Expand Up @@ -59,6 +59,7 @@
- "443:443"
restart_policy: always
volumes:
- "/etc/localtime:/etc/localtime:ro"
- "/opt/autolabjs/gitlab/config:/etc/gitlab"
- "/opt/autolabjs/gitlab/logs:/var/log/gitlab"
- "/opt/autolabjs/gitlab/data:/var/opt/gitlab"
Expand Down Expand Up @@ -150,7 +151,9 @@
- "../log/load_balancer:/log"
env:
LOGGERCONFIG: "/etc/util/logger.json"
LBCONFIG: "/etc/load_balancer/nodes_data_conf.json"
GITLAB_IP: "{{ gitlab_hostname }}"
NODE_TLS_REJECT_UNAUTHORIZED: "{{ reject_unauthorised }}"

- hosts: mainserver
become: yes
Expand All @@ -176,6 +179,11 @@
- "../log/main_server:/log"
env:
LOGGERCONFIG: "/etc/util/logger.json"
MSCONFIG: "/etc/main_server/conf.json"
MSLABCONFIG: "/etc/main_server/labs.json"
MSCOURSECONFIG: "/etc/main_server/course.json"
MSAPIKEYS: "/etc/main_server/APIKeys.json"
# NODE_TLS_REJECT_UNAUTHORIZED: "{{ reject_unauthorised }}"

- hosts: executionnode1
become: yes
Expand Down Expand Up @@ -234,6 +242,9 @@
env:
LOGGERCONFIG: "/etc/util/logger.json"
GITLAB_IP: "{{ gitlab_hostname }}"
ENCONFIG: "/etc/execution_node/conf.json"
ENSCORES: "/etc/execution_node/scores.json"
# NODE_TLS_REJECT_UNAUTHORIZED: "{{ reject_unauthorised }}"

- hosts: executionnode2
become: yes
Expand Down Expand Up @@ -287,6 +298,9 @@
env:
LOGGERCONFIG: "/etc/util/logger.json"
GITLAB_IP: "{{ gitlab_hostname }}"
ENCONFIG: "/etc/execution_node/conf.json"
ENSCORES: "/etc/execution_node/scores.json"
# NODE_TLS_REJECT_UNAUTHORIZED: "{{ reject_unauthorised }}"

- hosts: executionnode3
become: yes
Expand Down Expand Up @@ -340,6 +354,9 @@
env:
LOGGERCONFIG: "/etc/util/logger.json"
GITLAB_IP: "{{ gitlab_hostname }}"
ENCONFIG: "/etc/execution_node/conf.json"
ENSCORES: "/etc/execution_node/scores.json"
# NODE_TLS_REJECT_UNAUTHORIZED: "{{ reject_unauthorised }}"

- hosts: executionnode4
become: yes
Expand Down Expand Up @@ -393,6 +410,9 @@
env:
LOGGERCONFIG: "/etc/util/logger.json"
GITLAB_IP: "{{ gitlab_hostname }}"
ENCONFIG: "/etc/execution_node/conf.json"
ENSCORES: "/etc/execution_node/scores.json"
# NODE_TLS_REJECT_UNAUTHORIZED: "{{ reject_unauthorised }}"

- hosts: executionnode5
become: yes
Expand Down Expand Up @@ -446,3 +466,6 @@
env:
LOGGERCONFIG: "/etc/util/logger.json"
GITLAB_IP: "{{ gitlab_hostname }}"
ENCONFIG: "/etc/execution_node/conf.json"
ENSCORES: "/etc/execution_node/scores.json"
# NODE_TLS_REJECT_UNAUTHORIZED: "{{ reject_unauthorised }}"
23 changes: 23 additions & 0 deletions deploy/playbook.yml
Expand Up @@ -59,6 +59,7 @@
- "443:443"
restart_policy: always
volumes:
- "/etc/localtime:/etc/localtime:ro"
- "/opt/autolabjs/gitlab/config:/etc/gitlab"
- "/opt/autolabjs/gitlab/logs:/var/log/gitlab"
- "/opt/autolabjs/gitlab/data:/var/opt/gitlab"
Expand Down Expand Up @@ -150,7 +151,9 @@
- "../log/load_balancer:/log"
env:
LOGGERCONFIG: "/etc/util/logger.json"
LBCONFIG: "/etc/load_balancer/nodes_data_conf.json"
GITLAB_IP: "{{ gitlab_hostname }}"
NODE_TLS_REJECT_UNAUTHORIZED: "{{ reject_unauthorised }}"

- hosts: mainserver
become: yes
Expand All @@ -176,6 +179,11 @@
- "../log/main_server:/log"
env:
LOGGERCONFIG: "/etc/util/logger.json"
MSCONFIG: "/etc/main_server/conf.json"
MSLABCONFIG: "/etc/main_server/labs.json"
MSCOURSECONFIG: "/etc/main_server/course.json"
MSAPIKEYS: "/etc/main_server/APIKeys.json"
# NODE_TLS_REJECT_UNAUTHORIZED: "{{ reject_unauthorised }}"

- hosts: executionnode1
become: yes
Expand Down Expand Up @@ -245,6 +253,9 @@
env:
LOGGERCONFIG: "/etc/util/logger.json"
GITLAB_IP: "{{ gitlab_hostname }}"
ENCONFIG: "/etc/execution_node/conf.json"
ENSCORES: "/etc/execution_node/scores.json"
# NODE_TLS_REJECT_UNAUTHORIZED: "{{ reject_unauthorised }}"

- hosts: executionnode2
become: yes
Expand Down Expand Up @@ -310,6 +321,9 @@
env:
LOGGERCONFIG: "/etc/util/logger.json"
GITLAB_IP: "{{ gitlab_hostname }}"
ENCONFIG: "/etc/execution_node/conf.json"
ENSCORES: "/etc/execution_node/scores.json"
# NODE_TLS_REJECT_UNAUTHORIZED: "{{ reject_unauthorised }}"

- hosts: executionnode3
become: yes
Expand Down Expand Up @@ -374,6 +388,9 @@
env:
LOGGERCONFIG: "/etc/util/logger.json"
GITLAB_IP: "{{ gitlab_hostname }}"
ENCONFIG: "/etc/execution_node/conf.json"
ENSCORES: "/etc/execution_node/scores.json"
# NODE_TLS_REJECT_UNAUTHORIZED: "{{ reject_unauthorised }}"

- hosts: executionnode4
become: yes
Expand Down Expand Up @@ -439,6 +456,9 @@
env:
LOGGERCONFIG: "/etc/util/logger.json"
GITLAB_IP: "{{ gitlab_hostname }}"
ENCONFIG: "/etc/execution_node/conf.json"
ENSCORES: "/etc/execution_node/scores.json"
# NODE_TLS_REJECT_UNAUTHORIZED: "{{ reject_unauthorised }}"

- hosts: executionnode5
become: yes
Expand Down Expand Up @@ -504,3 +524,6 @@
env:
LOGGERCONFIG: "/etc/util/logger.json"
GITLAB_IP: "{{ gitlab_hostname }}"
ENCONFIG: "/etc/execution_node/conf.json"
ENSCORES: "/etc/execution_node/scores.json"
# NODE_TLS_REJECT_UNAUTHORIZED: "{{ reject_unauthorised }}"

0 comments on commit 7b0e7f4

Please sign in to comment.