This is SONATA's Service Platform Gatekeeper's repository.
The Gatekeeper is the component that implements all the Northbound Interface (NBI) of the Servive Platform.
This NBI provides systems like the son-push, son-gui and son-bss access to the Service Platform, for features like:
- accepting new developers' to be part of the contributors of new developed services;
- accepting new services, in the package format, to be deployed in the platform;
- validating submited packages, both in terms of file format and developer submitting the package;
- accepting new service instance requests from customers interested in instantiating a service;
- following a service performance through automatically monitoring each on-boarded service or function;
- etc..
This section details what is needed for developing the Gatekeeper.
This repository is organized by micro-service (one folder to one micro-service).
Micro-services currently implemented are the following:
son-gtkapi
: the only 'door' to the Gatekeeper, where the API is exposed;son-gtkpkg
: where all Packages features are implemented;son-gtksrv
: where all Services features are implemented;son-gtkfnct
: where all Functions features are implemented;son-gtkvim
: where all Vims features are implemented;son-gtkrec
: where all Records' features are implemented;son-gtklic
: where all Licences' features are implemented;son-gtkusr
: where all Users' features are implemented;son-gtkkpi
: where all KPIs' features are implemented;
The last three micro-services are still a work in progress. Most of these micro-services have been implemented using ruby
programming language and the sinatra
framework. The exception is the son-gtklic
, which is implemented in python
. The only need is that the micro-service to be implemented provides a REST API, whatever the language it is implemented in.
'Building' the Gatekeeper, given the approach mentioned above, is more like 'composing' it from the available micro-services. So:
- each micro-service is provided in its own container (we're using
docker
); - the
Dockerfile
in each folder specifies the environment the container needs to work; - the
docker-compose.yml
file in the root of this repository provides the linking of all the micro-services.
The libraries the Gatekeep depends on are the following:
activerecord
>=5.0.0 (MIT)addressable
>=2.4.0 (Apache 2.0)bunny
>=2.4.0 (MIT)ci_reporter
>=2.0.0 (MIT)ci_reporter_rspec
>=1.0.0 (MIT)foreman
>=0.82.0 (MIT)pg
>=0.18.4 (MIT)puma
>=3.4.0 (BSD-3-CLAUSE)rack-parser
>=0.7.0 (MIT)rack-test
>=0.6.3 (MIT)rake
>=11.2.2 (MIT)rest-client
>=2.0.0 (Apache 2.0)rspec
>=3.5.0 (MIT)rspec-core
>=3.5.1 (MIT)rspec-expectations
>=3.5.0 (MIT)rspec-its
>=1.2.0 (MIT)rspec-mocks
>=3.5.0 (MIT)rspec-support
>=3.5.0 (MIT)rubocop
>=0.41.2 (MIT)rubocop-checkstyle_formatter
>=0.2.0 (MIT)ruby
>=2.2.0 (MIT)rubyzip
>=1.2.0 (BSD-2-CLAUSE)sinatra
>=1.4.7 (MIT)sinatra-active-model-serializers
0.2.0 (MIT)sinatra-activerecord
2.0.4 (MIT)sinatra-contrib
>=1.4.7 (MIT)sinatra-cross_origin
>=0.3.2 (MIT)sinatra-logger
>=0.1.1 (MIT)webmock
>=2.1.0 (MIT)
For the micro-services implemented in ruby these dependencies can be checked in each folder's Gemfile
.
Contributing to the Gatekeeper is really easy. You must:
- Clone this repository;
- Work on your proposed changes, preferably through submiting issues;
- Submit a Pull Request;
- Follow/answer related issues (see Feedback-Chanel, below).
Installing the Gatekeeper is really easy. You'll need:
- the ruby programming language: we prefer doing this by using a version manager tool such as rvm or rbenv (we are using version 2.2.3);
- in each one of the subfolders, just run:
bundle install
- please follow each specific folder's instructions on which environment variables to set
foreman start
We do three kinds of automated tests:
- Unit tests, which are done with the
RSpec
framework (see the./spec/
folder); - Integration tests, which are done with a set of
shell
scripts and thecurl
command (see theson-tests
); - White-box tests, which are done by using the
ci_reporter
gem
, generatingXML
reports by executing the command
$ bundle exec rake ci:all
everytime a pull request is done.
Please see the several levels of tests that may be considered.
Please refer to the son-gtkapi
repository and each one of the other folders in this repository for examples of usage of each one of the already developed micro-services.
The license of the SONATA Gatekeeper is Apache 2.0 (please see the license file).
The following lead developers are responsible for this repository and have admin rights. They can, for example, merge pull requests.
- José Bonnet (jbonnet)
- Felipe Vicens (felipevicens)
Please use the GitHub issues and the SONATA development mailing list [email protected]
for feedback.