summaryrefslogtreecommitdiff
path: root/steps.txt
blob: 4ebeb6e1296fb13e7cc2feec9c3dbeb39a6891d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
brew install mariadb@10.4
mysql.server start
sudo mysql -u root
 - Create user faredge with password:password_changeme
mysql --user=faredge --password=password_changeme

mysql --user=root --password=password_changeme < sql/schema/create-database.sql
cp src/far_edge_ops_api/setting.py.example src/far_edge_ops_api/settings.py

Fill values in settings.py by contacting one of the following folks:
- Carlos, Dev, Subin

pip3 install virtualenv
virtualenv -p python3.6 venv
source venv/bin/activate
pip install -r requirements.txt --target=./venv/lib/python3.6/site-packages/

python src/manage.py makemigrations
python src/manage.py migrate

mysql --user=faredge --password=password_changeme < sql/schema/orchestration.testdata

python src/manage.py runserver

#sudo mysql --user=root < faredge.sql.example

Login to database as faredge user and run following command:

su - postgres
createuser -P faredge
dropdb faredge
createdb faredge --owner=faredge
psql -d faredge -U faredge
\dt;

insert into caas_cluster(cluster_name, oam_vip_address) values ('wsbomagj-d1566492-001', '2001:4888:2a14:502e:1b1:40a:0:f400');
insert into caas_cluster(cluster_name, oam_vip_address) values ('wsbomagj-p0000000-001', 'fd00:4888:2000:07f7::290');
insert into caas_cluster(cluster_name, oam_vip_address) values ('wsbomagj-d0000000-001', 'fd00:4888:2000:07fd::290');

insert into caas_namespace(namespace_name) values ('wsbomagj-1566492vzwcvdu-y-ss-x-00000000000');
insert into caas_namespace(namespace_name) values ('wsbomagj-1257637vzwcvdu-y-ss-x-002');

insert into caas_location(fuze_spm_site_id, fuze_spm_site_name, fuze_spm_market, fuze_spm_submarket, fuze_spm_site_type) values (9999999, 'Walnut Creek CA', 'WEST', 'WEST COAST', 'CRAN');
insert into caas_cluster(cluster_name, oam_vip_address, parent_cluster_id, namespace_id, location_id) values ('wsbomagj-d1257637-002', 'fd00:4888:2000:120a::a', (select id from caas_cluster where cluster_name='wsbomagj-d0000000-001'), (select id from caas_namespace where namespace_name='wsbomagj-1257637vzwcvdu-y-ss-x-002'), (select id from caas_location where fuze_spm_site_name='Walnut Creek CA'));
insert into caas_cluster(cluster_name, oam_vip_address, parent_cluster_id, namespace_id, location_id) values ('wsbomagj-p1257637-002', 'fd00:4888:2000:120c::290', (select id from caas_cluster where cluster_name='wsbomagj-p0000000-001'), (select id from caas_namespace where namespace_name='wsbomagj-1257637vzwcvdu-y-ss-x-002'), (select id from caas_location where fuze_spm_site_name='Walnut Creek CA'));

insert into orchestration_centraltoremotemap (central_region_name, remote_region_name) values ('fd00:4888:2000:07fd::290', 'fd00:4888:2000:120a::a');
insert into orchestration_centraltoremotemap (central_region_name, remote_region_name) values ('fd00:4888:2000:07fd::290', 'fd00:4888:2000:120a::a');
insert into orchestration_centraltoremotemap (central_region_name, remote_region_name) values ('fd00:4888:2000:07fd::290', 'fd00:4888:2000:120a::a');
insert into orchestration_centraltoremotemap (central_region_name, remote_region_name) values ('fd00:4888:2000:07fd::290', 'fd00:4888:2000:120a::a');

mkdir -p /var/log/far-edge-ops-api/
chown apache -R /var/log/far-edge-ops-api/
chgrp apache -R /var/log/far-edge-ops-api/

system registry-garbage-collect

curl -v http://localhost:8000/orchestration/image-upload -X POST -H "Content-Type: application/json" -d @data3.json
curl -v http://localhost:8000/orchestration/caas-status -X POST -H "Content-Type: application/json" -d@cluster-status.json
curl -v "http://localhost:8000/orchestration/remote-regions/wsbomagj-p1257637-002/connection-details?team=orchestration" -X GET 
curl -v "http://localhost:8000/orchestration/remote-regions/wsbomagj-p1257637-002/connection-details?team=application" -X GET 
curl http://localhost:8000/orchestration/remote-regions/wsbomagj-p1257637-002/status -X GET | python -m json.tool

sed 's/\\//'g testconfig1.conf > testconfig2.conf

---

Walnut Creek Lab testing:

sudo systemctl start httpd
sudo systemctl stop httpd
tail -f /var/log/apache2/middleware_error_log 
tail -f /var/log/far-edge-ops-api/orchestration.log

Planning's cluster:
curl -v "http://192.168.31.20/orchestration/remote-regions/wsbomagj-p1257637-002/connection-details?team=orchestration" -X GET

---

docker build . -t far-edge-ops-apis
docker run --network host -v /var/log/far-edge-ops-api/:/var/log/far-edge-ops-api/ far-edge-ops-apis:latest

How to deploy far_edge_ops_api code changes to middleware production server:

1. cd /opt/far-edge-ops-api/src/
2. git pull
3. systemctl restart far-edge-ops-api.service


--- Samsung Log collection ---

source venv/bin/activate
pip3 install -r logcollection-requirements.txt

1. Search IP address details about a sub-cloud:
   - ssh vcpfe-database-1-prod-birmingham.vcpfe.vzwops.com
     su - postgres
     psql -U faredge faredge
     faredge=> select cluster_name, fuze_spm_site_id, fuze_spm_site_name, oam_vip_address from caas_cluster join caas_location on caas_cluster.location_id=caas_location.id where fuze_spm_site_name ilike 'allen%';

2. python3 collect-logs.py
   Example:
   python3 collect-logs.py longmeadow9 2001:4888:2a10:e0ad:122:40a::f400 dummy-password

(Ask: Dev, Subin, Murali, Victor for actual password)

How to test caas_setup on wcLab
-------------------------------
1. Trigger caas_setup with:
curl -k -X POST -d ‘{“cluster_status”: [{“name”: “walnutcr-d9999999-002”, “description”: “wclab”, “location”: “9999999”, “software_version”: “20.06”, “availability”: “ONLINE”, “deploy_status”: “COMPLETE”, “created_at”: “2020-09-10 03:59:42”, “updated_at”: “2020-09-10 03:59:42”}]}’ http://middleware.hqplan.lab/orchestration/caas-status

2. check logs to make sure namespace is created and all cluster_status, namespace creation, and kubeconfig messages are sent to VMB
tail -f /var/log/apache2/far-edge-ops-api_access_log
tail -f /var/log/apache2/far-edge-ops-api_error_log
tail -f /var/log/far-edge-ops-api/orchestration.log


How to validate network setup after caas_setup call
---------------------------------------------------
1. Export WR_Installed tab of CIQ spreadsheet to csv file
2. Run paas-setup-check.py to genenerate list of sites passing or failing network setup validation
   Example:
   python ./paas-setup-check.py wr_installed.csv