fiware primer - learn fiware in 60 minutes

42
MILAN 20/21.11.2015 FIWARE Primer Learn FIWARE in 60 Minutes Federico M. Facca CREATE-NET. FIWARE Evangelist [email protected], @chicco785 (twitter)

Upload: federico-michele-facca

Post on 13-Apr-2017

1.080 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: FIWARE Primer - Learn FIWARE in 60 Minutes

MILAN 20/21.11.2015

FIWARE PrimerLearn FIWARE in 60 Minutes

Federico M. FaccaCREATE-NET. FIWARE [email protected], @chicco785 (twitter)

Page 2: FIWARE Primer - Learn FIWARE in 60 Minutes

MILAN 20/21.11.2015

FEDERICO M. FACCA

Page 3: FIWARE Primer - Learn FIWARE in 60 Minutes

What is FIWARE?

FIWARE’s offer• Building blocks• Platform• Lab• Ops

Page 4: FIWARE Primer - Learn FIWARE in 60 Minutes

FIWARE’s offer

Page 5: FIWARE Primer - Learn FIWARE in 60 Minutes
Page 6: FIWARE Primer - Learn FIWARE in 60 Minutes

FIWARE Platform

An OpenStack-based cloud platform that allows the easy deployment and composition of FIWARE services to create new applications

Page 7: FIWARE Primer - Learn FIWARE in 60 Minutes

FIWARE Lab Nodes

16 FIWARE Lab Nodes• Currently 16 nodes in Europe

providing up to 3000+ cores, 6TB+ Ram, 750TB+ HD• 1 node in Mexico providing 1200+

cores• 1 node in Brazil is being deployed in

these days

…and more to follow!• Discussions with several European

regions and with Brazil and Chile already started• Discussions with other regions and

countries with high potential• Open Call deadline on 16th

November

Page 8: FIWARE Primer - Learn FIWARE in 60 Minutes

8

FIWARE Smart Cities: Santander

Real-time open data coming from large deployment of sensors (4500 IoT devices, 150 mobile sensor units, 2500 RFIDs) offered through standard FI-WARE APIs

Open data sets captured from sensors since August 2013 uploaded on Big Data platform and ready for analysis

Reference FI-WARE application examples available (e.g. Management of Parque de las Llamas public lighting)

60+ cities from 12 countries joined the Open and Agile Smart Cities (OASC) initative commiting to adopt common principles: • Open APIs• Standard Data Models • Open Data/APIs publication platform• Driven by implementation

Page 9: FIWARE Primer - Learn FIWARE in 60 Minutes

FIWARE OPS

Deployment

Federation Management

Connectivity Management

Service Offer Management

1

2

3

4

Page 10: FIWARE Primer - Learn FIWARE in 60 Minutes

10

Budget for FIWARE/FIWARE Lab (phases 1 & 2)126 M€ = (89 + 37) M€

countries

270 150companiespartners

400 M€ = (300 + 100) M€Budget (RTD + funding for entrepreneurs)

>1.000SMEs and start-ups

27

facts

Page 11: FIWARE Primer - Learn FIWARE in 60 Minutes
Page 12: FIWARE Primer - Learn FIWARE in 60 Minutes

Learning the keyFIWARE technology

Page 13: FIWARE Primer - Learn FIWARE in 60 Minutes

13

Where to start from?

Page 14: FIWARE Primer - Learn FIWARE in 60 Minutes

14

Common Authorization, Access Control and Privacy management framework for all FIWARE GE interfaces Authorization, Access Control framework

in the short term

Privacy Management capabilities to be integrated next

Page 15: FIWARE Primer - Learn FIWARE in 60 Minutes

15

Creating your identity in FIWARE Access the Account Portal and click in “Sign Up” option

Page 16: FIWARE Primer - Learn FIWARE in 60 Minutes

16

Sending Protected Requests to a FIWARE Service

Authentication Example

GET /GE_URL_path HTTP/1.1Host: GE_hostnameX- Auth-Token: access_token

Secure your backend

Install PEP Proxy• git clone https://github.com/ging/fi ‐

ware-pep‐proxy.git• cd fi‐ware‐pep‐proxy/

npm install• //Hostname to forward authenticated

requestsconfig.app_host = 'www.google.es';//Port where the HTTP server is runningconfig.app_port = '80';

• sudo node server

Page 17: FIWARE Primer - Learn FIWARE in 60 Minutes

17

Support cloud native applications development using cutting edge cloud technologies

OpenStack-based IaaS to provide computing and storage capacity across multiple data centers

Docker-based PaaS to deploy and compose scalable applications

Page 18: FIWARE Primer - Learn FIWARE in 60 Minutes

18

Deploying FIWARE GEs on the FIWARE Lab (using a Virtual Machine)

Launch a GE from the cloud portal (http://cloud.lab.fiware.org)• Click on images• Launch the selected GE

Configure the VM• Set flavor• Set security groups• Set network

Page 19: FIWARE Primer - Learn FIWARE in 60 Minutes

19

Deploying FIWARE GEs on the FIWARE Lab (using Docker Compose) Configure the Lab

• Create a security group “docker-machine-sg” with ports 2376 and 22 open

• Allocate at least one floating IP to your project.

• Take a look a the VM images that are used to when creating a docker host.

Set-up docker on your local workstation• install docker $ wget -qO- https://get.docker.com/ | sh

• install docker machine$ curl -L

https://github.com/docker/machine/releases/download/v0.5.0/docker-machine_linux-amd64.zip >machine.zip && \ unzip machine.zip && \ rm machine.zip && \ mv docker-machine* /usr/local/bin

Set-up a docker machine• Set Openstack environment

variables>export OS_REGION_NAME='Spain2‘>export OS_TENANT_NAME='john-smith cloud' >export OS_USERNAME='[email protected]'' >export OS_PASSWORD='secret'' >export OS_AUTH_URL='http://cloud.lab.fi-ware.org:4730/v2.0/' >export OS_AUTH_STRATEGY='keystone‘

• Create docker machine>docker-machine create -d openstack --openstack-flavor-

id="2" --openstack-image-name="Ubuntu Server 14.04.1 (x64)" --openstack-net-name="node-int-net-01" --openstack-floatingip-pool="public-ext-net-01" --openstack-sec-groups="docker-machine-sg" docker-host

Launch composition• Describe docker-compose.yml

mongo: image: mongo:2.6command: --smallfiles

orion:image: fiware/orionlinks:

- mongoports:

- ":1026“command: -dbhost mongo

• Deploy composition>docker-compose up –d

Page 20: FIWARE Primer - Learn FIWARE in 60 Minutes

20

NGSI: the SNMP of the Internet of Things

Measures as values of attributes characterizing context entities

Just need to change the value of an attribute to trigger an action on a device

Page 21: FIWARE Primer - Learn FIWARE in 60 Minutes

21

Playing with Context information 1

Updating contextPOST

<cb_host>:<cb_port>/v1/contextEntities/type/Rating/id/LeBistro::Client1234 {

"attributes" : [{ "name" : "score", "type" : "integer", "value" : "4" } ]

}

Querying a contextGET <cb_host>:<cb_port>/v1/contextEntities/type/Restaurant/id/LeBistro //getting a JSON response such as the following one:

{ "contextElement": { "attributes": [ {

"name": "name", "type": "string", "value": "Le Bistro" },…],

}, "statusCode": { "code": "200", "reasonPhrase": "OK" }

}

Page 22: FIWARE Primer - Learn FIWARE in 60 Minutes

22

Playing with Context information 2

Subscribe to context changesPOST <cb_host>:<cb_port>/v1/subscribeContext

{"entities": [

{ "type": "Rating", "isPattern": "true", "id": ".*"

} ], "attributes": [ "score" ], "reference": "http://backend.niceeating.foo.com:1028/ratings", "duration": "P1M", "notifyConditions": [

{ "type": "ONCHANGE", "condValues": [ "score" ] } ]

}

Page 23: FIWARE Primer - Learn FIWARE in 60 Minutes

23

IoT: Plug, Configure & Play Connection of devices supporting most

popular protocols (MQTT, CoAP, …) should just imply to plug, configure & play

Provide a framework that eases the incorporation of new protocols

Page 24: FIWARE Primer - Learn FIWARE in 60 Minutes

24

Playing with IoT devices 1

Create an IDAS ServicePOST

<idas_host>:<idas_port>/iot/services Headers: {'content-type': 'application/json’; 'X-Auth-Token' : [TOKEN]; "Fiware-Service: OpenIoT”; "Fiware-ServicePath: /"} Payload: { "services": [

{ "apikey": "4jggokgpepnvsb2uv4s40d59ov",

"token": "token2","cbroker":

"http://0.0.0.0:1026", "entity_type": "thing",

"resource": "/iot/d" } ]

}

 Register your IoT device• POST

<idas_host>:<idas_port>/iot/devices Headers: …Payload:{"devices": [

{"device_id": ”[DEV_ID]","entity_name":

”[ENTITY_ID]","entity_type": "thing",“timezone":

”Europe/Madrid","attributes": [

{"object_id":

"t", "name":

"temperature","type": "int“ } ],

"static_attributes": …}

]}

Page 25: FIWARE Primer - Learn FIWARE in 60 Minutes

25

Playing with IoT devices 2

Send Observations related to your IoT device• POST <idas_host>:

<idas_port>/d?k= <apikey>&i= <device_IDHeaders:

{'content-type':

'application/text’;'X-Auth-Token' :

[TOKEN];"Fiware-Service:

OpenIoT”;"Fiware-ServicePath: /“}

Payload: ‘ t|25‘

Reading measurements sent by your IoT device• GET

<cb_host>:<cb_port>/v1/contextEntities/type/thing/id/[ENTITY_ID]

Page 26: FIWARE Primer - Learn FIWARE in 60 Minutes

26

Powerful framework for publication of datasets and APIs

Leveraging on CKAN (welcome on board !)

Support to self-publication by third parties

Integration with FIWARE Store GE in order to support how access rights are obtained by users

Page 27: FIWARE Primer - Learn FIWARE in 60 Minutes

27

Publish Open Data Sets in the FIWARE Data portal (http://data.lab.fiware.org)

Add Dataset

Provide basic information

Upload data

Provide metadata

Page 28: FIWARE Primer - Learn FIWARE in 60 Minutes

28

Integration of FIWARE Advanced Web-based User Interface GEs with NGSI

Shared Context Information

End-to-End connection from UI to IoT resources

Page 29: FIWARE Primer - Learn FIWARE in 60 Minutes

29

Develop Interactive applications

Page 30: FIWARE Primer - Learn FIWARE in 60 Minutes

A reference FIWARE Cloud Native App Architecture

Cloud Patterns Cloud Patterns in FIWARE

Page 31: FIWARE Primer - Learn FIWARE in 60 Minutes

31

Let’s start from the basic:cattle and pets

Cloud Native Applications Legacy Applications

Page 32: FIWARE Primer - Learn FIWARE in 60 Minutes

32

Let’s bring in a couple moreof cloud patterns

Horizontal Auto-Scaling Pattern Queue Centric Workflow Pattern

Page 33: FIWARE Primer - Learn FIWARE in 60 Minutes

33

Let’s mix them with a couple of FIWARE ingredients

Queue Centric Workflow(HA Orion Context Broker)

Auto-scaling front-end(consumers)

Workers(consumers/producers)

CDN(ObjectStorage)

NGSI

NGSI

Page 34: FIWARE Primer - Learn FIWARE in 60 Minutes

Find out more

Example Apps FIWARE Catalogue FIWARE University FIWARE ASK #MYFIWARESTORY

Page 35: FIWARE Primer - Learn FIWARE in 60 Minutes

35

Example Apps

SmallSignals FoneSense

Page 36: FIWARE Primer - Learn FIWARE in 60 Minutes

36

FIWARE Catalogue (http://catalogue.fiware.org)

Page 37: FIWARE Primer - Learn FIWARE in 60 Minutes

37

FIWARE University (http://edu.fiware.org)

Page 38: FIWARE Primer - Learn FIWARE in 60 Minutes

38

FIWARE ASK (http://ask.fiware.org)

Page 39: FIWARE Primer - Learn FIWARE in 60 Minutes

39

#MYFIWARESTORYWhich is yours?

Page 40: FIWARE Primer - Learn FIWARE in 60 Minutes

Don’t miss the Lab Session this afternoon!

Be aware!!! Build a Context Aware Application using FIWARE

Presented by Attilio Broglio

Room BL27.0.6

14:10 - 16:00

Page 41: FIWARE Primer - Learn FIWARE in 60 Minutes

http://fiware.org

http://lab.fiware.org

Follow @Fiware on Twitter !

Join us!

Page 42: FIWARE Primer - Learn FIWARE in 60 Minutes

MILAN 20/21.11.2015 - SPEAKER’S NAME

Leave your feedback on Joind.in!https://m.joind.in/event/codemotion-milan-2015