Building Applications with IOx DevNet 1031 Albert Mak, Senior Technical Lead, IOx, Enterprise Engineering DEVNET-1031
Agenda Applications in Fog/Edge Computing Introducing IOx IOx Application Enablement Framework IOx Applications Building an IOx Application IOx Software Development Kit ioxclient Next Steps
Applications in Fog Computing
Applications in Fog Computing IoT Applications at the Edge Application Application Application Data Center and Cloud Business Applications Analytics Applications IoT PaaS Platforms Controllers, Management Systems, Billing, Operations, etc. Core High Latency Bandwidth Constrained Too Much Data Edge Embedded and Sensors No Local Control Disconnected Operation Unstable Links DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 5
Applications in Fog Computing Fog Computing What is Fog Computing? An architecture design combining compute, storage, control, management, and intercommunication of edge devices and clients Extension of the cloud down to the things One of the pillars of the Cisco IoT System Why do we need another concept? I refers to a unique problem domain Fog addresses network issues of latency, bandwidth and operational issues of autonomous operation, in-flow data analysis, and management overload http://www.cisco.com/c/en/us/solutions/internet-of-things/iot-fog-computing.html DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 6
Applications in Fog Computing Edge Use Case Examples Programmability Run custom python scripts to configure and manage Cisco router/switch Run third party configuration tooling in Cisco router/switch Network monitoring/audit Run packet and flow monitoring applications in the router/switch Aggregate network metrics at the edge with custom applications Connected lighting Manage PoE based building lighting infrastructure. DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 7
Introducing IOx
IOx What is IOx? IOx enables hosting of applications and services to be spread across the different network layers to achieve fog computing IOx enables applications to run on different Cisco hardware platforms (with different cpu arch) IOx application framework enables applications to be developed and managed uniformly IOx Application enablement covers all life cycle aspects of applications including development, distribution, deployment, hosting, monitoring and management. DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 9
IOx Architecture DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 10
IOx Key Components of IOX Cisco Application Hosting Framework (CAF) SDK ioxclient Local Manager Fog Director IOS Routing/Switching Network Security Access Control IOx Compute Application Management DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 11
IOx Application Enablement Framework
IOx Application Enablement Framework Overview What is it? What does it do? How does it do it? DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 13
Cisco Application Hosting Framework (CAF) Responsible for managing and orchestrating applications Application lifecycle management Install, Start, Stop, Monitor, Uninstall, Upgrade Application monitoring, metrics, troubleshooting and debugging Access to application and platform logs, access to application console, etc. Resource provisioning and management CPU, memory, network, storage, etc. DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 14
ioxclient Command line tool for Cisco IOx application development Available via software.cisco.com for (Windows, OS X, and Linux) Cloud and Systems Management > IoT Management and Automation > IOx Also packaged in the IOx SDK Getting help ioxclient showguide DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 15
IOx Local Manager Fog Application Provisioning Single Node Control Self Contained application available on all IOx device DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 16
Fog Director Fog Application Management Provisioning Change management Scalable Control Application monitoring Network infrastructure resource utilization Easily Adopted and Integrated Rest APIs Self-contained web application DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 17
IOx Application Enablement Framework - Platforms Platform CPU Relative Perf Memory (MB) Storage (MB) Status Application Types Language Runtimes C8xx ppc_32 1x 256 256 available Container, VM Python 2.7.3 IR829/IR809 x86_64 1.2x 360 512 available Container Python 2.7.3, Java-SE- Embedded 1.7, Java-SE- Embedded 1.8 Compact Profile 3 IE4K ppc_32 1.2x 512 256 Q1 17 Container Python 2.7.3 CGM-SRV- 64/128 x86_64 8.1x 3.5GB 5GB Q2 17 VM ISR4K/ASR1K x86_64 18-70x 4GB 20GB SSD/HDD Q1 17 VM Python 2.7.3 DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 18
IOx SDK Empower the Application Developers with set of tools to create, build, test and package their Applications for Cisco IOx enabled devices. Provide a Linux System/Distro for Cisco devices x86, PPC, ARM Available via software.cisco.com for Ubuntu Cloud and Systems Management > IoT Management and Automation > Iox https://software.cisco.com/download/ty pe.html?mdfid=286306005&flowid=792 82 DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 19
Components of SDK IOX tooling Documentation Linux Platform configurations Build examples and scripts DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 20
IOx Applications
IOx Applications Overview IOx Applications are compressed packages of code or binary resources that can be deployed to the Cisco Application Hosting Framework (CAF) There are different types of applications depending on your needs Platform as a Service (PaaS) Applications Container Applications Virtual Machine (VM) Applications The application package itself consists of several required and optional pieces A Package Descriptor file describing the information and resources of the application A Package Configuration file for applying configuration values during provisioning The binaries, application code, application libraries, virtual disks, root file system, and manifest of the application itself DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 22
IOx Applications Types of Applications Platform as a Service (PaaS) A PaaS application is a portable application written in high level languages such as Python or Java. PaaS applications can be deployed/installed on any IOx device with the required language runtimes and dependencies. Container (LXC) A Container application is a single package of the root file system, application code and dependencies like libraries and native binaries. Virtual Machine (VM) A VM application is a virtual machine that contains the full OS (kernel and root filesystem) along with the application code and dependencies in a single package. This is implemented on the ISR4K and ASR1K DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 23
IOx Applications Virtual Machine (VM) Application Application code Dependent libraries Configuration files, scripts, etc Language runtimes and frameworks VM disk image Application descriptor file DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 24
IOx Applications VM Application Package A file that captures application s metadata and runtime requirements Required Package descriptor file named package.yaml Package application/service artifacts file named artifacts.tar.gz Optional Package configuration file named package_config.ini Package manifest file named package.mf Documentation https://developer.cisco.com/media/iox-dev-guide-3-10- 16/concepts/app-package-format/ package.tar.gz package.tar package.yaml package.mf package_conf.ini artifacts.tar.gz artifacts.tar app.img (disk image) DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 25
IOx Applications Package Descriptor package.yaml YAML Ain't Markup Language (YAML) - http://www.yaml.org/ It is a file that captures application s metadata and runtime requirements Descriptive information about the application itself Usage information regarding CPU, disk, memory, and network resources Schema Available in Documentation https://developer.cisco.com/media/iox-dev-guide-3-10-16/concepts/package_descriptor/ DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 26
IOx Applications Package Descriptor Example descriptor-schema-version: "2.1" info: name: app-wireshark description: A wireshark application" version: "1.6" author-link: "http://www.cisco.com" author-name: "Cisco Systems" app: type: vm cpuarch: x86_64 resources: profile: custom cpu: 1500" disk: "10" memory: 300" network: - interface-name: eth0 startup: disks: - target-dev: "hdc file: "app.img qemu-guest-agent: TRUE DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 27
Demo - building IOx Application
Building an IOx Application using pre-built disk image Prepare your Build Environment Prepare disk image Create Application Package Deploy Application Running Application VMDK disk image from ESXi or Vmware Player Install /Config sdk Convert disk image Package App Deploy app Start app Create app QCOW2 Disk image in KVM Prepare app descriptor file DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 29
Building an IOx Application using SDK Yocto Image Prepare your Build Environment Prepare Source Code Compile Insert Custom Binaries to disk Image Create Application Package Deploy/Start Application Install/Config sdk Configure Yocto Packages to be added Build Yocto Disk Image Package App Deploy/ Start App Add Custom Source code Compile Custom Code Post Process Disk Image Prepare app descriptor file DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 30
Updating an IOx application with opkg Prepare your Build Environment Develop Software Create Application Package Deploy/ Start Application Add components Install/Confi g sdk Configure and build disk image Package App Deploy/ Start Console opkg install pkg Add Custom Source code Prepare app descriptor file DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 31
Resources
Resources IOx Downloads https://software.cisco.com/download/type.html?mdfid=286306005&flowid=79282 IOx Sample Applications https://github.com/ciscoiox DevNet Resources https://developer.cisco.com/site/iox https://github.com/ciscodevne DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 33
Complete Your Online Session Evaluation Give us your feedback to be entered into a Daily Survey Drawing. A daily winner will receive a $750 Amazon gift card. Complete your session surveys through the Cisco Live mobile app or from the Session Catalog on CiscoLive.com/us. Don t forget: Cisco Live sessions will be available for viewing on-demand after the event at CiscoLive.com/Online DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 34
Continue Your Education DevNet Zone Demos in the Cisco campus Walk-in Self-Paced Labs Table Topics Meet the Engineer 1:1 meetings Related sessions DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 35
Thank you
Building an IOx Application using prebuild disk image Step 1 : Prepare your Build Environment Install the IOx SDK or ioxclient https://software.cisco.com/download/type.html?mdfid=286306005&flowid=79282 DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 38
Building an IOx Application Step 2 : Prepare diskimage Method 1: convert an exported vmdk image to qcow2 qemu-img convert Ubuntu-flat.vmdk -O qcow2 Ubuntu.qcow2 Method 2: create KVM VM with qcow2 image /usr/bin/qemu-img create -f qcow2 -o preallocation=metadata /export/vmimgs/ubuntu.qcow2 8G Create VM with qcow2 image. DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 39
Building an IOx Application Step 3 : Package the Application ioxclient Use the ioxclient package command ioxclient package. Be careful not to include other items in your source directory Git.dotfiles DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 40
Building an IOx Application Step 4 : Deploy and starting the Application IOx Local Manager Browse to the HTTP address of the device at port 8443 Under the Applications tab, click the Add/Deploy button Under the Application tab, click the start button for the deployed application DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 41
Building an IOx Application Step 5 : Access the Application Console on the ISR4K Connecting to IOS console virtual-service connect name <app-id> console To exit console, type ctl-c three times DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 42
Building an IOx Application using IOx SDK Step 1: Installing IOx SDK DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 43
Building an IOx Application using IOx SDK Step 1: IOx SDK Installation On Ubuntu 14.04 sudo apt-get update Download the IOx SDK https://software.cisco.com/download/type.html?mdfid=286306005&flowid=79282 Install the IOx SDK chmod +x ioxsdk-1.0.0.0.bin./ioxsdk-1.0.0.0.bin Agree to the License Agreement Specify your installation details»directory (default: /opt/iox-sdk/)»install the requirements during the installation source /opt/iox-sdk/sourceme DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 44
Building an IOx Application using IOx SDK Step 2: Creating an sample application DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 45
IOx Application Enablement Framework IOx SDK iox Tool to manage iox packages ioxclient Command line tool for Cisco IOx application development DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 46
IOx Application Enablement Framework ioxclient Command line tool for Cisco IOx application development Available via software.cisco.com for (Windows, OS X, and Linux) Cloud and Systems Management > IoT Management and Automation > IOx Also packaged in the IOx SDK Getting help ioxclient showguide DEVNET-1031 2016 Cisco and/or its affiliates. All rights reserved. Cisco Public 47