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

Commit

Permalink
Merge pull request #130 from jbatalle/master
Browse files Browse the repository at this point in the history
v0.8.0
  • Loading branch information
jbatalle authored Nov 2, 2016
2 parents c64c658 + 4c83bf9 commit 134ac49
Show file tree
Hide file tree
Showing 131 changed files with 3,256 additions and 3,510 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ Gemfile.lock
tmp
.vagrant
**/puma.pid
**/puma.state
**/puma.state
fluentd

65 changes: 65 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
language: ruby
rvm:
- 2.3.1
#cache: bundler
services: mongodb
install:
# - ./dependencies/install_dependencies.sh n y n n
- ./tenor_install.sh 2 localhost
# - cd ns-manager && bundle install --gemfile=Gemfile && cd ../

#env:
# - TEST_DIR=ns-manager
# - TEST_DIR=ns-catalogue
# - TEST_DIR=vnf-catalogue
# - TEST_DIR=.
script:
# - gem uninstall json -v 2.0.2
- cd ns-manager && BUNDLE_GEMFILE=$TRAVIS_BUILD_DIR/ns-manager/Gemfile && bundle update --quiet
- rspec
- rake start &
- cd $TRAVIS_BUILD_DIR
- cd ns-catalogue && BUNDLE_GEMFILE=$TRAVIS_BUILD_DIR/ns-catalogue/Gemfile && bundle update --quiet
- rspec
- rake start &
- cd $TRAVIS_BUILD_DIR
- cd nsd-validator && BUNDLE_GEMFILE=$TRAVIS_BUILD_DIR/nsd-validator/Gemfile && bundle update --quiet
- rspec
- rake start &
- cd $TRAVIS_BUILD_DIR
- cd ns-provisioning && BUNDLE_GEMFILE=$TRAVIS_BUILD_DIR/ns-provisioning/Gemfile && bundle update --quiet
#- rspec
- rake start &
- cd $TRAVIS_BUILD_DIR
- cd vnf-manager && BUNDLE_GEMFILE=$TRAVIS_BUILD_DIR/vnf-manager/Gemfile && bundle update --quiet
#- rspec
- rake start &
- cd $TRAVIS_BUILD_DIR
- cd vnf-catalogue && BUNDLE_GEMFILE=$TRAVIS_BUILD_DIR/vnf-catalogue/Gemfile && bundle update --quiet
- rspec
- rake start &
- cd $TRAVIS_BUILD_DIR
- cd vnfd-validator && BUNDLE_GEMFILE=$TRAVIS_BUILD_DIR/vnfd-validator/Gemfile && bundle update --quiet
- rspec
- rake start &
- cd $TRAVIS_BUILD_DIR
- cd vnf-provisioning && BUNDLE_GEMFILE=$TRAVIS_BUILD_DIR/vnf-provisioning/Gemfile && bundle update --quiet
#- rspec
- rake start &
- cd $TRAVIS_BUILD_DIR
- cd hot-generator && BUNDLE_GEMFILE=$TRAVIS_BUILD_DIR/hot-generator/Gemfile && bundle update --quiet
- rspec
- rake start &
- cd $TRAVIS_BUILD_DIR
- sleep 10
- sleep 20
- curl localhost:4000/
- curl localhost:4000/network-services
- curl localhost:4569/vnfs
- ./tenor_install.sh 6
- curl localhost:4000/network-services
- curl localhost:4000/vnfs
- curl localhost:4000/ns-instances
- cd $TRAVIS_BUILD_DIR
- ruby end_to_end.rb
#execute end-to-end test
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
## 0.8.0
- Changed authentication method. No external entity is required for authentication.
- Authentication between modules enabled when environment is production using JWT.
- Refactors in Provisioning.
- Included Travis-CI.
- Fixes in UI.
- VNFR has a correct reference to NSR.
- Included End-to-end script for tests.

## 0.7.1
- VNF Manager uses the token and tenant_id. Is not using user/pass. This fixes the bug with Keystone v3.
- Exchanging tokens instead of user/pass between NSProvisioner and VNFManager. This fixes the bug with Keystone v3.

## 0.7.0
- Non admin users can use TeNOR. Using already created flavors inside Openstack.
Expand Down
25 changes: 3 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ FROM ruby:2.2.5

MAINTAINER Josep Batallé "[email protected]"
#docker build -t tnova/tenor .
#docker run -itd -p 4000:4000 -p 8000:8000 -p 9000:9000 -v /opt/mongo:/var/lib/mongodb -v /opt/gatekeeper:/root/gatekeeper tnova/tenor bash
#docker run -itd -p 4000:4000 -p 9000:9000 -v /opt/mongo:/var/lib/mongod tnova/tenor bash
#docker run -it tnova/tenor bash
#docker exec -i -t f9ff694e0872 /bin/bash

ENV TENOR_PORT 4000
ENV TENOR_UI_PORT 9000
ENV GK_PORT 8000
ENV MONGODB_PORT 27017

RUN apt-get update
Expand All @@ -28,28 +27,16 @@ RUN apt-get -q -y install \
git nano \
mongodb-org sqlite3 libsqlite3-dev \
byobu \
gcc sudo uuid-runtime
sudo uuid-runtime

RUN rm /bin/sh && ln -s /bin/bash /bin/sh

WORKDIR /root
RUN apt-get -q -y install curl
RUN mkdir -p /usr/local/go && curl https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz | tar xvzf - -C /usr/local/go --strip-components=1

RUN mkdir /opt/go
ENV GOPATH=/opt/go
ENV PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
RUN mkdir -p /opt/go/src/github.com/piyush82
RUN cd /opt/go/src/github.com/piyush82 && git clone https://github.com/piyush82/auth-utils.git
RUN cd /opt/go/src/github.com/piyush82/auth-utils && go get && go install

# Clone the conf files into the docker container
RUN git clone https://github.com/jbatalle/TeNOR /root/TeNOR

RUN mkdir /root/gatekeeper
RUN cp /opt/go/src/github.com/piyush82/auth-utils/gatekeeper.cfg /root/gatekeeper/gatekeeper.cfg
RUN cp /opt/go/src/github.com/piyush82/auth-utils/gatekeeper.cfg /root/TeNOR/gatekeeper.cfg

ENV RAILS_ENV development
WORKDIR /root/TeNOR
RUN bundle --version
Expand All @@ -62,15 +49,9 @@ RUN chown -R mongodb:mongodb /var/lib/mongodb

EXPOSE $TENOR_PORT
EXPOSE $TENOR_UI_PORT
EXPOSE $GK_PORT
EXPOSE $MONGODB_PORT

#update rake start to bundle exec rake start
RUN sed -i 's/rake start/bundle exec rake start/g' /root/TeNOR/invoker.ini

RUN echo -e '#!/bin/bash \n/opt/go/bin/auth-utils &' > gatekeeperd
RUN mv gatekeeperd /etc/init.d/gatekeeperd
RUN chmod +x /etc/init.d/gatekeeperd
RUN chown root:root /etc/init.d/gatekeeperd

ENTRYPOINT /etc/init.d/gatekeeperd start && /etc/init.d/mongod start && invoker start invoker.ini && /bin/bash
ENTRYPOINT /etc/init.d/mongod start && invoker start invoker.ini && /bin/bash
45 changes: 27 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

TeNOR is the NFV Orchestrator platform developed by the [T-NOVA](http://www.t-nova.eu) project, responsible for managing the entire NFV lifecycle service.

[![Build Status](https://travis-ci.org/T-NOVA/TeNOR.svg?branch=master)](https://travis-ci.org/T-NOVA/TeNOR) [![License](https://img.shields.io/badge/License-Apache%202.0-yellowgreen.svg)](https://opensource.org/licenses/Apache-2.0)

## Prerequisites
- Ruby >= 2.2.5 (installation provided in dependencies/install_dependencies.sh)
- Bundler (installation provided in dependencies/install_dependencies.sh)
- Gatekeeper (https://github.com/piyush82/auth-utils). (installation provided in dependencies/install_dependencies.sh)
- MongoDB (installation provided in dependencies/install_dependencies.sh)
- Openstack Juno version or higher

Expand All @@ -22,17 +23,17 @@ TeNOR is the NFV Orchestrator platform developed by the [T-NOVA](http://www.t-no
#Getting started

## Steps
1. Install the prerequisites (Ruby, Gatekeeper and MongoDB). The installation of these requirements is provided a script inside the `dependencies` folder. Use the `install_dependencies.sh` script if you want to install it automatically.
1. Install the prerequisites (Ruby and MongoDB). You can install it using the script located inside the `dependencies` folder. Use the `install_dependencies.sh` script for automatic installation.
2. Install TeNOR (internal dependencies and configurations). Installation script provided in the root folder `tenor_install.sh`.
3. Start TeNOR.
4. Register the internal modules (automatic) and external modules (Mapping, mAPI, WICM, VIMMonitoring, Netfloc...).
5. Register a Network Function Virtualisation Infrastructure Point of Presence (NFVI-PoP) inserting the Openstack credentials into Gatekeeper.
4. Register external modules if installed (Mapping, mAPI, WICM, VIMMonitoring, Netfloc...).
5. Register a Network Function Virtualisation Infrastructure Point of Presence (NFVI-PoP) inserting the Openstack credentials into the authentication module.
6. Test deploying a sample NSD/VNFD to the inserted NFVI-PoP.

## Installation
We provide an installation script for Ubuntu 14.04 that helps with the installation of Ruby, Gatekeeper and MongoDB.
We provide an installation script for Ubuntu 14.04 that helps with the installation of Ruby, MongoDB and RabbitMq.

In order to install Ruby, the MongoDB and Gatekeeper execute the following script:
In order to install Ruby and MongoDB execute the following script:
```
./dependencies/install_dependencies.sh
```
Expand All @@ -46,19 +47,19 @@ Once Ruby is installed (you can be sure of that using `ruby -v` command in the t

A menu will appear and you can choose a number in the menu [1-7].

For TeNOR installation, insert the number 1 and press the Enter Key. The installation will start automatically installing the Ruby Gem dependencies. After few minutes, the script will ask you a set of questions regarding the location of the MongoDB, Gatekeeper. In the case of insert an emty values, the script will use the default values (localhost).
For TeNOR installation, insert the number 1 and press the Enter Key. The installation will start automatically installing the Ruby Gem dependencies. After few minutes, the script will ask you a set of questions regarding the location of the MongoDB and Cassandra (if installed). In the case of insert an emty values, the script will use the default values (localhost).

**Make sure that you have installed a Ruby version >= 2.2.5 and the `bundle` command is installed.**

Once the installation finishes, TeNOR needs to be [started](#execution)

## Vagrant (alternative installation)

A Vagrantfile is provided with TeNOR, Gatekeeper and Mongodb installed.
A Vagrantfile is provided with TeNOR and Mongodb installed.

## Docker (alternative installation)

A Dockerfile is provided that generates a container with TeNOR, Gatekeeper and Mongodb installed. Once is running, all the components are installed and running.
A Dockerfile is provided that generates a container with TeNOR and Mongodb installed. Once is running, all the components are installed and running.

1. Build it with:

Expand All @@ -68,7 +69,7 @@ A Dockerfile is provided that generates a container with TeNOR, Gatekeeper and M
2. Run the container with:
````
docker run -itd -p 4000:4000 -p 8000:8000 -p 9000:9000 -v /opt/mongo:/var/lib/mongodb -v /opt/gatekeeper:/root/gatekeeper tnova/tenor bash
docker run -itd -p 4000:4000 -p 9000:9000 -v /opt/mongo:/var/lib/mongodb tnova/tenor bash
````
3. Then, you can test TeNOR ([Test if TeNOR is installed and running](#test-if-tenor-is-installed-and-running)), and you can access to the command line with:
Expand Down Expand Up @@ -110,7 +111,7 @@ Basic keys for using Byobu:
- F3 and F4 for navigate through the windows
- F6 exit from Byobu
## Registering modules in TeNOR and Gatekeeper
## Registering modules in TeNOR
TeNOR has a microservice architecture and requires a registration of each microservices to the system. The NS Manager (API gateway) is the responsible to manage this registration. The internal TeNOR modules are managed automatically, but external modules like mAPI, WICM, Infrastructure repository and Netfloc needs to be registered.
The registration of modules can be done with in three ways:
Expand All @@ -122,11 +123,11 @@ The registration of modules can be done with in three ways:
- Using the following script:
`./loadModules.sh`
The content of the loadModules.sh is a set of CuRL request to the NS Manager inserting the IP and PORT of each microservice. When the NS Manager recevies the requests, automatically register each module into Gatekeeper in order to generate a microservice-token.
The content of the loadModules.sh is a set of CuRL request to the NS Manager inserting the IP and PORT of each microservice. When the NS Manager recevies the requests, automatically register each module in order to generate a microservice-token.
## Loading NFVI-PoP information in Gatekeeper
## Loading NFVI-PoP information in TeNOR
The PoP information is saved in Gatekeeper. First of all, TeNOR recevies the registration requests and validates the authentication. If it works, TeNOR saves the PoP in Gatekeeper. The PoP can be inserted in two manners:
The PoP information is saved in the Authentication module. First of all, TeNOR recevies the registration requests and validates the authentication. If it works, TeNOR saves the PoP. The PoP can be inserted in two manners:
- Using the TeNOR User Interface:
`Configuration -> PoPs`
Expand All @@ -139,10 +140,10 @@ TeNOR has a User Interface that provides a global view of the all the orchestrat
This user interface is located in the `ui` folder and contains their own README file with the installation guide.
The UI uses Gatekeeper for authentication, so by default you need to use the default created user in Gatekeeper: t-nova-admin. Then, for the login:
The UI has a default user for authentication, the credentials are (can be changed in the UI):
- Username: t-nova-admin
- Password: Eq7K8h9gpg
- Username: admin
- Password: adminpass
#Initial steps
Expand Down Expand Up @@ -207,6 +208,14 @@ The provided examples are:
You can test it using the same commands shown before but chaning the file.
### End-to-end tests
We provide a script that executes an End-to-End test. You only need the PoP credentials before to execute the script. So, please modify the file ` env_end_to_end.sh ` with the correct values and execute the script: ` . ./env_end_to_end.sh `
Then, you can execute the script with the following command:
` ruby end_to_end.rb `
The following items will be created: a set of PoPs with different configurations, a sample NSD/VNFD and the instantiation for each PoP. After the execution, the created components will be removed automatically.
## Logs
TeNOR uses Fluentd in order to store the logs in a MongoDB. The UI inlcudes a view that allows to browser through the logs based on the date, severity and module.
Expand All @@ -216,7 +225,7 @@ In each VNFD can have 5 types of lifecycle event: start, stop, restart, scaling_
- Get PublicIp of port in a VDU: get_attr[vdu0,CP5v7d,PublicIp]
- Get PrivateIp of port in a VDU: get_attr[CPr3k7,fixed_ips,0,ip_address]
- Get the last VDU for scaling-out: get_attr[vdu1,vdus]
- Get the last PrivateIps for scaling-out: gig-adaet_attr[CPsx4l,fixed_ips,0,ip_address]
- Get the last PrivateIps for scaling-out: get_attr[CPsx4l,fixed_ips,0,ip_address]
- Get the last PublicIps for scaling-out: get_attr[vdu0,CPudhr,PublicIp]
- Timeout before remove instance due scale-in event:
Expand Down
13 changes: 3 additions & 10 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Vagrant.configure(2) do |config|

$script = <<-SCRIPT
sudo apt-get update
sudo apt-get install -y gcc git
sudo apt-get install -y git
sudo apt-get remove --purge ruby-rvm ruby
sudo rm -rf /usr/share/ruby-rvm /etc/rmvrc /etc/profile.d/rvm.sh
rm -rf ~/.rvm* ~/.gem/ ~/.bundle*
Expand All @@ -38,17 +38,10 @@ Vagrant.configure(2) do |config|
cd ~
git clone https://github.com/TeNOR/TeNOR.git
cd TeNOR/
./dependencies/install_dependencies.sh y y n n
./dependencies/install_dependencies.sh y y n
#. ~/.rvm/scripts/rvm
./tenor_install.sh 1
echo -e '#!/bin/bash \ncd /home/vagrant \ngo/bin/auth-utils &' > ~/gatekeeperd
sudo mv ~/gatekeeperd /etc/init.d/gatekeeperd
sudo chmod +x /etc/init.d/gatekeeperd
sudo chown root:root /etc/init.d/gatekeeperd
sudo update-rc.d gatekeeperd defaults
sudo update-rc.d gatekeeperd enable
#sudo service gatekeeperd start
./tenor_install.sh 1 localhost
SCRIPT

config.vm.provision 'shell', inline: $script, privileged: false
Expand Down
Loading

0 comments on commit 134ac49

Please sign in to comment.