Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit bcb1bfd

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 20eee59 + e106180 commit bcb1bfd

File tree

10 files changed

+154
-26
lines changed

10 files changed

+154
-26
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ The PoP information is saved in Gatekeeper. This can be inserted in three manner
9292
First of all, define the following variables:
9393

9494
```
95-
GATEKEEPER_IP=localhost
95+
GATEKEEPER_HOST=localhost:8000
9696
GATEKEEPER_PASS=Eq7K8h9gpg
9797
GATEKEEPER_USER_ID=1
9898
OPENSTACK_IP=localhost
@@ -104,12 +104,12 @@ The PoP information is saved in Gatekeeper. This can be inserted in three manner
104104
Get the Gatekeeper token (you can copy and paste in the command prompt):
105105

106106
```
107-
tokenId=$(curl -XPOST http://$GATEKEEPER_IP:8000/token/ -H "X-Auth-Password:$GATEKEEPER_PASS" -H "X-Auth-Uid:$GATEKEEPER_USER_ID" | python -c 'import json,sys;obj=json.load(sys.stdin);print obj["token"]["id"]')
107+
tokenId=$(curl -XPOST http://$GATEKEEPER_HOST/token/ -H "X-Auth-Password:$GATEKEEPER_PASS" -H "X-Auth-Uid:$GATEKEEPER_USER_ID" | python -c 'import json,sys;obj=json.load(sys.stdin);print obj["token"]["id"]')
108108
```
109109

110110
Post PoP Information (you can copy and paste in the command prompt):
111111
```
112-
curl -X POST http://$GATEKEEPER_IP:8000/admin/dc/ \
112+
curl -X POST http://$GATEKEEPER_HOST/admin/dc/ \
113113
-H 'X-Auth-Token: '$tokenId'' \
114114
-d '{"msg": "PoP Testbed", "dcname":"default", "adminid":"'$keystoneUser'","password":"'$keystonePass'", "extrainfo":"pop-ip='$OPENSTACK_IP' tenant-name='$admin_tenant_name' keystone-endpoint=http://'$OPENSTACK_IP':35357/v2.0 orch-endpoint=http://'$OPENSTACK_IP':8004/v1 compute-endpoint=http://'$OPENSTACK_IP':8774/v2.1 neutron-endpoint=http://'$OPENSTACK_IP':9696/v2.0"}'
115115
```

dependencies/install_cassandra.sh

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/bin/bash
2+
3+
cassandra_version="3.7"
4+
logstash_version="2.4.0"
5+
elasticsearch_version="2.4.0"
6+
7+
echo "input {
8+
stdin{}
9+
tcp {
10+
port => 9999
11+
codec => json_lines
12+
}
13+
udp {
14+
port => 5229
15+
codec => json_lines
16+
}
17+
}
18+
output {
19+
elasticsearch {
20+
host => localhost
21+
protocol => http
22+
}
23+
stdout { codec => rubydebug }
24+
}
25+
" > logstash.conf
26+
27+
28+
echo "Installing Java..."
29+
sudo apt-add-repository ppa:webupd8team/java
30+
sudo apt-get update
31+
sudo apt-get install oracle-java8-installer
32+
33+
echo "Installing Cassandra"
34+
35+
wget http://mirrors.fe.up.pt/pub/apache/cassandra/$cassandra_version/apache-cassandra-$cassandra_version-bin.tar.gz
36+
tar -zxvf apache-cassandra-$cassandra_version-bin.tar.gz
37+
rm apache-cassandra-$cassandra_version-bin.tar.gz
38+
39+
ip_address=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/')
40+
#edit config file
41+
sed -i -e 's/\(start_rpc:\).*/\1 true/' apache-cassandra-$cassandra_version/conf/cassandra.yaml
42+
sed -i -e 's/\(rpc_address:\).*/\1 '$ip_address'/' apache-cassandra-$cassandra_version/conf/cassandra.yaml
43+
#start_rpc: true => line 445
44+
#rpc_address: 172.16.6.29 => line 475
45+
#nano apache-cassandra-2.2.4/conf/cassandra.yaml
46+
47+
#load schema
48+
#apache-cassandra-2.2.4/bin/cqlsh localhost 9042 -f ns_schema.txt
49+
50+
#start cassandra
51+
#apache-cassandra-2.2.4/bin/cassandra
52+
53+
echo "Installation of Cassandra done. Start with the command: apache-cassandra-$cassandra_version/bin/cassandra -f."
54+
55+
echo "And remember to load the Schema with: apache-cassandra-$cassandra_version/bin/cqlsh localhost 9042 -f db/schema.txt"
56+
57+
echo "Installing logstash"
58+
59+
wget https://download.elastic.co/logstash/logstash/logstash-$logstash_version.tar.gz
60+
tar -zxvf logstash-$logstash_version.tar.gz
61+
rm logstash-$logstash_version.tar.gz
62+
63+
echo "Installation of Logstash done. Start with the command: logstash-$logstash_version/bin/bin/logstash agent -f logstash.conf."
64+
65+
66+
echo "Installing elasticsearch"
67+
68+
wget https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/$elasticsearch_version/elasticsearch-$elasticsearch_version.tar.gz
69+
tar -zxvf elasticsearch-$elasticsearch_version.tar.gz
70+
rm elasticsearch-$elasticsearch_version.tar.gz
71+
72+
echo "Installation of ElasticSearch done. Start with the command: elasticsearch-$elasticsearch_version/bin/elasticsearch."

dependencies/install_dependencies.sh

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ function echo_pass {
3030
echo -e "\033[0m"
3131
}
3232

33-
# echo pass or fail
34-
# example
35-
# echo echo_if 1 "Passed"
36-
# echo echo_if 0 "Failed"
3733
function echo_if {
3834
if [ $1 == 1 ]; then
3935
echo_pass $2
@@ -42,6 +38,18 @@ function echo_if {
4238
fi
4339
}
4440

41+
function install_rabbitmq {
42+
echo "Installing RabbitMq..."
43+
wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.5/rabbitmq-server-generic-unix-3.6.5.tar.xz
44+
45+
echo 'deb http://www.rabbitmq.com/debian/ testing main' | sudo tee /etc/apt/sources.list.d/rabbitmq.list
46+
wget -O- https://www.rabbitmq.com/rabbitmq-release-signing-key.asc | sudo apt-key add -
47+
sudo apt-get update
48+
sudo apt-get install rabbitmq-server
49+
50+
echo "Restarting RabbitMq service"
51+
sudo service rabbitmq-server restart
52+
}
4553
function install_mongodb {
4654
echo "Installing mongodb..."
4755
./install_mongodb.sh
@@ -53,6 +61,7 @@ function install_gatekeeper {
5361
function install_ruby {
5462
echo "Installing RVM..."
5563
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
64+
curl -sSL https://rvm.io/mpapis.asc | gpg --import -
5665
\curl -sSL https://get.rvm.io | bash -s stable
5766
echo "Installation of RVM done."
5867

@@ -74,36 +83,34 @@ function install_npm {
7483

7584
echo "Installing Grunt and Bower..."
7685
cd ../ui
77-
pwd
78-
sudo npm install -g grunt grunt-cli bower
79-
echo "Installation of Grunt and Bower done."
86+
echo "You need to install manually Grunt and Grunt-cli"
87+
# sudo npm install -g grunt grunt-cli bower
88+
# echo "Installation of Grunt and Bower done."
8089

81-
sudo npm install
90+
# sudo npm install
8291

8392
echo "Installing Compass..."
8493
gem install compass
8594
echo "Installation of Compass done."
8695

8796
cd ../dependencies
8897
echo "NPM dependencies done."
89-
98+
echo "You need to move it to UI folder, and t install manually Grunt and Grunt-cli with the command: sudo npm install -g grunt grunt-cli bower"
99+
echo "Also, then use the following command: sudo npm install"
90100
}
91101

92102
echo -e -n "\033[1;36mChecking if mongodb is installed"
93103
mongod --version > /dev/null 2>&1
94104
MONGO_IS_INSTALLED=$?
95105
if [ $MONGO_IS_INSTALLED -eq 0 ]; then
96106
echo ">>> MongoDB already installed"
97-
#service mongod restart
98107
else
99108
echo "Do you want to install mongodb? (y/n)"
100109
read install
101110
if [ "$install" = "y" ]; then
102111
echo -e -n "\033[1;31mMongodb is not installed... Installing..."
103112
install_mongodb
104113
fi
105-
#./install_mongodb.sh
106-
#bash -c "$(curl -fsSL https://raw.githubusercontent.com/steveneaston/Vaprobash/master/scripts/mongodb.sh)" bash $1 $2
107114
fi
108115

109116
echo -e -n "\033[1;36mChecking if gatekeeper is installed"
@@ -158,9 +165,24 @@ else
158165
fi
159166
fi
160167

168+
echo -e -n "\033[1;36mChecking if rabbitmq is installed"
169+
rabbitmq-server --version > /dev/null 2>&1
170+
RABBITMQ_IS_INSTALLED=$?
171+
if [ $RABBITMQ_IS_INSTALLED -eq 0 ]; then
172+
echo ">>> RabbitMQ already installed"
173+
else
174+
echo "Do you want to install rabbitmq for monitoring? (y/n)"
175+
read install
176+
if [ "$install" = "y" ]; then
177+
echo -e -n "\033[1;31mRabbitmq is not installed... Installing..."
178+
install_rabbitmq
179+
fi
180+
fi
181+
161182
echo -e -n "\033[1;36mChecking if dependencies are installed\n"
162183
echo "mongod $(echo_if $(program_is_installed mongo))"
163184
echo "ruby $(echo_if $(program_is_installed ruby))"
164185
echo "bundler $(echo_if $(program_is_installed bundler))"
165186
echo "node $(echo_if $(program_is_installed node))"
166187
echo "npm $(echo_if $(program_is_installed npm))"
188+
echo "rabbitmq $(echo_if $(program_is_installed rabbitmq-server))"

dependencies/install_gatekeeper.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ echo "Downloading auth-utils code now, please wait ..."
1919
mkdir $HOME/go
2020
mkdir -p $HOME/go/src/github.com/piyush82
2121
cd $HOME/go/src/github.com/piyush82
22-
git clone https://github.com/piyush82/auth-utils.git
22+
git clone https://github.com/T-NOVA/auth-utils
2323
echo "done."
2424

2525
cd auth-utils

hot-generator/routes/hot.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ class HotGenerator < Sinatra::Application
4040
routers_id = provision_info['routers_id']
4141
halt 400, 'Routers ID not found' if routers_id.nil?
4242

43-
security_group_id = provision_info['security_group_id']
44-
halt 400, 'Security group ID not found' if security_group_id.nil?
43+
if provision_info['security_group_id'].nil?
44+
security_group_id = nil
45+
end
4546

4647
vnfr_id = provision_info['vnfr_id']
4748
halt 400, 'Vnfr ID not found' if vnfr_id.nil?
@@ -146,4 +147,4 @@ class HotGenerator < Sinatra::Application
146147
File.read(File.join('assets/templates', params[:file_name]))
147148
end
148149

149-
end
150+
end

invoker.ini

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ command = rake start
1414
directory = ./ns-provisioning
1515
command = rake start
1616

17+
[ns-monitoring]
18+
directory = ./ns-monitoring
19+
command = rake start
20+
21+
[ns-monitoring-repository]
22+
directory = ./ns-monitoring-repository
23+
command = rake start
24+
1725
[vnf-catalogue]
1826
directory = ./vnf-catalogue
1927
command = rake start
@@ -30,6 +38,14 @@ command = rake start
3038
directory = ./vnfd-validator
3139
command = rake start
3240

41+
[vnf-monitoring]
42+
directory = ./vnf-monitoring
43+
command = rake start
44+
45+
[vnf-monitoring-repository]
46+
directory = ./vnf-monitoring-repository
47+
command = rake start
48+
3349
[hot-generator]
3450
directory = ./hot-generator
3551
command = rake start

ns-provisioning/helpers/vim.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@ def createSecurityGroup(computeUrl, tenant_id, token)
199199
logger.error e.response.body
200200
end
201201
sec, error = parse_json(response)
202+
if sec.nil?
203+
return nil
204+
end
202205
return sec['security_group']['id']
203206
end
204207

@@ -238,13 +241,17 @@ def getSecurityGroups(computeUrl, tenant_id, token)
238241
rescue => e
239242
logger.error e
240243
logger.error e.response.body
244+
return nil
241245
end
242246
sec, error = parse_json(response)
243247
return sec
244248
end
245249

246250
def configureSecurityGroups(computeUrl, tenant_id, token)
247251
vim_security_groups = getSecurityGroups(computeUrl, tenant_id, token)
252+
if vim_security_groups
253+
return nil
254+
end
248255
security_group_id = nil
249256
if (!settings.default_tenant_name.nil?)
250257
security_group_id = vim_security_groups['security_groups'][0]['id']

tenor_install.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ declare mongo_ip
55
declare gatekeeper
66
declare dns
77
declare logstash_address
8+
declare cassandra_address
89

910
pause(){
1011
read -p "Press [Enter] key to continue..." fackEnterKey
@@ -105,6 +106,7 @@ configureIps(){
105106
GATEKEEPER="127.0.0.1:8000"
106107
DNS_SERVER="8.8.8.8"
107108
LOGSTASH_ADDRESS="127.0.0.1:5228"
109+
CASSANDRA_ADDRESS="127.0.0.1"
108110

109111
echo "Type the IP where is installed TeNOR, followed by [ENTER]:"
110112
read tenor_ip
@@ -126,6 +128,10 @@ configureIps(){
126128
read logstash_address
127129
if [ -z "$logstash_address" ]; then logstash_address=$LOGSTASH_ADDRESS; fi
128130

131+
echo "Type the IP (xxx.xxx.xxx.xxx) where is installed Cassandra, followed by [ENTER]:"
132+
read cassandra_address
133+
if [ -z "$cassandra_address" ]; then cassandra_address=$CASSANDRA_ADDRESS; fi
134+
129135
logstash_host=${logstash_address%%:*}
130136
logstash_port=${logstash_address##*:}
131137
}
@@ -169,6 +175,7 @@ configureFiles(){
169175
if [ -f config/database.yml.sample ] && [ ! -f config/database.yml ]; then
170176
printf "Copy Cassandra Config\n"
171177
cp config/database.yml.sample config/database.yml
178+
sed -i -e 's/127.0.0.1:27017/'$cassandra_address'/' config/database.yml
172179
fi
173180
cd ../
174181
done
@@ -185,6 +192,7 @@ addNewPop(){
185192
GATEKEEPER_HOST=localhost:8000
186193
GATEKEEPER_PASS=Eq7K8h9gpg
187194
GATEKEEPER_USER_ID=1
195+
OPENSTACK_NAME=default
188196
OPENSTACK_IP=localhost
189197
ADMIN_TENANT_NAME=admin
190198
KEYSTONEPASS=password
@@ -194,6 +202,10 @@ addNewPop(){
194202
read gatekeeper_host
195203
if [ -z "$gatekeeper_host" ]; then gatekeeper_host=$GATEKEEPER_HOST; fi
196204

205+
echo "Type the Openstack name, followed by [ENTER]:"
206+
read openstack_name
207+
if [ -z "$openstack_name" ]; then openstack_name=$OPENSTACK_NAME; fi
208+
197209
echo "Type the Openstack IP, followed by [ENTER]:"
198210
read openstack_ip
199211
if [ -z "$openstack_ip" ]; then openstack_ip=$OPENSTACK_IP; fi
@@ -213,7 +225,7 @@ addNewPop(){
213225
tokenId=$(curl -XPOST http://$gatekeeper_host/token/ -H "X-Auth-Password:$GATEKEEPER_PASS" -H "X-Auth-Uid:$GATEKEEPER_USER_ID" | python -c 'import json,sys;obj=json.load(sys.stdin);print obj["token"]["id"]')
214226
curl -X POST http://$gatekeeper_host/admin/dc/ \
215227
-H 'X-Auth-Token: '$tokenId'' \
216-
-d '{"msg": "PoP Testbed", "dcname":"default", "adminid":"'$keystoneUser'","password":"'$keystonePass'", "extrainfo":"pop-ip='$openstack_ip' tenant-name='$admin_tenant_name' keystone-endpoint=http://'$openstack_ip':35357/v2.0 orch-endpoint=http://'$openstack_ip':8004/v1 compute-endpoint=http://'$openstack_ip':8774/v2.1 neutron-endpoint=http://'$openstack_ip':9696/v2.0"}'
228+
-d '{"msg": "PoP Testbed", "dcname":"'$openstack_name'", "adminid":"'$keystoneUser'","password":"'$keystonePass'", "extrainfo":"pop-ip='$openstack_ip' tenant-name='$admin_tenant_name' keystone-endpoint=http://'$openstack_ip':35357/v2.0 orch-endpoint=http://'$openstack_ip':8004/v1 compute-endpoint=http://'$openstack_ip':8774/v2.1 neutron-endpoint=http://'$openstack_ip':9696/v2.0"}'
217229

218230
pause
219231
}

vnf-manager/routes/configs.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,11 @@ class ServiceConfiguration < VNFManager
103103
post '/services/publish/:microservice' do
104104
name = params[:microservice]
105105

106-
registerService(request.body.read)
106+
#registerService(request.body.read)
107107

108-
EM.defer do
109-
ServiceConfigurationHelper.publishServices()
110-
end
108+
#EM.defer do
109+
# ServiceConfigurationHelper.publishServices()
110+
#end
111111

112112
return 200
113113
end

vnfd-validator/assets/samples/vnfd_example.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@
169169
"vdu0"
170170
],
171171
"external_access": true,
172-
"port_security_enabled": false,
173172
"connection_points_reference": [
174173
"CPfs0h"
175174
],
@@ -187,7 +186,6 @@
187186
"vdu0"
188187
],
189188
"external_access": true,
190-
"port_security_enabled": false,
191189
"connection_points_reference": [
192190
"CPng8r"
193191
],

0 commit comments

Comments
 (0)