51
Adventures in Pi David R. White HATII Seminar Tuesday 20th January 2015

Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

Adventures in PiDavid R. White HATII Seminar

Tuesday 20th January 2015

Page 2: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

These slides have been purged of all images, and the remaining content is for reference only!

I’ve annotated some of the slides, clumsily, so that you can get an idea of what was presented.

Any questions, queries — please get in touch!

David R. White.

Wed 21st Jan 2015.

Page 3: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

Who am I?

RA in Computing Science at the University of Glasgow.

Funded by the EPSRC.

Member of the AnyScale Project http://anyscale.org

Interests include Cloud Computing and Evolutionary Computation.

Page 4: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

Background about the Pi

The Raspberry Pi Cloud

Art Installation

Robot

Page 5: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

I gave some background of the Raspberry Pi Project.

Relating the Pi to the 8-bit home computing of the 1980s.

http://www.raspberrypi.org/about/

Page 6: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

What’s in a Pi?Costs around £30 for a Model B.

512MB RAM

Broadcom System-on-Chip

700MHz ARM Processor (ARM 11 Family, v6 IS)

Powerful GPU

Lots of GPIO pins

Page 7: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

What’s in a Pi?

100Mbps Ethernet via USB 2.0 bus.

SD Card for Storage.

Component Video and HDMI Outputs.

Page 8: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

Software

Invariably runs a version of Linux.

Raspbian, based on Debian, is the most popular and widely supported.

Also has CentOS and Arch Linux.

Page 9: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

A Raspberry Pi Cloud

Page 10: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

Edison’s Pearl Street Station c. 1883

Steam generators, Long Island Railways

c.1907

Images © Smithsonian Institution

Page 11: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

© Sandy Fleischmann / CC-BY-2.0

“The Big Switch” Nicholas Carr

Discussed the analogy presented in Carr’s book. Recommended reading for anyone interested in how

Cloud Computing is going to shape society.

http://www.nicholascarr.com/?page_id=21

Page 12: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

Centralisation

Page 13: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

For more technical insight into engineering Cloud Datacentres, and some of the software that runs within them, I recommended “The Datacentre as a Computer” by Barroso and

Hölzle.

http://www.morganclaypool.com/doi/abs/10.2200/S00516ED2V01Y201306CAC024

Page 14: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

Talked about “The Chaos Monkey” from Netflix.

https://github.com/Netflix/SimianArmy/wiki/Chaos-Monkey

http://blog.codinghorror.com/working-with-the-chaos-monkey/

Page 15: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

Cloud Computing is blackbox — difficult to teach and research when the main interface is a bland webpage!

Page 16: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

Microsoft, Dublin. $500 million.

Discussed — how are we to evaluate ideas and teach Cloud Computing?

Page 17: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

Microsoft, Dublin. $500 million.

Showed some images of large data centres. They cost around $500 million to build.

Page 18: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

SimulationSimulate a Cloud Computer. Fidelity? Convincing? Intangible.

Page 19: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

Build Something

Page 20: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

Doesn’t scale — ends up in a machine room — messy!

Page 21: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

What about a Scale Model?

Page 22: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

Why Raspberry Pi?£30 approx cost.

Ethernet (10/100Mbps).

Portable (small, low-power, < 500mA).

SD Cards (fast change).

GPIO pins.

Strong Community.

No more black boxes.

Page 23: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

To contain the Pi’s, we build racks from…

Lego, of course…

Page 24: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful
Page 25: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful
Page 26: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful
Page 27: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful
Page 28: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

O/S

API C C CFSFSFS

Pi1

Pi1

4O/S

API C C CFSFSFS

O/S

API C C CFSFSFS

Pi1

5Pi2

8O/S

API C C CFSFSFS

O/S

API C C CFSFSFS

Pi2

9Pi4

2O/S

API C C CFSFSFS

O/S

API C C CFSFSFS

Pi4

3Pi5

6O/S

API C C CFSFSFS

TORS

pim

ast

er API

Router

API - API DaemonC - ContainerFS - FIle SystemTORS - Top of Rack Switch

Apache

Image MgmtDNSDHCP

Page 29: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

Pi Cloud Software Stack

ARM System on Chip

Raspbian Linux

Docker

Shipyard RESTful APIs

Container Container Container

Web Server Database Hadoop Applications

Infrastructure

Page 30: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

Ceci n’est pas un cluster de calcul.

Page 31: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

Iridis-pi: a low-cost, compact demonstration cluster. Cox et al. Cluster Computing, June 2013.

Compute power of a supercomputer… from 1990. Not a computational beast!

Page 32: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

CostingComponent Unit Cost (£) Quantity Total (£)

Raspberry Pi Devices 24.10 56 1349.60USB Hubs 18.97 8 151.76Switches 126.35 4 505.40Router 98.94 1 98.94

Network Cables 0.62 56 34.72USB Cables Type 1 2.08 28 58.24USB Cables Type 2 0.78 28 21.84

PiMaster Free! 1 02220.50

Page 33: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

Total cost: £2000.

Page 34: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

Example Student Project

Page 35: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

An Art Installation

Page 36: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

Discussed an art installation I was asked to produce.

Involve vision recognition.

Use a Raspberry Pi and a PiCam Camera Module.

Page 37: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful
Page 38: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

Raw ImageFiltering

GreyscalingThresholding

Find Edges

Approximate PolygonsLocate Rectangle

Crop and Perspective Transform Original Image

Page 39: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

Captured Symbol

Thresholding

Outline Finding

Calculate Moments

Distance Matching against database

Thresholds (hacks) Classified image!

Page 40: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

http://www.bobbysayers.com/origin

Page 41: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful
Page 42: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

Since then, I’ve seen the Pi used in installations quite a lot.

Including at the Teller Gallery in Glasgow.

http://colocation-timedisplacement.migrating-origins.com

Page 43: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

The Pi makes a great media player

Good first Pi project…

http://www.raspbmc.com

Page 44: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

Raspberry Robot

Page 45: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful
Page 46: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

Student project using Lego Mindstorms as an exemplar for the AnyScale project.

Do you have a similar problem?

http://anyscale.org

Page 47: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

https://www.youtube.com/watch?v=owyJWicAbBE

Page 48: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful
Page 49: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

Conclusions

• The Raspberry Pi is a low-cost, portable and versatile self-contained computer.

• It’s a great teaching tool.

• It is too slow for many computationally-demanding tasks (but an update may be on the way!).

Page 50: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

AcknowledgementsPosco Tso, Jeremy Singer, Dimitris Pezaros, Simon Jouet, Richard Cziva, Robbie Simpson.

Bobby Sayers, Joe Joiner.

Justin McManus.

Page 51: Adventures in Pi - blogs.arts.gla.ac.uk · 700MHz ARM Processor (ARM 11 Family, v6 IS) Powerful GPU Lots of GPIO pins. ... ARM System on Chip Raspbian Linux Docker Shipyard RESTful

Learn MoreGet in touch!

[email protected]

@davidwhitecs @GlasgowPiCloud

http://raspberrypicloud.wordpress.com

http://www.bobbysayers.com/origin

https://jmcmanus1992.wordpress.com