53
TRABAJO FIN DE MÁSTER: AUTOMATED MULTIPLATFORM COMPILATION AND VALIDATION OF A COLLABORATIVE REPOSITORY OF EXAMPLES USING RTI CONNEXT DDS Author: Ángel Jesús Martínez Bernal Advisor: María Sara Granados Cabeza Granada, December 2014

Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Embed Size (px)

Citation preview

Page 1: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

TRABAJO FIN DE MÁSTER: AUTOMATED MULTIPLATFORM COMPILATION AND VALIDATION OF A COLLABORATIVE REPOSITORY OF

EXAMPLES USING RTI CONNEXT DDS

Author: Ángel Jesús Martínez Bernal Advisor: María Sara Granados Cabeza Granada, December 2014

Page 2: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Content Introduction

Rationale State of the Art

Problem definition

Goals

Development Common Example Structure

Examples Repository

Automation Task

Results

Conclusions

Page 3: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Content Introduction

Rationale State of the Art

Problem definition

Goals

Development Common Example Structure

Examples Repository

Automation Task

Results

Conclusions

Page 4: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Introduction (I) Automation

Automation in Computer Science

Programming Languages

Punched cards

Assembly programming language

Different paradigms (functional programming, logic programming…)

Oriented Object Programming

Scripting

GPU

Page 5: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Introduction (I) Automation

Automation in Computer Science

Programming Languages

Punched cards

Assembly programming language

Different paradigms (functional programming, logic programming…)

Oriented Object Programming

Scripting

GPU

Page 6: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Introduction (II) Continuous Integration

Revision control -> Repositories

Page 7: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Content Introduction

Rationale State of the Art

Problem definition

Goals

Development Common Example Structure

Examples Repository

Automation Task

Results

Conclusions

Page 8: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Rationale - State of the Art (I) Distributed System Communication

Client/Server Paradigm

Page 9: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Rationale - State of the Art (II) Publish/Subscribe Paradigm

Page 10: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Rationale - State of the Art (III) Data Distribution Service (DDS)

OMG Standard

Features:

QoS-enabled

Data-centric

High scalability

More dynamic network topology

Page 11: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Rationale - State of the Art (IV) Data Distribution Service (DDS)

Page 12: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Rationale - State of the Art (V) RTI Connext DDS

Fully compliant with the OMG DDS standard, API and RTPS protocol

Interoperable: languages, operating systems and network types

Low latency and high throughput

Deterministic even under load and at scale

Reliable multicast

Peer-to-peer architecture: no brokers or servers

Non-stop availability.

Different approaches depending on the system.

Page 13: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Rationale - State of the Art (VI)

DDS Bus / RTI DataBus™

Connext

Micro

Pub/Sub API

Small Device Apps

Connext

DDS

Pub/Sub API

DDS Apps

Connext

Messaging

Messaging API

General-Purpose Real-Time Apps

Connext

Integrator

Adapters

Discrete OT & IT Apps/Systems

Administration

Monitoring

Logging

Recording

Replay

Federation

Transformation

Persistence Visualization

Page 14: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Rationale - State of the Art (VII) Continuous Integration (Bamboo)

Local agent

Remote agent

Virtual agent

Page 15: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Content Introduction

Rationale State of the Art

Problem definition

Goals

Development Common Example Structure

Examples Repository

Automation Task

Results

Conclusions

Page 16: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Problem Definition (I) RTI’s user community unmaintainable

Out-of-date examples

Not compiling

Not working in latest versions

Using deprecated features

Only available for one language or platform

Many collaborators Different patterns

More time understanding the example than the feature.

No continuous integration!

Page 17: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Problem Definition (II) QoS used to be

changed programmatically.

Now, XML files are recommended.

We needed to commented them out and create XML profiles. E.G.: Asynchronous

publication:

Page 18: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Problem Definition (III) Use USER_QOS_PROFILES.xml rather than code.

Page 19: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Problem Definition (IV) Needed an automation process able to:

Manage the copyright header

Not necessary for external examples

Build all examples in different platforms

Validate QoS files (XML extension)

Manage <dds> tag

Bundle examples for uploading to a website

Solution needs to be scalable and maintainable.

Page 20: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Content Introduction

Rationale State of the Art

Problem definition

Goals

Development Common Example Structure

Examples Repository

Automation Task

Results

Conclusions

Page 21: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Goals (I) Complete & update the RTI Connext DDS

example repository

Refactor examples to follow a common same pattern

Add new examples

Integrate the examples in the Continuous Integration methodology:

Automated process

Create configurable scripts for scalability

Page 22: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Goals (II) Initial state of the repository

Page 23: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Content Introduction

Rationale State of the Art

Problem definition

Goals

Development Common Example Structure

Examples Repository

Automation Task

Results

Conclusions

Page 24: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Common Example Structure (I) Example Git repository:

https://github.com/rticommunity/rticonnextdds-examples

Outside structure: Example directory:

README.txt /C

README.txt Foo_publisher.c Foo_subscriber.c USER_QOS_PROFILES.xml Foo.idl

/C++ /Java /CS

Page 25: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Create participant

Create publisher

Get type_name

Create topic

Create DataWriter

Narrow DataWriter

Create Instance

Delete data

Common Example Structure (II) Publisher

Modify data

(instance)

Write the data

(instance)

Sleep

Page 26: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Create participant

Create publisher

Get type_name

Create topic

Create DataWriter

Narrow DataWriter

Create Instance

Delete data

Common Example Structure (II)

Modify data

(instance)

Write the data

(instance)

Sleep

Publisher

Page 27: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Create Participant

Create Subscriber

Get type_name

Create topic Create

Listener Create

DataReader

Delete data

Subscriber

Narrow DataReader

Read sample Print the sample

On_data_available

Common Example Structure (III)

Page 28: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Create Participant

Create Subscriber

Get type_name

Create topic Create

Listener Create

DataReader

Delete data

Subscriber

Narrow DataReader

Read sample Print the sample

On_data_available

Common Example Structure (III)

Page 29: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Create Participant

Create Subscriber

Get type_name

Create topic Create

Listener Create

DataReader

Delete data

Subscriber

Narrow DataReader

Read sample Print the sample

On_data_available

Common Example Structure (III)

Page 30: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Create Participant

Create Subscriber

Get type_name

Create topic Create

Listener Create

DataReader

Delete data

Subscriber

Narrow DataReader

Read sample

Print the sample

Common Example Structure (III)

Page 31: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Narrow DataReader

Create Conditions

Create WaitSet

Attach conditions

Create Participant

Create Subscriber

Get type_name

Create topic Create

DataReader Create

Waitset*

Loop: Wait data / printing

Delete Data

Additional Steps WaitSets

Page 32: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Automation process Tasks:

Manage Copyright notice (Check, Add & Delete)

Automated building for different architectures

Windows, Linux or other supported by the tools.

XML validation

Point to Community XSD file (dds tag).

Update DDS version & schema.

Bundle examples

Tools: Bamboo and Perl scripts

Page 33: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Manage Copyright Notice (I) Copies the copyright header to the files under a

folder.

Available for XML and C/C++.

Configurable:

Decide the extensions of the files to process.

Select an option (option_flag): check/copy/delete.

Skip folders or files (e.g.: external examples).

Call syntax: perl ./resources/scripts/copyright.pl <working_directory> <option_flag> <extensions>...

Page 34: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Manage Copyright Notice (II) C Style Copyright Header: Top of the file

Page 35: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Manage Copyright Notice (III) XML Style Copyright Header: after XML definition

Page 36: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Multiplatform Building Call syntax perl ./resources/scripts/compile_[unix|windows].pl <working_directory> <ndds_version> <architecture_c>

Look for IDL files

Call rtiddsgen

Call the compiler

Page 37: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

XML Validation Validates all the QoS files with

its corresponding schema version (.xsd).

Call syntax: perl ./resources/scripts/xml_validation.pl <working_directory> <ndds_version>

Validate!

(or error)

xmllint

XML file

URL of the .xsd

file

Page 38: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

XML Update Schema location should NOT be a local path, but an

online one:

Three different actions (option_flag): Check whether the <dds> tag has all the 3 attributes.

Add the attributes that the <dds> tag did not have.

Replace the attributes <path_schema> and <ndds_version>.

Call syntax: perl xml_update.pl <working_directory> <option_flag> <ndds_version> <path_schema>

Page 39: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Bundle Examples (I) Bundle the examples in order to upload to a website

Create a .zip & .tar.gz which contains all the examples

Bundle every example separately

Upload all packages & files to a website

Call syntax: perl bundle_examples.pl <working_directory>

<repository_name>

Page 40: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Bundle Examples (II) rticonnextdds-examples

asynchronous_publication

C++

C

Cs

Java

Readme.txt

Batching

builtin_qos_profiles

builtin_topics

coherent_presentation

.zip & .tar.gz

.zip & .tar.gz

Page 41: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Bamboo Integration (I) Building steps:

Copyright

XML validation

Compile

Page 42: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Bamboo Integration (II) Shipping steps:

Page 43: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Bamboo Integration Script configuration as Bamboo task

Page 44: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Bamboo Integration (III)

Page 45: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Bamboo Integration (IV)

Page 46: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Content Introduction

Rationale State of Art

Problem definition

Goals

Development Common Example Structure

Examples Repository

Automation Tasks

Results

Conclusions

Page 47: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Results (I) Contribution to the repository

Page 48: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Results (II)

Available soon

Page 49: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Results (III) New examples

Page 50: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Content Introduction

Rationale State of the Art

Problem definition

Goals

Development Common Example Structure

Examples Repository

Automation Task

Results

Conclusions

Page 51: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Conclusions RTI Connext DDS

Easy to create p/s applicatons

Configurable thanks to QoS policies

Big community that needs CI

New Examples

Continuous integration Allow projects to grow easily

Scripts for high scalability

Integrating with different Atlassian’s tools. For instance: JIRA

Page 52: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

Future Work Integrate more feature examples

Add the custom content filter example in C#

Evaluate interesting features and concept and create new examples

Update the shipped examples:

Force them to have the same structure

Use a subset of the RTI Community examples repository as shipped examples.

Compile for more platforms

VxWorks, Raspberry Pi, Integrity, AIX, …

Page 53: Automated Multiplatform Compilation and Validation of a Collaborative Repository of Examples Using RTI Connext DDS

TRABAJO FIN DE MÁSTER: AUTOMATED MULTIPLATFORM COMPILATION AND VALIDATION OF A COLLABORATIVE REPOSITORY OF

EXAMPLES USING RTI CONNEXT DDS

Author: Ángel Jesús Martínez Bernal Advisor: María Sara Granados Cabeza Granada, December 2014