Deliverable 4.2 Integration Guidelines & Open DMP v2: Enabling Smart Energy As A Service Via 5G Mobile Network Advances
Deliverable 4.2 Integration Guidelines & Open DMP v2: Enabling Smart Energy As A Service Via 5G Mobile Network Advances
Ares(2020)1416866 - 06/03/2020
H2020-ICT-762013: NRG-5
D4.2: Integration Guidelines & Open DMP v2
Deliverable 4.2
Integration Guidelines & Open DMP v2
Author(s): RWTH, POPs
Status -Version: Final
Delivery Date (DOW): 30th November 2018
Actual Delivery Date: 06 March 2020
Distribution - Confidentiality: Public
Code: 10.5281/zenodo.1240277
Abstract:
This document is the updated version of D4.1, which includes the NRG-5 Data Management Plan (DMP)
and the Integration Guidelines. The document is due in project month M18. After that, it will be
maintained as a living document.
In particular, this deliverable provides a description of data management in the project, identifies different
data sets including data security and privacy aspects. The expected data to be used and generated in
the project is categorized by datasets and organized in factsheets. A detailed description of filetypes
used in the project is reported in this document. A description of the different Virtual Network Functions
and Application logic metadata takes place, reflecting the questions asked by the DMP. The different
aspects of making data Findable, Accessible Interoperable and Re-usable (FAIR) are discussed.
In the second part of this document, software integration infrastructure, techniques for software quality
assurance and general best practices used in NRG-5 are described. The focus is set on continuous
integration and continuous delivery of the software developed in the project, which as a result will
decrease the time between development and deployment or update on the target system. Deployment
and integration recipes, used in NRG-5, are also presented in this deliverable.
Disclaimer
This document may contain material that is copyright of certain NRG-5 beneficiaries, and may not be
reproduced or copied without permission. All NRG-5 consortium partners have agreed to the full
publication of this document. The commercial use of any information contained in this document may
require a license from the proprietor of that information.
The NRG-5 Consortium is the following:
Participant Short
Participant organisation name Country
number name
01 Engineering-Ingegneria Informatica SPA ENG Italy
02 THALES Communications & Security TCS France
03 SingularLogic S.A. SiLO Greece
04 Ineo Energy & Systems ENGIE France
05 Romgaz S.A RGAZ Romania
06 ASM Terni SpA ASM Italy
07 British Telecom BT UK
08 Wind Telecomunicazioni S.P.A. WIND Italy
09 Hispasat S.A. HIS Spain
10 Power Operations Limited POPs UK
11 Visiona Ingenieria De Proyectos SI VIS Spain
12 Optimum S.A OPT Greece
13 Emotion s.r.l EMOT Italy
14 Rheinisch-Westfälische Technische Hochschule Aachen RWTH Germany
15 Jožef Stefan Institute JSI Slovenia
16 TEI of Sterea Ellada/Electrical Engineering Dept. TEISTE Greece
17 Sorbonne Université SU France
18 Centro Romania Energy CRE Romania
19 Rutgers State University of New Jersey Rutgers USA
The information in this document is provided “as is” and no guarantee or warranty is given that the
information is fit for any particular purpose. The user thereof uses the information at its sole risk and
liability.
Table of Contents
1 Introduction __________________________________________________________________ 8
2 Data Management Plan ________________________________________________________ 9
2.1 Introduction ______________________________________________________________________________ 9
2.2 Data Summary ____________________________________________________________________________ 9
2.2.1 List of datasets .............................................................................................................................................. 9
2.2.2 Topology and asset description .................................................................................................................. 11
2.2.3 Video recordings / CCTV .............................................................................................................................. 13
2.2.4 Measurement data ..................................................................................................................................... 15
2.2.5 Log and access data .................................................................................................................................... 17
2.2.6 Prediction, forecast and planning data ....................................................................................................... 19
2.2.7 Positioning and location data ..................................................................................................................... 21
2.2.8 Codes........................................................................................................................................................... 22
2.2.9 Configuration and Orchestration data ........................................................................................................ 22
2.2.10 File type description .................................................................................................................................... 24
2.2.11 Description of the software products .......................................................................................................... 33
2.3 FAIR data ________________________________________________________________________________ 41
2.3.1 Findable data .............................................................................................................................................. 41
2.3.2 Accessible data ........................................................................................................................................... 42
2.3.3 Interoperable data ...................................................................................................................................... 43
2.3.4 Re-usable data ............................................................................................................................................ 43
2.4 Allocation of resources _____________________________________________________________________ 43
2.5 Data security _____________________________________________________________________________ 44
2.6 Ethical aspects____________________________________________________________________________ 44
3 Integration Guidelines_________________________________________________________ 46
3.1 Introduction _____________________________________________________________________________ 46
3.2 Software ________________________________________________________________________________ 46
3.2.1 Conventions ................................................................................................................................................ 46
3.2.2 What is CI/CD .............................................................................................................................................. 48
3.2.3 Integration of VNFs ..................................................................................................................................... 52
4 References __________________________________________________________________ 54
5 Annex ______________________________________________________________________ 56
5.1 Python web service docker deployment _______________________________________________________ 56
5.2 Python web service direct installation with testing ______________________________________________ 57
5.3 Java web service served by Tomcat ___________________________________________________________ 58
5.4 Generic VNF update _______________________________________________________________________ 58
5.4.1 The NRG-5 CI/CD framework ...................................................................................................................... 64
Table of Figures
List of Abbreviations
5G-PPP 5G Infrastructure Public Private Partnership
AMIaaS Advanced Metering Infrastructure as a Service
API Application Programming Interface
ATEX ATmosphères EXplosibles EU directive 99/92/EC or 94/9/EC
CCTV Closed Circuit Television
CD Continuous Delivery
CERN European Organization for Nuclear Research
CI Continuous Integration
DC Data Centre
DevOps Development and Operations
DMP Data Management Plan
DOI Digital Object Identifier
DR Demand Response
DDRaaS Dispatchable Demand Response as a System
EU European Union
EV Electric Vehicle
EVSE Electric Vehicle Supply Equipment
FIT Future Internet Testing Facility
IG Integration Guidelines
NFV Network Function Virtualization
NORM Next generation Open Real-time Meter
NS Network Service
PMaaS Predictive Maintenance as a Service
PMU Phasor Measurement Unit
REST Representational State Transfer
SDN Software defined network
UC Use Case
uMTC Massive Machine Type Communication
uRLLC Ultra Reliable and Low Latency Communication
VNF Virtual Network Function
VNFFP Virtual Network Functions Forwarding Path
VNFFG Virtual Network Functions Forwarding Graph
xMEC extended Mobile Edge Cloud
© The NRG-5 consortium partners, 2017 6
H2020-ICT-762013: NRG-5
D4.2: Integration Guidelines & Open DMP v2
1 Introduction
The handling of data by means of different data types, restriction for privacy and openness is an
important part of projects with multiple partners. If there is software development involved in the project,
then the project partners need to clarify how - and according to which coding standards - they intend to
develop software. Both aspects are considered in this document. Chapter 2 will be the Data
Management Plan (DMP), while Chapter 3 will contain Integration Guidelines (IG), where a further
discussion regarding the software aspects is provided.
The DMP is a formal description of the procedures of data handling during and after a project. By
providing an assessment of data used in a project and a structured approach for aspects such as
naming conventions, metadata and versioning, the DMP should also support data quality, efficient
processing and sharing of data. This is required for projects in the Horizon 2020 framework program,
which have not opted out of the Open Research Data Pilot [1].
The IG are a description on how the developers of the different partners are developing and handling the
source code. In a modern development environment, continuous integration plays a major role to support
the developer with automated code testing and deployment. To make transfer and reusability easier for
the partners but also for possible third-party users, the partners have to agree on the IG on a formal
level.
Naturally, not all questions regarding the handling and type of data and source code can be answered at
the first stages of a project, as procedures have to be coordinated and implemented and the
infrastructure has to be set up. To meet this lack of knowledge, the entire deliverable is meant to be a
living document, which should be adapted and completed during the project lifetime. The first document
version has been released in deliverable D4.1 “Open Data Management Plan & Integration Guidelines
V1” in M06. The present document, “Integration Guidelines & Open DMP v2”, is an updated version of
D4.1.
The following datasets have been identified to appear in the NRG-5 project and will be described in more
detail in the following subchapters. Since this document is considered a living document, changes or
additions may be made later on and the information about the datasets is not necessarily complete.
Each table (fact sheet) is divided into two parts. First, there is a generic description and an example for
the dataset, together with general security and privacy considerations. Then, the dataset specific for that
fact sheet is divided into datatypes. This sub-division should take into account the diversity of data
generated during the project. With that information, the DMP can identify the potential of data generated
by a partner even if another partner is generating the same data from a different source. This
terminology is flexible in adding datasets, datatypes or a new partner who is generating the same kind of
data but with different content.
The generic information in the datasets is based on the Grant Agreement. The content for the dataset is
based on either the Grant Agreement or information gathered from the project partners.
A map with information MBs to 1 GB Access will be provided, if The facility is critical
about industrial needed for the project infrastructure therefore the
structures e.g. buildings, objectives. data cannot be made public
energy lines, pylons of
Pilot#1.
Information about MBs to 1 GB Access will be provided, if The facility is critical
forbidden zones, public needed for the project infrastructure therefore the
or industrial restrictions objectives. data cannot be made public
(e.g. ATEX zones) at
Pilot#1 will be provided.
Information about the 2 kB/sec Due to the sensitive nature Due to the sensitive nature
energy consumption of of the data, available only of the data, they will only be
the EV chargers will be after request and proper available on application and
measured. statement of purpose. their use, only of their own
data
The state of charge of 0.2 kB/sec Due to the sensitive nature Due to the sensitive nature
EV’s will be measured. of the data, available only of the data, they will only be
after request and proper available on application and
statement of purpose. their use, only of their own
data
(SU) Will provide data Hundreds of All the partners have access SU promotes the open
gathered from use of the KBs to the data access data policy.
FIT platform.
Log data from trials will be Very large All data acquired by NORM, Due to the sensitive nature
gathered GBs subject of privacy data of the data they will only be
consent between end-user available on application and
and site responsible their use, only of their own
data
(VIS) Log data from Some MBs All data acquired by NORM, Due to the sensitive nature
SDN’s will be used subject of privacy data of the data they will only be
consent between end-user available on application and
and site responsible their use, only of their own
data
(VIS) Access data from Some MBs All data acquired by NORM, Due to the sensitive nature
SDN’s will be used subject of privacy data of the data they will only be
consent between end-user available on application and
and site responsible their use, only of their own
data
2.2.8 Codes
push services
Relation to project Building a CI/CD environment is part of the project. To automatically
objective deliver software, configuration files are needed. Further information about
CI/CD can be found in Section 3.2.2
File types .sh, .json, .xml, .custom1
(Data provider) Origin of Size Access for Partners Access for the public
the data (xByte)
(VIS) Configuration files A few MBs Due to the sensitive nature Due to the sensitive nature
for running software will of the data, they will only be of the data they will not be
be created. available to the pilot partner released to the public
running each trial
(VIS) Credentials for A few MBs Due to the sensitive nature Due to the sensitive nature
different services will be of the data they will not be of the data they will not be
provided. released to all partners but released to the public
rather only to integrating
ones
In this paragraph, the file types identified in the previous datasets are described. For every file type a
short description is provided which will answer the following requirements/questions:
- Describe the file type.
- What software is needed to open the file?
- Is there a standard which describes the file in detail?
- In the case of file types defined by a partner, describe the content definition.
2.2.10.2 .c
Description:
A C file is a source code file for a C or C++ program. It may include an entire program source code, or
may be one of many source files referenced within a programming project.
Software:
Any text editor like Notepad++, Emacs, the Windows Notepad program, EditPlus, TextMate, and others,
can open and view a C file if it's a C/C++ Source Code file. Most of them support syntax highlighting,
which is usually preferred since it makes editing and sifting through the source code much easier.
However, C files are usually opened within the context of a software development program like Visual
Studio, Eclipse, C++Builder, Dev-C++, or Code::Blocks.
Standard:
A C library reference guide can be found in [5]. The C programming language standard is given in [6].
Software:
CPP files are most commonly edited with programs that provide syntax highlighting. CPP files may still
be opened using any text editor, but programs that provide syntax highlighting, auto-completion, and
other helpful tools are most often used. However, CPP files are usually opened within the context of a
software development program like Visual Studio, Eclipse, C++Builder, Dev-C++, or Code::Blocks.
© The NRG-5 consortium partners, 2017 24
H2020-ICT-762013: NRG-5
D4.2: Integration Guidelines & Open DMP v2
Standard:
The interface of C++ standard library is defined in [7].
Software:
CSS files can be opened and edited with programs such as Novell Extend Director.
Standard:
A CSS developer guide can be found in [8]. The CSS specifications are maintained by the World Wide
Web Consortium (W3C). Internet media type (MIME type) text/css is registered for use with CSS by
RFC 2318 (March 1998). The W3C operates a free CSS validation service for CSS documents [9].
Software:
The CSV data exchange format is supported by a large amount of personal, business, and scientific
programs. Because of its wide support, the format is especially useful in transferring tabular data
between programs (e.g. KSpread, OpenOffice Calc and Microsoft Excel). Many other applications
support CSV in some fashion, to import or export data.
Standard:
The CSV file format is not fully standardized. RFC 4180 [10] proposes a specification for the CSV format,
and this is the definition commonly used.
The standard for data interchange of encrypted data will be negotiated per individual case.
Standard:
The complete specification for GPX files can be found at [11].
2.2.10.8 .h (Header)
Description:
An H file is a header file referenced by a C, C++ or Objective-C source code document. It may contain
variables, constants, and functions that are used by other files within a programming project. H files
allow commonly used functions to be written only once and referenced by other source files when
needed.
Software:
H header files can be opened with many programs, like Visual Studio, Eclipse, C++Builder, Dev-C++, or
Code::Blocks.
Standard:
For standard specification, more information can be found at [6] and [12].
2.2.10.10 .java
Description:
A JAVA file is a source code file written in the Java programming language, which was originally
developed by Sun Microsystems but is now maintained by Oracle. It uses an object-oriented approach,
where structured data types, called “classes”, are used to instantiate objects at runtime. A file with the
JAVA extension may contain a single Java program or a variety of source code files that are combined
into a single executable app. Many compilers use these files to create Java source code.
Software:
JAVA files are opened with common text editors and programs like Eclipse. JAVA source code files are
compiled into CLASS files using a Java compiler (javac command). A CLASS file contains bytecode
that can be executed by the Java Virtual Machine (JVM). The JVM can be downloaded for every major
operating system, including Windows, Mac OS X, and Linux.
Standard:
JAVA specifications are reported in [14].
2.2.10.11 .jpg
Description:
A JPG file is an image saved in a compressed image format standardized by the Joint Photographic
Experts Group (JPEG). It is commonly used for storing digital photos and used by most digital cameras
to save images. JPG files are among the most common image files along with .PNG, .TIF, and .GIF.
Software:
There are a lot of different examples for software with which JPG files can be opened. GIMP is one of
them which is open-source and available for the different operating system platforms. More information
about GIMP and a download source can be found on the GIMP webpage [19].
Standard:
The file type is defined in ISO/IEC 10918 and more material can be found in [15].
Standard:
The file type is standardized in two competing standards, namely RFC7159 and ECMA-404 [16].
Software:
Files that actually have the MPEG file extension can be opened with many different multi-format media
players, like Windows Media Player, VLC, QuickTime, iTunes, and Winamp. Some commercial software
that support playing MPEG files include Roxio Creator NXT Pro, CyberLink PowerDirector, and
CyberLink PowerDVD. Some of these programs can open MPEG1, MPEG2, and MPEG4 files, too. VLC,
in particular, is known for its support for a huge range of audio and video file formats.
Standard:
More information regarding the MPEG specifications can be found in [19].
Description:
In the field of computer network administration, PCAP consists of an application programming interface
(API) for capturing network traffic. Unix-like systems implement PCAP in the libpcap library; Windows
uses a port of libpcap known as WinPcap. Monitoring software may use libpcap and/or WinPcap to
capture packets travelling over a network and, in newer versions, to transmit packets on a network at the
link layer, as well as to get a list of network interfaces for possible use with libpcap or WinPcap.
Software:
The PCAP API is written in C, so other languages such as Java, .NET languages, and scripting
languages generally use a wrapper. C++ programs may link directly to the C API or use an object-
oriented wrapper.
Standard:
PCAP specifications can be found in [20].
Software:
The default photo viewer program in Windows is often used to open PNG files because it's included as
part of a standard Windows installation, but there are many other ways to view one. All web browsers
(like Chrome, Firefox, Internet Explorer, etc.) will automatically view PNG files opened from the internet,
without need of downloading every PNG file. There are also several standalone file openers, graphic
tools, and services that open PNG files. A few popular ones include XnView, IrfanView, FastStone Image
Viewer, Google Drive, Eye of GNOME, and gThumb. To edit PNG files, the XnView program just
mentioned can be used, as well as the Microsoft Windows included graphics program called Paint, the
Windows 10 Paint 3D tool, the popular GIMP utility, and the very popular (although not free) Adobe
Photoshop.
Standard:
PNG specifications are given in [21].
Software:
PY files can be created in any text editor, but need a Python interpreter to be read.
Standard:
PY reference documentation can be found in [22].
2.2.10.20 .raw
Description:
A RAW file is an image (not yet processed) generated by digital cameras such as Panasonic, Leica, and
Casio cameras. It contains uncompressed, raw image data that can be adjusted for exposure and white
balance using software that supports the format. RAW files are used for storing unaltered image data as
captured by a digital camera's CCD.
Software:
Several image tools support camera raw formats, many of which also advertise support for files that end
in the RAW extension. Some of these programs include Microsoft Windows Photos, Able RAWer, GIMP
(with UFRaw plug-in), and RawTherapee - all free. Although certainly not free, Adobe Photoshop also
supports a number of RAW formats.
Standard:
Providing a detailed and concise description of the content of raw files is highly problematic. There is no
single raw format; formats can be similar or radically different. Different manufacturers use their own
proprietary and typically undocumented formats, which are collectively known as RAW format. The ISO
standard raw image format is ISO 12234-2, better known as TIFF/EP. (TIFF/EP also supports "non-raw",
or "processed", images). More informations regarding the standard can be found in [23].
Software:
SH files can typically only be used on computers that are run on the Unix operating system, although
systems similar to Unix may also use this file format. SH can be opened by programs like Notepad++
and gVim.
Standard:
Software:
SOL files are supported by Dapp, which is a Solidity package manager, build tool, and deployment
assistant. They are also supported by various programs with the Solidity plug-in installed, such as Visual
Studio, Visual Studio Code, Vim, and Sublime Text.
Standard:
A file with the TIF or TIFF file extension is a Tagged Image file, used for storing high-quality raster type
graphics. The format supports lossless compression so that graphic artists and photographers can
archive their photos to save on disk space without compromising quality.
Software:
For just viewing a TIF file without editing it, any photo viewer included in any operating system will work
perfectly fine. For working with TIFF/TIF files directly, free photo editing programs like GIMP can be
used. Other popular photo and graphics tools work with TIF files as well, most notably Adobe Photoshop,
but that program is not free.
Standard:
Information can be found in [26].
2.2.10.24 .txt
Description:
TXT is a file extension for a text file, used by a variety of text editors. TXT is a human-readable
sequence of characters and the words they form that can be encoded into computer-readable formats.
Software:
TXT files are recognized by any text editing or word processing program and can also be processed by
most other software programs.
Standard:
There is no standard definition of a text file, though there are several common formats, including ASCII
(a cross-platform format), and ANSI (used on DOS and Windows platforms). Information can be found in
[27].
Description:
An XLS file is a spreadsheet file created by Microsoft Excel or exported by another spreadsheet
program, such as OpenOffice Calc or Apple Numbers. XLSX is the compressed version. It contains one
or more worksheets, which store and display data in a table format. XLS files may also store
mathematical functions, charts, styles, and formatting.
Software:
XLS files can be opened by Microsoft Excel but also (between the others) by Microsoft Excel Viewer and
OpenOffice.
Standard:
More information are given in [28].
Description:
XML is a file extension for an Extensible Markup Language (XML) file format used to create
common information formats and share both the format and the data on the World Wide Web, intranets,
and elsewhere using standard ASCII text. They are plain text files that don't do anything in and of
themselves except describe the transportation, structure, and storage of data.
XML is similar to HTML. Both XML and HTML contain markup symbols to describe the contents of a
page or file. XML is considered extensible because, unlike HTML, the markup symbols are unlimited and
self-defining. XML is a simpler and easier-to-use subset of the Standard Generalized Markup Language
(SGML) standard for how to create a document structure. It is expected that HTML and XML will be used
together in many Web applications. XML markup, for example, may appear within an HTML page.
Software:
XML files have become a standard way of storing and transferring data between programs and over the
Internet. However, they can be used by many other types of programs. The XML syntax has been
utilized in a large variety of file formats, such as Microsoft Office Open XML, LibreOffice OpenDocument,
© The NRG-5 consortium partners, 2017 32
H2020-ICT-762013: NRG-5
D4.2: Integration Guidelines & Open DMP v2
.XHTML, and .SVG. Many programs open XML files, including Code Beautify's Online XML Viewer and
some web browsers. There are several popular programs that can edit XML files as well. Some notable
free XML editors include Notepad++ and XML Notepad 2007. EditiX and Adobe Dreamweaver are a
couple other popular XML editors but they are only free to use if you can manage to get a trial version.
Standard:
More information are given in [29].
In the following, the details for each VNF/application logic are provided according to a standard table.
2.2.11.1 vTSD
VNF description
Source Code
Size Approx. 10KB
File types .py
2.2.11.2 vSON
VNF description
Source Code
Size Approx. 50KB
File types .py
2.2.11.3 vDES
VNF description
Source Code
Size Approx. 50KB
File types .py
2.2.11.4 vMME
VNF description
2.2.11.5 vRES
VNF description
Source Code
Size In the range of MBs
File types .py
2.2.11.6 vMCM
VNF description
2.2.11.7 vBCP
VNF description
Source Code
Size At the level of KBs
File types .py, .sh
2.2.11.8 vAAA
VNF description
Source Code
Size At the level of KBs
File types .js, .sol
2.2.11.9 vMPA
VNF description
Size ~6 Gb
Access Only for partners until the end of the project. Developments ongoing.
Image processing analyzer to recognize and alert some well defined
patters that ENGIE (gas plant operator) told VIS to search: field
Purpose
changes, color changes in vegetation, people and vehicle detection and
hot points.
Relation with the project Processing of the images taken by the drone and raise alerts.
Security and privacy To access videos and alerts, an authentication and authorization
considerations method has been implemented. Users have to be set up.
Source Code
Size ~100 Mb + libraries
File types .py, .sh
Security and privacy
Algorithms are proprietary. An executable can be provided.
considerations
2.2.11.10 vDFC
VNF description
Size ~100 MB
Access Only for partners until the end of the project. Developments ongoing.
Purpose Control of the drone through a VNF.
Drone is the main tool used in preventive maintenance for critical
Relation with the project
infrastructure.
Authentication and authorisation mechanism has been built. Users have
Security and privacy to be set up to enter the application of the VNF. User level users are
considerations only able to read parameters while admin level users are able to
interact with the drone.
Source Code
Size ~3 Mb
File types .sh, .py, .json, .yml, .html, .js, .css
Security and privacy
Private repository.
considerations
2.2.11.11 vPMU
VNF description
2.2.11.12 vESR
VNF description
Source Code
Size 10-20 MB
File types .cpp
Security and privacy The source code itself should not contain any safety relevant
considerations information and therefore can be made publicly available.
Source Code
Size 10-20 MB
File types .py
Security and privacy The source code itself should not contain any safety relevant
considerations information and therefore can be made publicly available
2.2.11.13 AMIaaS
2.2.11.14 DDRaaS
2.2.11.15 PMaaS
Size 6 Gb
Access Only to the users involved, by means of username and password.
The purpose of PMaaS is to control and supervise drone flights for
Purpose
maintenance and supervision.
Relation with the project The PMaaS is essential to perform the demonstration of the UC2.
During tests of the PMaaS use case no image data of people faces
Security and privacy
(from people of outside the project) are recorded. Recordings of critical
considerations
infrastructure are always coordinated closely with the infrastructure
It should be remarked that security and privacy considerations for VNFs/Application logics and the
associated source code highly depend on their nature and purpose. Furthermore, the developed
software may contain company secrets of one or multiple partners which are involved in the
development. In that case this particular software or source code may not be published openly.
Nevertheless all involved partners will do their best to grant public open access to developed software,
promoting the FAIR data principle (Section 2.3). Where eligible, authentication/authorization
mechanisms and restricted access will be put in place in the case of software products which are built for
purposes related to critical fields (e.g., energy markets, electric substation control, etc.) or deal with data
containing personal information.
Findable data Clear naming and versioning of (meta-) data, use of search keywords and DOI
Accessible data Specification of how data are made available and what tools are needed to access
data
Interoperable data Use of standards and vocabularies for (meta-)data and datatypes
Reusable data Specification of when - and for which duration - data are made available, licensing
of data
Parts of the data gathered during the project could be used to identify subjects, both individuals and
business entities. Before making data public, compliance with EU 2016/679 [30] regulation must be
checked.
Besides that, it may be part of the project to gather private, sensitive or security relevant data. Therefore,
each specific category of data needs to be assessed. After that, a decision is taken about making that
particular data type public or not.
The effort spent for data assessment should be reasonable compared to the foreseen value of the FAIR
data.
First, to make the data generated by the NRG-5 project Findable (FAIR), a fixed naming and versioning
convention is needed. For documents, this convention was defined during the project kick-off. In
particular, deliverables and working documents should be named as follows:
Deliverables: NRG5_Dw.d_ACR_Vx.y-YYYYMMDD.ext
Working Documents: NRG5_Ww_Ttt_ACR_Vx.y-YYYYMMDD.ext
Where w is the work package number
d is the deliverable number
tt is the task number
ACR is the partner acronym
x is the version major number
y is the version minor number
YYYY is the year
MM is the month
DD is the day
ext is the file extension
Besides the naming convention, the “Guidelines on FAIR Data Management in Horizon 2020” [1] also
propose to have DOI for the data generated during the project. For this purpose, the project will use the
Zenodo platform [31] to fulfil the DOI requirement. In particular, Zenodo is a platform for long term
storage of data. The service is provided by CERN and financed by the EU. The platform can handle
single datasets of size up to 50 GB. If more storage space per dataset is needed, the user is encouraged
to contact CERN itself. The amount of space is not limited. The platform intends to help research project
to share data all over the world. To do so, Zenodo also helps by defining and storing some additional
metadata provided by the uploader. It is possible to grant access to the data only to a specific group of
users or the public. The platform also gives the user the possibility to restrict or open access to data for a
fixed period of time.
Another important part of the FAIR data principle is to make the data Accessible (FAIR) to the project
partners and, when possible, also to other researchers and to the public. To do so, NRG5 project will use
the Zenodo platform [31] for making the data accessible, when the consortium decides for a data open
access.
In the project, while Zenodo platform will be used for storing data such as project deliverables, GitLab
[32] will be used for the storage of any kind of software product. In particular, GitLab is a web-based
hosting service for version control, mostly used for computer code. It offers the functionality of distributed
version control and source code management, providing access control and several collaboration
features like task management, feature requests and bug tracking for every project. Projects on GitLab
can be accessed and manipulated using the standard Git command-line interface and all of the standard
Git commands work with it. GitLab also allows registered and non-registered users to browse public
repositories on the site.
The set of data collected and intended to be made available on a public platform must have a
broadcasting authorization by the operator of the site of origin. This requisite is to guarantee any
confidentiality and risk of fraudulent use of this data in a competitive context. This is also applicable for
data issued from industrial captors, and all pictures and videos.
© The NRG-5 consortium partners, 2017 42
H2020-ICT-762013: NRG-5
D4.2: Integration Guidelines & Open DMP v2
Making an example related to NRG-5 project, videos taken during drone overflights must be validated by
the local operator to be stored and shared on the public platform. The view angles will be predefined to
preserve confidential industrial processes. These shots on the public area are regulated by the local
authorities and require special agreements (to be confirmed, depending on the country).
Making data Interoperable (FAIR) mainly relies on using suitable standards for data and metadata
creation along with appropriate vocabularies (e.g. for providing search keywords).
The details regarding the standards followed by project data together with the software applications for
its handling are widely reported in Section 2.2.10, where the file type description takes place.
Re-usability (FAIR) of data is the last aspect of FAIR data principle. In this regards, data will be
published either after the release of the respective deliverables or after the end of the project.
Data availability after the end of the project depends highly on the type and content of data. Therefore
storing data on a public platform needs to be discussed with the contributor of the data. The
requirements for making data public also have an ethics aspect, which is discussed in WP8, whose
reference is D8.1 (please see also Section 2.6 below).
Regarding the licensing of deliverables, Zenodo encourages the users to share their research as openly
as possible to maximize use and re-use of the research results. However, since one size does not fit all,
Zenodo platform allows for uploading under a variety of different licenses and access levels, obviously
shifting to the user the responsibility for respecting applicable copyright and licence conditions for the
uploaded files. Alternative options are Embargoed Access (when a publisher has specified an embargo
period for a journal article), Restricted access (only available to specific users), and Closed access (only
available to the user uploading the document). Additional options will appear for the selected access
right, during the uploading procedure. For open access, it has to be specified the licence which the
publication is distributed under. Usually the default Creative Commons Attribution 4.0 licence [33] is
appropriate.
The costs of making data FAIR depend on the amount of data, which may be published due to the cost
of long term storage solutions and additional effort for publication. All the project data made FAIR will be
uploaded in Zenodo or GitLab, trying to make it as public as possible. Whenever a partner thinks it
differently, he will have to justify the choice, managing everything by himself.
The Data Manager (DM) is the person in charge of making sure that both the project and the data
handled and stored during project lifetime are compliant to EU 2016/679 [30] and EU 2016/680 [34].
The responsibilities related to data management are specified as follows:
Data Management Plan: Task 4.1 partners, lead: RWTH
Data storage and backup: ENG by administrating the internal repository
Data archiving and publication: Zenodo and GitLab. Each of the partners are responsible on
their own.
Each partner is responsible for recoverability of its own generated data (backup plan in place, according
to institution or company practice). The assessment of potential privacy issues and security risks with the
content of gathered data is done by the entity who is collecting the data.
NRG-5 targets the Smart Energy sector utilizing the 5G innovations. In the majority of the experiments
no ethical issues are predicted; however especially in the case of Automatic Metering Infrastructure
(AMI) and utilization of drones for Preventive Maintenance some clarifications are given. For more
detailed information, the reference is D8.1 (submitted on 30th November 2017).
The NRG-5 use case trials will operate a strict information security policy that will apply to the project.
The policy, and the information security risk register, will be adopted by the project. As a direct result, all
participants data will be anonymised, and access to data will obey to clearly defined rules. All systems
will be developed in strict compliance with ISO 27001 and ISO 25237 for pseudonymization of data.
The consortium partners are fully aware of the national data protection authorities and will meet the
requirements of their local data protection legislation. All NRG-5 partners that handle personal data are
aware of their National Data Protection Authorities and their data controllers will request the necessary
permission before the start of relevant NRG-5 activities. Overall, NRG-5 pilot experiments will be
developed and operated in full consideration of data protection principles and will satisfy data protection
requirements in accordance with EU directives and national implementations thereof. Personal data that
will be captured, after consent from participants, will be processed according to the applicable data
protection provisions, as presented in Chapter 2 of D8.1.
NRG-5 consortium guarantees that all legal provision of personal data and any location-aware service
will be respected during all phases of the project. Also, NRG-5 is aware of existing technological
measures necessary to minimize associated privacy risks.
NRG-5 implements cryptography and other privacy-preserving state-of-the-art technologies/techniques,
including: anonymization of data; privacy-preserving data aggregation; automatic video processing; data
storage and processing as close to the source as possible.
Furthermore, all partners will sign a specific contractual template to legally bind the individuals who can
access the collected data. Each partner has been invited to have these confidentiality statements signed
by the relevant team members.
The Ethics board will make sure that all NRG-5 pilots will present confidentiality statements to legally
bind the individuals who can access collected data, as well as to ensure the upholding of ethics
requirements on the participation of humans. Statements regarding the possible ethics issues arising
from each sub-project shall be submitted. The template for these documents is presented in Appendix III
of D8.1.
Security measures for accessing transferred data could be applied during the NRG-5 pilots. The
personal data of energy consumption research participants are pseudonymized. The list of pseudonyms
must be kept separated from the data sources.
Each research must keep the data of participants in the NRG-5 experiments in a separate computer or
hard disk, which can be accessed only by authorised personnel.
Finally, as NRG-5 runs pilots where individuals are indirectly involved and personal data could be
collected, it is mandatory to define the procedures and methodology for identifying/recruit research
participants directly in the NRG-5 project or indirectly in the NRG-5 pilots. The basic principles covering
the involvement of humans as study participants are defined in Chapter 5 of D8.1.
3 Integration Guidelines
3.1 Introduction
Software and hardware development can be a very complex task. In order to ensure code quality, to test
the developed product and to track the changes made by different developers, Integration Guidelines
(IG) are needed. For example, IG define coding standards to be followed, in order to ensure that the
code is readable and understandable by different developers involved in the process.
To track changes in the software, repositories are used, where the different versions committed by the
developers are stored. In the following sections, guidelines for code development are discussed.
3.2 Software
3.2.1 Conventions
NRG-5 proposes “behavioural” guidelines/conventions to be respected during both the development and
integration phases. In the following, design patterns and code comments are proposed for facilitating
communication among the developing teams. Moreover, IG include the flowchart of actions to be
conducted, in order to share the latest pieces of code among the members of the development team.
Design patterns have been derived as general reusable solutions to commonly occurring problems within
a given context. The design pattern concept was introduced by the architect Christopher Alexander in
the field of architecture [36]. However, the concept has been adapted and applied in other fields as well,
including software design. Software design patterns do not imply designs which can be directly
transformed into code. Rather, they constitute a formal way of documenting the solution to a known
specific problem.
Developers within NRG-5 are encouraged to use design patterns, where applicable. Through design
patterns NRG-5 developers can have a common standard terminology for a common problem, facilitating
communication among them. Moreover, specified as common solutions, design patterns have been
evolved by developers over time, so that they describe best practices in common diagnosed problems.
Code documentation is highly recommended within NRG-5, as it is beneficial for both the developer
developing a specific piece of software, but also for the ones revising or enhancing it or wishing to
interface with it. Since this process will typically take place significantly later after the time of
development, even the initial developers often find difficulty in instantly identifying their own code
functionality, often costing significant time and effort to recover memories. This bottleneck can be
overcome by including short comments throughout the code explaining functionalities. However, NRG-5
developers are encouraged to take into account the following principles while documenting their code:
© The NRG-5 consortium partners, 2017 46
H2020-ICT-762013: NRG-5
D4.2: Integration Guidelines & Open DMP v2
Comments should precede the code they refer to. During the course of development, additions
and modifications on the existing code could result in displacement of comments with regard to
the referred code. Developers should take care of their code structure and their comments
placement, after code updates.
Comments should be consistent with the code they refer to. As code gets modified, comments
are often not updated accordingly, so that they could describe different functionalities or
parameters than the ones eventually developed or used. Thus, NRG-5 developers are
encouraged to provide consistent documentation of their code.
Comments should be short and concise, so that their effectiveness and readability does not get
compromised.
Comments should consist of the author name and date, so that potential incompatibilities can be
reported to the original developers.
NRG-5 aims at integrating a large number of services and third-party applications along with the
standard developments of the project per se. The applications and services that should be integrated
and supported have vastly diverse specifications and, therefore, requirements, resulting in the selection
of a single programming language as preferred to be an unrealistic consideration. Instead of agreeing on
the use of a single programming language, NRG-5 has opted for orchestration at the level of APIs that
are technology agnostic.
Hence, RESTful APIs and publish subscribe client-server architectures have been considered across all
the development activities of NRG-5. By means of this approach, there is no programming language
lock-in, allowing all interested parties to integrate by simply respecting the specifications of the APIs of
interest.
A major principle for effective code integration relates to interfaces and data models. Data models define
classes, parameters and allowed methods, while the same classes can be used by several developers
during the development of a system framework, like NRG-5. On the other hand, interfaces specify the
communication among software components, defining the information flow, the interacting entities, their
role in this interaction and the way this interaction is realized. In the same way, well-defined data model
and interfaces specifications may facilitate and actually enact components interaction, while not
respected specifications may result in significant incompatibilities and lack of interaction.
As NRG-5 progress will be realized in an evolutionary manner, enhancements and modifications over
existing code will necessarily take place. As a result, data models and interfaces may need to be
modified as well. NRG-5 developers are required to respect specified interactions, data models and
processes, to the extent possible. In the case of mandatory changes over specified processes, NRG-5
developers are required to concretely specify the changes required, communicate them to the
developing teams and include them in the revised version of the NRG-5 data model or architecture, if
there is one to be delivered.
When software development takes place in geographically dispersed places by different developing
teams, a common code repository can be of great help, as a means of collecting different pieces of code
and gradually integrating individual software parts. This way, distant teams can be updated with the work
conducted with other teams, identify points and potential problems of interaction and thus have a better
© The NRG-5 consortium partners, 2017 47
H2020-ICT-762013: NRG-5
D4.2: Integration Guidelines & Open DMP v2
picture of the code they develop as a whole. Although source control appears as a greatly helpful
solution for distributed software development, its benefits may be burdened by improper use of the
characteristics offered by the source code management platform.
First, serious integration problems may arise, when broken code is committed. Interaction with other
pieces of software requires that the already committed code is working and functional. Thus, NRG-5
developers should test their code before uploading it in the common repository.
Moreover, effective communication among different developing teams is achieved only if code commits
take place on a frequent and systematic basis. Small pieces of code can be easily reviewed and
integrated, while big pieces of code committed at once are harder to manipulate. As a result, NRG-5
developers should commit their code on a frequent and meaningful basis, providing the other developing
teams with basic ideas and interactions of their solution. Software commits should start from basic API
skeletons and gradually construct full-functional code parts.
Note that the CI part practically ends on the Automated Acceptance tests; thereafter, the CD part takes
place.
Completing the automated testing and quality enforcement status quo of the CI/CD framework, one may
apply source code inspection through automation frameworks such as SonarCube [43]. Although code
quality is not vital for the successful testing of a system or even its deployment, it can largely affect its
efficiency in terms of resource allocation and/or performance, hence it is, in general, recommended.
Overall, the above could highly benefit our work as automated testing, though cumbersome and very
time consuming, can assure that development over heterogeneous infrastructure and of different scope
remain working and inter-working at any time. Under a CI/CD approach and considering the project
orientation towards using OSM as base platform for NFV, the CI/CD approach would imply e.g.:
1. The developer implements a certain piece of software that wishes to integrate to the core
system functionality, irrespectively of whether this piece of code corresponds to the
development of a VNF or a platform component;
2. The developer introduces (or should have already introduced) a test case that unit tests the
relevant piece of code at the level of rationality checking and outcomes consistency. The unit
testing should be as thorough as possible.
3. The developer commits the code to a dedicated development branch defined in the CI
infrastructure.
4. The developer initiates a request for code merging.
5. The CI platform performs the determined unit testing;
a. If the unit testing is successful, the code is subject to further integrated system testing.
i. If the integrated system testing is successful, then the merge request is accepted
and the newly committed source code gets part of the code master branch.
ii. Otherwise, the merge request is rejected.
6. If either the unit or integrated system testing fails, the pull request is rejected. In this case, the
developer should consider either a code rewrite to satisfy the unit testing procedures, or the
unit testing rewrite (to avoid situations of erroneous unit testing. The workflow should be re-
initiated at step 1.
7. The source code management platform move to the CD part, building the package and
deploying it;
8. After successful CD, the new code is running on the deployment infrastructure and is subject
to user testing/production.
Although multiple CI/CD frameworks and platforms are available, Gitlab.com appears as a good
candidate for hosting the developments of the NRG-5 project. It is an open source management platform
which suites the needs of the NRG-5 project and can provide the following needs:
1. Multiple projects are possible, grouped under groups and subgroups;
2. Multiple private projects can be created; no need for opting for a pro account to have private
(non-public) projects. This is particularly important in the development phase; maybe we
would prefer to proceed with the development up to a point, then making the projects public
(open source).
3. It has native CD mechanisms.
Complying with NRG-5 view of end-to-end CI/CD, GitLab promotes conversational development [44] to
speed-up the coding activities, increase errors visibility and establish proper, controlled CI/CD
operations. To achieve this, GitLab exposes the conversational development status of a project using the
following tabulated stages and calculated values to calculate the project’s conversational development
index (ConvDev Index), providing an overview of the project adoption of Concurrent DevOps from
planning to monitoring.
Table 1: The values considered in GitLab’s ConvDev index calculation.
Stage Description
Issue (Tracker) Median time from issue creation until given a milestone or list label (first
assignment, any milestone, milestone date or assignee is not required)
Plan (Board) Median time from giving an issue a milestone or label until pushing the first
commit to the branch
Code (IDE) Median time from the first commit to the branch until the merge request is
created
Test (CI) Median total test time for all commits/merges
Review Median time from merge request creation until the merge request is merged
(Merge Request/MR) (closed merge requests won’t be taken into account)
Staging (Continuous Median time from when the merge request got merged until the deploy to
Deployment) production (production is last stage/environment)
Production (Total) Sum of all the above stages’ times excluding the Test (CI) time. To clarify, it’s
not so much that CI time is “excluded”, but rather CI time is already counted
in the review stage since CI is done automatically. Most of the other stages
are purely sequential, but Test is not.
In technical terms, GitLab promotes the term “pipeline” to describe sets of sequential CI and CD
operations. In this course, CI pipelines include code building followed by automated unit and integration
tests. Next, CD pipelines deploy the code to different environment, most usually for review, for actual
user testing (staging phase) and, finally for production use. The above is depicted in Figure 2.
GitLab organizes the CI/CD pipelines by employing pipeline graphs (e.g. as depicted in Figure 3) that are
described via sets of simple YAML scripts (with a static filename .gitlab-ci.yml) referred to as job files
[46], where the various pipelines are organized in stages. Jobs are executed by designated GitLab
runners.
More information on how to properly configure a GitLab CI/CD job are given in [46]. It is worth
mentioning, however, that the aforementioned GitLab runners refer to services that connect to the
project GitLab instance -either the public or a private one- and listen for code changes so that they can
actually perform the source code building/testing/deploying. The code execution is performed in sandbox
Docker containers that are automatically generated by the GitLab runners and get automatically deleted
when all the stages have been successfully completed.
Figure 4 offers a snapshot of the NRG-5 source code repository hosted under the public instance of
gitlab.com [48].
Note that in any case, OSM is responsible for creating or updating the respective VNF instance, together
with the re-configuration of the VNFFPs, VNFFGs and NSs that such a creation/update might imply. At
all times, the deployment process will be monitored in terms of time spent for the actual deployment, in
an attempt to acquire metrics of performance of the particular deployment site. This continuous
monitoring approach will assist the work of the determination of the optimal placement of the VNFs,
avoiding to utilize deployment sites that exhibit lower performance profiles for delay intolerant VNFs and
NSs.
Since NRG-5 has opted for using OpenStack as core VIM, a generic platform for enabling CI/CD
integrating OpenStack and OSM functionalities has been defined and developed and is presented in the
Annex. The script shown in the Annex enable a fully automated way from commit to deployment. This
approach can reduce time to market of new functionalities and the deployment of bug fixes significantly.
4 References
[1] “Guidelines on FAIR Data Management in Horizon 2020,” 26 6 2016. [Online]. Available:
http://ec.europa.eu/research/participants/data/ref/h2020/grants_manual/hi/oa_pilot/h2020-hi-oa-
data-mgt_en.pdf. [Accessed 24 11 2017].
[2] NRG5 Grant Agreement page 141.
[3] NRG5 Grant Agreement page 142.
[4] “AVI RIFF File Reference,” [Online]. Available: https://msdn.microsoft.com/en-us/library
/ms779636(VS.85).aspx.
[5] [Online]. Available: https://www-s.acm.illinois.edu/webmonkeys/book/c_guide/index.html.
[6] “C programming standards,” [Online]. Available: https://www.iso.org/standard/29237.html.
[7] “C++ library,” [Online]. Available: https://en.cppreference.com/w/cpp/header.
[8] “Css learn docs,” [Online]. Available: https://developer.mozilla.org/en-US/docs/Learn/CSS.
[9] “Css validator,” [Online]. Available: http://jigsaw.w3.org/css-validator/.
[10] “Csv,” [Online]. Available: https://tools.ietf.org/html/rfc4180.
[11] “GPX definition,” [Online]. Available: http://www.topografix.com/gpx/1/1/.
[12] “Header,” [Online]. Available: https://en.cppreference.com/w/cpp/header.
[13] “HTML specification,” [Online]. Available: https://www.w3.org/TR/html5/.
[14] “Java specifications,” [Online]. Available: https://docs.oracle.com/javase.
[15] “JPG,” [Online]. Available: https://jpeg.org/ .
[16] “Json,” [Online]. Available: https://www.json.org/ .
[17] “KML definition,” [Online]. Available: http://www.opengeospatial.org/standards/kml/.
[18] “MKV definition,” [Online]. Available: https://matroska.org/technical/specs/index.html.
[19] “mpeg,” [Online]. Available: https://en.wikipedia.org/wiki/Moving_Picture_Experts_Group.
[20] “Pcap,” [Online]. Available: https://www.tcpdump.org/.
[21] “Png,” [Online]. Available: https://www.iso.org/standard/29581.html.
[22] “Python,” [Online]. Available: https://www.python.org/.
[23] “raw,” [Online]. Available: https://www.iso.org/standard/29377.html.
[24] “Sh,” [Online]. Available: http://www.faqs.org/docs/air/tsshell.html.
[25] “Solidity,” [Online]. Available: https://solidity.readthedocs.io/en/v0.4.24/index.html.
[26] “tif,” [Online]. Available: https://www.adobe.io/open/standards/TIFF.html.
[27] “txt,” [Online]. Available: https://en.wikipedia.org/wiki/Text_file.
5 Annex
In this Annex, indicative examples of GitLab CI job descriptors are presented. In Sections 5.1 to 5.3
some generic descriptors are presented targeting at technologies adopted by the NRG-5 partners,
whereas in paragraph 5.3 a more complex CI/CD job assisted by a set of Python scripts that allows for
automatically updating OpenStack VNF snapshot images and OSM VNFDs is presented. More
information on the templating language of the GitLab CI jobs may be found in [49].
As per the very latest command of the job description, the above are meant to be performed in every
source code commit that is done on the master branch of the repository.
image: rastasheep/ubuntu-sshd:16.04
stages:
- deploy
deployment:
stage: deploy
script:
- KEY="$BUILD_DIRECTORY/$SSH_KEY"
- CONTAINER_NAME="simple-django-example"
- chmod 400 $KEY
- ssh-keyscan -H $TARGET_SERVER >> ~/.ssh/known_hosts
- ssh -i $KEY $TARGET_SERVER_USER@$TARGET_SERVER "rm -rf $TARGET_DIRECTORY*"
- ssh -i $KEY $TARGET_SERVER_USER@$TARGET_SERVER "mkdir $TARGET_DIRECTORY && mkdir
$TARGET_DIRECTORY/$SOURCE_DIRECTORY"
- scp -i $KEY -r ./*
$TARGET_SERVER_USER@$TARGET_SERVER:$TARGET_DIRECTORY/$SOURCE_DIRECTORY
- ssh -i $KEY $TARGET_SERVER_USER@$TARGET_SERVER "find
$TARGET_DIRECTORY/$SOURCE_DIRECTORY -type d -exec sudo chmod -R 755 {} \;"
- ssh -i $KEY $TARGET_SERVER_USER@$TARGET_SERVER "find
$TARGET_DIRECTORY/$SOURCE_DIRECTORY -type f -exec sudo chmod 664 {} \;"
- ssh -i $KEY $TARGET_SERVER_USER@$TARGET_SERVER "chmod a+x
$TARGET_DIRECTORY/$SOURCE_DIRECTORY/deployment/run.sh
$TARGET_DIRECTORY/$SOURCE_DIRECTORY/deployment/clean.sh"
- ssh -i $KEY $TARGET_SERVER_USER@$TARGET_SERVER "cp
$TARGET_DIRECTORY/$SOURCE_DIRECTORY/deployment/Dockerfile $TARGET_DIRECTORY/Dockerfile"
- ssh -i $KEY $TARGET_SERVER_USER@$TARGET_SERVER "cd $TARGET_DIRECTORY && sudo docker
build -t $SOURCE_DIRECTORY . && source $SOURCE_DIRECTORY/deployment/clean.sh && sudo docker
run -p 3338:3333 --name $CONTAINER_NAME --restart always -dit $SOURCE_DIRECTORY"
only:
- master
Figure 5: CI/CD template for deploying a Python web service in a packaged in a docker container.
Note that for the template to work, the variables TARGET_SERVER_USER, TARGET_SERVER,
TARGET_DIRECTORY, SOURCE_DIRECTORY, CONTAINER NAME should have already been defined as job
variables.
image: python:3.5.2
stages:
- test
- deploy
testing:
stage: test
script:
- apt-get update
- apt-get install -y lsb-release locales debconf-utils redis-server
- apt-get install -y python3-dev python3-lxml python3-pip python3-cffi libcairo2
libpango1.0-0 libgdk-pixbuf2.0-0 libffi-dev shared-mime-info
- echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
- locale-gen
- apt-get -y install postgresql postgresql-contrib libpq-dev libssl-dev libffi-dev
- service postgresql start
- service redis-server start
- su - postgres -c "psql -c \"ALTER USER postgres WITH PASSWORD '12345678'\""
- touch ~/.pgpass
- echo "*:*:*:postgres:12345678" > ~/.pgpass
- su - postgres -c "psql -c \"UPDATE pg_database SET datistemplate = FALSE WHERE datname
= 'template1';\""
- su - postgres -c "psql -c \"DROP DATABASE template1;\""
- su - postgres -c "psql -c \"CREATE DATABASE template1 WITH TEMPLATE = template0
ENCODING='UNICODE' LC_COLLATE='en_US.UTF8' LC_CTYPE='en_US.UTF8';\""
- su - postgres -c "psql -c \"UPDATE pg_database SET datistemplate = TRUE WHERE datname
= 'template1';\""
- su - postgres -c "psql -c \"UPDATE pg_database SET datallowconn = FALSE WHERE datname
= 'template1';\""
- su - postgres -c "psql -c \"CREATE DATABASE project_db WITH encoding='UTF8'\""
- pip3 install -r prod_requirements.txt
- export DJANGO_SETTINGS_MODULE=Success.settings.test
- python3 manage.py test
deployment:
stage: deploy
script:
- KEY="$CI_PROJECT_DIR/$BUILD_DIRECTORY/$SSH_KEY"
- chmod 400 $KEY
- mkdir ~/.ssh && touch ~/.ssh/known_hosts
- ssh-keyscan -H $TARGET_SERVER >> ~/.ssh/known_hosts
- ssh -i $KEY $TARGET_SERVER_USER@$TARGET_SERVER "sudo rm -rf $SOURCE_DIRECTORY"
- ssh -i $KEY $TARGET_SERVER_USER@$TARGET_SERVER "sudo mkdir $SOURCE_DIRECTORY && sudo
chmod 777 $SOURCE_DIRECTORY"
- scp -i $KEY -r $CI_PROJECT_DIR/*
$TARGET_SERVER_USER@$TARGET_SERVER:$SOURCE_DIRECTORY
© The NRG-5 consortium partners, 2017 57
H2020-ICT-762013: NRG-5
D4.2: Integration Guidelines & Open DMP v2
image: maven:latest
variables:
USER: "tomcat"
PASSWORD: "tomcat"
TOMCAT_IP: "192.168.1.2"
TOMCAT_PORT: "8080"
DEPLOY_PATH: "/"
WAR: "your_java_war#v0.1-SNAPSHOT.war"
stages:
- deploy
deploy:
stage: deploy
script:
- mvn clean
- mvn install
- curl --upload-file target/$WAR
"http://$USER:$PASSWORD@$TOMCAT_IP:$TOMCAT_PORT/manager/text/deploy?path=$DEPLOY_PATH&update=t
rue"
only:
- master
The execution context of the CI/CD job related to the deployment phase comprises three successive
commands:
1. Clean the target directory (the one holding the bytecode binaries);
2. Compile the source code, package it and install it in the local user maven cache;
3. Upload the resulting WAR file to the target tomcat installation (Manager App).
It is worth noting that the variables set in the script could be also integrated as project-level variables
rather than job-level variables (see [52] for details and discussion).
image: ubuntu:16.04
before_script:
- apt update
- apt install -y python python-pip
- pip install -r requirements.txt
stages:
- test
- deploy
test:
stage: test
script:
- echo "Your tests here"
deploy:
stage: deploy
script:
- echo "$OS_CONTROLLER controller" >> /etc/hosts
- python setup.py $OS_PROJECT "$VNF_IMAGE" $VNF_SERVER_NAME \
--os-user-name $OS_USER_NAME \
--os-password $OS_PASSWORD \
--os-domain-name $OS_DOMAIN_NAME \
--os-auth-uri $OS_AUTH_URI \
--cpu $VNF_vCPU \
--memory $VNF_vMEMORY \
--disk $VNF_vDISK \
--keypair $VNF_PUBLIC_KEY \
--version $CI_COMMIT_TAG \
--verbose
only:
- tags
The CI/CD job variables needed for running the script are as follows (only the VNF_IMAGE variable may
contain spaces):
Table 2: Required variables for configuring and running the NRG-5 CI/CD build job.
Variable Description Example
The commit tag; the name of the tag will be
used as version information in the VM image
name. Indicatively, with respect to the
CI_COMMIT_TAG 1.0.rev13
examplary variables on the right side of the
table, the resulting image name would be
vAAA-v1.0.rev13.
OS_AUTH_URI
The endpoint where the Identity service of http://controller:5000/v3
Openstack listens to.
The IP of the controller node of the cluster.
OS_CONTROLLER
This value is used to update the VM hosts in 192.168.1.2
case the controller advertises itself as
“controller” rather than using its IP.
The domain name (user and project) to use
OS_DOMAIN_NAME for authenticating against the OpenStack default
Identity service.
OS_PROJECT
The project (tenant) of OpenStack to OSM
authenticate against
OS_USER_NAME
The user name of the OpenStack user to osm-user
use.
VNF_IMAGE
The image name to use for building the Centos 7.0
target VM.
VNF_PUBLIC_KEY
The public key to use to SSH to the created Osm
VM.
The name to give to the server that will later
VNF_SERVER_NAME be snapshotted. It should match the name of vAAA
the respective OSM VNF name.
VNF_vCPU
The number of virtual CPUs to use for 2
creating the target VM.
VNF_vDISK
The size of the disk (in GBs) to use for 10
creating the target VM.
VNF_vMEMORY
The amount of virtual RAM to use for 2048
creating the target VM in MBs.
The above is visualized in Figure 6, where a screenshot of a running NRG-5 VNF CI/CD repository is
depicted.
Figure 6: Setting the required variables at the CI/CD settings of the GitLab project.
The test stage is left empty, so that each VNF developer may write their own test scripts, without
depending on a specific programming language or framework.
The deploy stage, on the other hand, first configures the known hosts of the build docker container so
that communication with the OpenStack controller node may be achieved, then executes the setup.py
script which is the main entry point to the NRG-5 OpenStack-OSM processes. In detail, the setup.py
script sequentially performs the following:
1. Creates an OpenStack server (target VM) using the OpenStack user credentials, project details,
VM image and flavor options (vCPU, vRAM and vDisk) as well as the public keypair (.pem file)
defined in the variables of the build job.
2. When the image has been successfully created, it executes two scripts, a local and a remote
one. The local script should be used to possibly configure the source code, then initiate an SSH
connection to the created VM so that the code (binaries) may be properly deployed. Then, the
remote script should be executed to undertake the final deployment of the code, install the
necessary dependencies etc. The two scripts are located under the commands directory (see
Figure 11).
3. When the installation has been completed, it stops the server to preserve its memory state and
accelerate snapshotting, then instructs OpenStack to take a snapshot of the deployed service in
the target VM.
4. Updates the OSM catalogue as to the version of the OpenStack image to use for deploying the
corresponding VNF.
© The NRG-5 consortium partners, 2017 61
H2020-ICT-762013: NRG-5
D4.2: Integration Guidelines & Open DMP v2
The following listing presents a snapshot of the integration project running on a private GitLab Runner
instance.
2018-11-09 17:45:49,976 -- [ create: process_request:L 72] -- DEBUG -- Getting proper flavor
2018-11-09 17:45:50,220 -- [ create: process_request:L 81] -- DEBUG -- Setting security groups to 'default' (make sure
you have SSH on)
2018-11-09 17:45:50,220 -- [ create: process_request:L 84] -- DEBUG -- Getting proper network configuration
2018-11-09 17:45:52,387 -- [ create: process_request:L100] -- DEBUG -- Server not ready, yet. Status: BUILD
. . .
2018-11-09 17:46:07,618 -- [ create: process_request:L100] -- DEBUG -- Server not ready, yet. Status: BUILD
2018-11-09 17:46:07,793 -- [ create: process_request:L105] -- DEBUG -- Attempting to add floating IP to server 025eb1e8-
0106-4d77-9ed5-d8876b590093.
2018-11-09 17:46:07,794 -- [ network: _get_floating_ip_network:L 55] -- DEBUG -- Getting the floating IPs of the project
2018-11-09 17:46:07,844 -- [ network: _get_floating_ip_network:L 69] -- DEBUG -- Available floating IP: 192.168.1.228
2018-11-09 17:46:08,189 -- [ network: get_floating_ip:L125] -- DEBUG -- Delivering existing floating IP with details:
{u'router_id': None, u'status': u'DOWN', u'description': u'', u'tags': [], u'tenant_id': u'8b938b5f678e4eaf84e445a0dbcea126',
u'created_at': u'2018-11-09T12:11:27Z', u'updated_at': u'2018-11-09T15:54:15Z', u'dns_domain': u'', u'floating_network_id': u'4fcf6681-
111a-402e-ace3-00a30d6699cb', u'fixed_ip_address': None, u'floating_ip_address': u'192.168.1.228', u'revision_number': 23, u'dns_name':
u'', u'project_id': u'8b938b5f678e4eaf84e445a0dbcea126', u'port_id': None, u'id': u'5b20a268-a76e-4122-bff9-30a094a2763e'}
2018-11-09 17:46:09,432 -- [ deploy: process_request:L 50] -- DEBUG -- Running local command: bash /builds/pops/nrg-
5/cicd-os-osm/commands/local.sh 192.168.1.228
2018-11-09 17:46:09,432 -- [ deploy: process_request:L 55] -- DEBUG -- Running remote command: bash remote.sh
2018-11-09 17:46:09,433 -- [ deploy: process_request:L 56] -- DEBUG -- Make sure to have the script there :-)
2018-11-09 17:46:14,494 -- [ common: run_command_over_ssh:L 77] -- WARNING -- Handled exception: [Errno None] Unable to connect
to port 22 on 192.168.1.228
2018-11-09 17:46:14,494 -- [ common: run_command_over_ssh:L 78] -- DEBUG -- Waiting for server @ 192.168.1.228 to wake up
2018-11-09 17:46:17,565 -- [ common: run_command_over_ssh:L 77] -- WARNING -- Handled exception: [Errno None] Unable to connect
to port 22 on 192.168.1.228
. . .
2018-11-09 17:46:46,902 -- [ common: run_command_over_ssh:L 77] -- WARNING -- Handled exception: [Errno None] Unable to connect
to port 22 on 192.168.1.228
2018-11-09 17:46:46,902 -- [ common: run_command_over_ssh:L 78] -- DEBUG -- Waiting for server @ 192.168.1.228 to wake up
2018-11-09 17:46:49,358 -- [ snapshot: snapshot:L 63] -- DEBUG -- Waiting for server vAAA (025eb1e8-0106-4d77-9ed5-
d8876b590093) to stop. Current status is ACTIVE
. . .
2018-11-09 17:46:52,031 -- [ snapshot: snapshot:L 63] -- DEBUG -- Waiting for server vAAA (025eb1e8-0106-4d77-9ed5-
d8876b590093) to stop. Current status is ACTIVE
2018-11-09 17:46:52,573 -- [ snapshot: snapshot:L 69] -- DEBUG -- Creating image with name vAAA-v1.0.rev13
2018-11-09 17:46:52,574 -- [ snapshot: process_request:L 95] -- DEBUG -- Got snapshot UUID bda24d47-c4c2-414e-9d15-7cc165
2018-11-09 17:46:52,608 -- [ snapshot: process_request:L106] -- DEBUG -- Image is not ready, yet. Status is queued
. . .
2018-11-09 17:47:23,148 -- [ snapshot: process_request:L106] -- DEBUG -- Image is not ready, yet. Status is saving
Notably, when running, in the private GitLab runner the Docker engine hinted over the CI/CD operations
taking place as shown in Figure 8.
© The NRG-5 consortium partners, 2017 62
H2020-ICT-762013: NRG-5
D4.2: Integration Guidelines & Open DMP v2
Figure 8: Depiction of the CI/CD job running on a private GitLab Runner instance.
In the end of the exemplary execution process, OpenStack reported the existence of the newly created
VNF image:
Figure 9: OpenStack dashboard indicating the successful creation of the VNF snapshot.
At GitLab level, the indication that the CI/CD operation was successfully executed was as in the
following:
$ tree .
.
├── __init__.py
├── commands
│ ├── local.sh
│ └── remote.sh
├── keys
│ └── osm.pem
├── nfv
│ ├── __init__.py
│ └── osm
│ ├── __init__.py
│ └── v4
│ ├── __init__.py
│ └── update_vnf.py
├── requirements.txt
├── settings
│ ├── __init__.py
│ └── settings.py
├── setup.py
└── vim
├── __init__.py
└── openstack
├── __init__.py
├── actions
│ ├── __init__.py
│ ├── create.py
│ ├── delete.py
│ ├── deploy.py
│ └── snapshot.py
└── utils
├── __init__.py
├── common.py
├── compute.py
├── identity.py
├── image.py
├── log.py
└── network.py
10 directories, 26 files
Figure 11: The file and directory structure of the project.
The code will be made publicly available during the next months at the project source code repository
[53].