AGL Software Development Kit - events.static.linuxfound.org · AGL Software Development Kit Feb 23,...

Post on 29-Mar-2020

20 views 0 download

Transcript of AGL Software Development Kit - events.static.linuxfound.org · AGL Software Development Kit Feb 23,...

AGL Software Development Kit

Stéphane DesneuxCTO at IoT.bzh<sdx@iot.bzh>

AMM - TokyoWinter 2016

Feb 23, 2016AGL Software Development Kit 2

IoT.bzh● Specialized on Embedded & IoT● Contributing to AGL Project

for Renesas● Expertise domains:

– System architecture– Security– Application Framework– Graphics & Multimedia– Middleware– Linux Kernel

● Located in Brittany, France

Feb 23, 2016AGL Software Development Kit 3

Agenda

● SDK Explained● Building the SDK in a Docker image● Demo - AGL 1.0 SDK● Future enhancements● Demo - AGL next SDK● Q&A

Feb 23, 2016AGL Software Development Kit 4

SDK Explained

Feb 23, 2016AGL Software Development Kit 5

Context

● HTML5, native or hybrid applications on top of the AGL BSP for a specific board

● Bypass shortage of Yocto skills– ~ 0.5M embedded developers– ~ 17M web & mobile apps developers

● Heterogeneous environments: for a good adoption, the SDK should work in various environments: Windows, Linux, Mac OS

Feb 23, 2016AGL Software Development Kit 6

Proposed Features

● IDE - Integrated Development Environment● Develop source code ● Build for a selected AGL target board

(cross-compiling)● Deploy the software package onto a target

board or an emulator● Remotely run & debug the software

package in the target environment

Feb 23, 2016AGL Software Development Kit 7

Proposed architecture

Feb 23, 2016AGL Software Development Kit 8

Benefits● Naturally aligned with the BSP

– a SDK container is built after each BSP container, for every snapshot– applications in the SDK are built with the same toolchain as the BSP.

● Stability & Uniformity– a container provides simple, unbiased build environments– independent of the host system

● Ubiquity– a SDK container may run on the Cloud, on-premises, on developers

hosts …● Cost & Time to market

– out-of-the-box solution– applications developed faster and ready earlier

● Long Term Support– re-create the development environment decades after product release

Feb 23, 2016AGL Software Development Kit 9

Availability

● Available for AGL Albacore 1.0 on Renesas Porter since January 2016

http://iot.bzh/download/public/2016/sdk/

Feb 23, 2016AGL Software Development Kit 10

Building the SDK

Feb 23, 2016AGL Software Development Kit 11

Three base components

1: Base Docker image - Debian 8.x

2: AGL Application Development Toolkit

3: IDE - Eclipse

Feb 23, 2016AGL Software Development Kit 12

1: SDK Base Docker Image● Based on latest Debian 8.x● Meets the requirements for both Yocto ADT

and Eclipse IDE● XRDP Server, very light desktop environment

(OpenBox)● Extra tools:

– gcc, g++ (x86_64 native toolchain), cmake, ccache, git, ...

– nodejs, gulp, bower (HTML5 development)● Upgradable and expandable:

– this is a genuine Debian image, with “full” comfort– apt-get update && apt-get install <whatever>

Feb 23, 2016AGL Software Development Kit 13

2: AGL App Dev Toolkit● produced by bitbake using Yocto/OE tools

and AGL layers

bitbake agl-image-ivi-crosssdk● auto-installable archive, ~400MB● content:

– cross toolchain (gcc, g++, binutils for the target platform)

– C/C++ headers depending on distribution content– static and dynamic libraries– Target sysroot, Native sysroot

● should be built and published in every AGL snapshot/release for all target boards

Feb 23, 2016AGL Software Development Kit 14

3: Integrated Dev Environment

● Eclipse IDE is popular and widely spread

● Maintained by Eclipse.org and Codenvy● Many plugins are available, in

particular:– Yocto ADT plugin– TCF (WindRiver) for deployment, access

and remote debug on a target board (even behind firewalls)

● Eclipse Kepler for Yocto 1.7 compatibility

Feb 23, 2016AGL Software Development Kit 15

Building SDK in a container

● Instantiate a new SDK base container● Copy and install AGL ADT archive● Install Eclipse IDE and plugins● Finalize environment (XRDP server, user

homescreen, extra tools ...)● Commit the container into a new image

Feb 23, 2016AGL Software Development Kit 16

Docker: Publish & Deploy

● Tag the SDK image with unique id:– IMAGE_ID=agl/sdk-porter-snapshot:b141

– docker tag 75293fda2e39 $IMAGE_ID

● Push to Docker hub or private Registry:– docker push $IMAGE_ID

● A developer can then grab and run the image:– docker run -p 3389 --privileged \

-v /sys/fs/cgroup:/sys/fs/cgroup:ro agl/sdk-porter-snapshot:b141

Feb 23, 2016AGL Software Development Kit 17

Deploy without Docker Hub

● Tag the SDK image with unique id:– IMAGE_ID=agl/sdk-porter-snapshot:b141

– docker tag 75293fda2e39 $IMAGE_ID

● Export the image to a file and publish it on the web:– docker save $IMAGE_ID | xz -T0 -c >sdk-porter-snapshot_b141.xz

– scp sdk-porter-snapshot_b141.xz www@webserver:/srv/www/htdocs/downloads/

● A developer can then grab and run the image:– curl http://.../sdk-porter-snapshot_b141.xz | docker load

– docker run -p 3389 --privileged \

-v /sys/fs/cgroup:/sys/fs/cgroup:ro agl/sdk-porter-snapshot:b141

Feb 23, 2016AGL Software Development Kit 18

Demo: AGL 1.0 SDKfor Renesas Porter board

Feb 23, 2016AGL Software Development Kit 19

Renesas Porter Board● R-Car M2 SoC

– ARM Cortex-A15– Dual Core 1.5GHz– Multimedia Engine– GPU PowerVR SGX544MP2

● 2GB DDR3● 2 Flash Mem Chips● Ethernet● Storage: SATA, SD, microSD● Video: Analog In, HDMI Out● Audio: In/Out● USB 2.0● CAN Transceiver

Feb 23, 2016AGL Software Development Kit 20

AGL SDK Initialization● Load the SDK Docker image:

● Instantiate a new SDK Container named 'aglsdk':

● Open a new RDP session on localhost:3389

docker pull docker.iot.bzh/agl/snapshot-stable-sdk:1.0

docker run --publish=3389:3389 --detach=true \ --privileged \ --hostname=aglsdk --name=aglsdk \ -v /sys/fs/cgroup:/sys/fs/cgroup:ro \ docker.iot.bzh/agl/snapshot-stable-sdk:1.0

xfreerdp -u devel -p devel -g 1200x700 localhost

Feb 23, 2016AGL Software Development Kit 21

Connect through RDP

RDP session starting Eclipse IDE Initial Screen

Feb 23, 2016AGL Software Development Kit 22

Build a C/C++ program

Cross-compilation using Yocto & Eclipse

Feb 23, 2016AGL Software Development Kit 23

Remote debugging

Remote debugging on Eclipse using SSH and gdbserver

Feb 23, 2016AGL Software Development Kit 24

Future Enhancements

Feb 23, 2016AGL Software Development Kit 25

Future enhancements

● Use Eclipse Che (next generation IDE)– Web & Containers based– Support for C/C++ and HTML5 apps

● AGL specific plugin for Eclipse can be developed

Feb 23, 2016AGL Software Development Kit 26

Eclipse Che Architecture

https://www.filepicker.io/api/file/O3D1OORwRmCWzuE8mD2s

Feb 23, 2016AGL Software Development Kit 27

Next SDK Architecture

Feb 23, 2016AGL Software Development Kit 28

Technical Improvements

● Smaller SDK image:– Remove RDP– ADT cleanup

● Target board emulation through Qemu● Solve permission conflicts on shared files

due to lack of UID mapping in Docker

Feb 23, 2016AGL Software Development Kit 29

Demo: AGL 2.0 SDK previewbased on Eclipse Che

Feb 23, 2016AGL Software Development Kit 30

Building HTML5 Application

● Standard Web and Mobile build environment:– Angular.js, Foundation for Apps

● Build system:– Code optimization, compression– Support Development/Production modes

● Associated browser:– Debugging in Chromium– LiveReload extension

Feb 23, 2016AGL Software Development Kit 31

HTML5 Apps

Radio, Annex, Rabbit

Feb 23, 2016AGL Software Development Kit 32

Application Framework Design

Feb 23, 2016AGL Software Development Kit 33

Eclipse Che: dashboard

Feb 23, 2016AGL Software Development Kit 34

Eclipse Che: new project

Feb 23, 2016AGL Software Development Kit 35

Eclipse Che: HTML5 workspace

Feb 23, 2016AGL Software Development Kit 36

Q&A

Gulf of Morbihan, south of Brittany, France

Feb 23, 2016AGL Software Development Kit 37

Links

● IoT.bzh: www.iot.bzh● AGL SDK downloads:

http://iot.bzh/download/public/2016/sdk/● Eclipse: www.eclipse.org ● Docker: www.docker.com● Yocto Project: www.yoctoproject.org