Snappy Ubuntu Core |
您所在的位置:网站首页 › rroqq › Snappy Ubuntu Core |
=20
=20
=20
Required softw=
are components=20
Topology=20
Con=
figuring and building sample Kaa client=20
Building snappy pac=
kage=20
Installing snappy =
Ubuntu=20
I=
nstalling sample Kaa client on snappy Ubuntu=20
Further reading=
=20
=20
The following instructions explain how to build a Kaa endpoint SDK and i= ntegrate it with snappy Ubuntu Core. Required software co= mponentsEnsure the following components are installed on your machine. VirtualBox Vagrant Latest Kaa sandbox TopologyTo integrate Kaa with snappy Ubuntu Core, you need to use two virtual bo= xes: one to deploy snappy Ubuntu and a Kaa client and the other to deploy t= he Kaa sandbox. Configuri= ng and building sample Kaa clientWe assume that the Kaa sandbox = is already started. NOTE: Make sure that the Kaa client is ab= le to connect to Bootstrap and Operations servers deployed on the Kaa sandb= ox. To configure and build a sample Kaa client, proceed as follows: Go to http://localhost:8080/sandbox/. Enter the IP address of your Kaa sanbox VM into the text field and then= click Change (in the following screenshot, the IP address= is 192.168.100.100).= i> Wait till the service restarts.Get the latest Kaa code from github. =20 $ git clone gi= [email protected]:kaaproject/kaa.git $ cd kaa/examples/ =20Configure and generate C SDK for your Kaa client.NOTE: You can f= ind sample Avro schemas in c-sdk-sample/avro/path. Avro schemas =20 $ ls c-sdk-sam= ple/avro/ configuration.avsc log.avsc profile.avsc=20 Create a snappy application in web UI. NOTE: Refer to managing applic= ations in case of difficulties. Add a new configuration schema for your application (look= at c= onfiguration.avsc).NOTE: Refer to the configuration s= chema section in Admin UI guide in case of difficulties. Add a new profile schema for your application (look at profile.avsc).NOTE:= span> Refer to the profile schema section in Admin UI = guide in case of difficulties. Add a new log schema for your application (look at log.avsc).NOTE:= Refer to the log schema section in Admin UI guide in case of dif= ficulties. Generate the C SDK for your application.NOTE: Refer t= o the generating SDK section in Admin UI guide in case of di= fficulties.Build a Kaa client with the generated C SDK. Remove ev= erything in the c-sdk-sample/libs/kaa folder and unzip the generated SDK to= that folder. Build C Kaa client =20 $ rm -rf kaa/e= xamples/c-sdk-sample/libs/kaa/* # remove existing files $ tar -cvzf kaa-client-sdk-p2-c2-n1-l2.tar.gz kaa/examples/c-sdk-sample/lib= s/kaa/ # untar Kaa sdk $ ./build.sh clean build #build client=20If the build is successful, you will get the result on your screen= as follows: Build result =20 [100%] Built = target kaac_s -- The C compiler identification is GNU 4.8.2 -- The CXX compiler identification is GNU 4.8.2 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libssl.so;/usr/lib/x86_64-linux= -gnu/libcrypto.so (found version "1.0.1f")=20 -- Configuring done -- Generating done -- Build files have been written to: /home/igor/code/github/kaa/examples/c-= sdk-sample/build Scanning dependencies of target sample_c_client [100%] Building C object CMakeFiles/sample_c_client.dir/src/kaa_demo.c.o Linking C executable sample_c_client [100%] Built target sample_c_client=20For detailed information on building and configuring Kaa C SDK= , please refer to this= page. Building snappy package= h2>To build a snap package, proceed as follows: Install snappy Ubuntu tools by executing the following commands eith= er from Ubuntu or from the Kaa sandbox (in case you are using another OS). = Building inside Kaa sandbox is preferable, because system upgrade step may = harm your system. Install Snappy tools =20 $ sudo add-apt= -repository ppa:snappy-dev/beta $ sudo apt-get update $ sudo apt-get upgrade #do it for your own risk, you better to use virtual= machine $ sudo apt-get install snappy-tools=20Create the correct folder structure. Refer to the official snappy Ub= untu Core documentation for details. =20 $ mkdir snappy= -kaa $ mkdir snappy-kaa/meta $ mkdir snappy-kaa/bin =20Copy the previously built Kaa client to the snappy-kaa/bin directory= . =20 $ cp kaa/examp= les/c-sdk-sample/build/sample_c_client snappy-kaa/bin/client # Copy with re= name sample client to bin directory=20Create the package.yaml file in the snappy-kaa/meta directory with t= he following context. package.yaml =20 name: kaa vendor: Vendor Name icon: meta/kaa.png version: 0.0.1 binaries: - name: bin/client description: "snappy example: kaa c client"=20Create the readme.md file in the snappy-kaa/meta directory with the = following context. readme.md =20 Minimal C Kaa = client for snappy Any other info about your application. =20Build a snap package from the snappy-kaa directory. Build snappy package =20 $ snappy build= snappy-kaa =20As a result, you should get the kaa_0.0.1_all.snap file. =20 $ ls snappy-ka= a bin kaa_0.0.1_all.snap meta=20Known issue: your readme.md should contain at least two lines of t= ext or package build will silently fail. this is some kind of undocumented = behavior. Installing snappy Ubuntu=To locally deploy snappy Ubuntu, run the following commands. Deploy Snappy ubuntu =20 $ vagrant init= ubuntu/ubuntu-core-devel-amd64 $ vagrant up $ vagrant ssh =20As a result, you should be connected to your snappy Ubuntu box. =20 Welcome to Ub= untu Vivid Vervet (development branch) (GNU/Linux 3.18.0-9-generic x86_64) * Documentation: https://help.ubuntu.com/ Welcome to the Ubuntu Core rolling development release. * See https://ubuntu.com/snappy It's a brave new world here in snappy Ubuntu Core! This machine does not use apt-get or deb packages. Please see 'snappy --help' for app installation and transactional updates. Last login: Tue Feb 24 15:32:09 2015 from 10.0.2.2 ubuntu@localhost:~$ =20 Install= ing sample Kaa client on snappy UbuntuTo install the previously built sample Kaa client on snappy Ubuntu, proc= eed as follows: From the snappy Ubuntu shell, copy kaa_0.0.1_all.snap from your host= machine. Get and install snap package =20 $ scp username= @remote_machine_ip:path/to/your/remote/snapp/file . # Copy kaa_0.0.1_all.sn= ap from your host machine or Kaa sandbox. $ snappy install ./path/to/your/local/snapp/file --allow-unauthenticated= =09# Install kaa_0.0.1_all.snap=20Start the Kaa client on the snappy Ubuntu box. Start Kaa client =20 $ kaa.client=20As a result, you should get the logs similar to the following: =20 Initializing = Kaa driver...Initializing Kaa SDK... 2015/02/25 14:14:40 [INFO] [kaa.c:200] (0) - Kaa SDK version 0.7.0-SNAPSHOT= , commit hash=20 2015/02/25 14:14:40 [DEBUG] [kaa_logging.c:110] (0) - Initialized log colle= ctor with log storage {0x7f1134000c70}, log upload strategy {0x7f1134000fd0= } 2015/02/25 14:14:40 [TRACE] [kaa_demo.c:170] (0) - Creating endpoint profil= e 2015/02/25 14:14:40 [TRACE] [kaa_demo.c:178] (0) - Setting profile 2015/02/25 14:14:40 [INFO] [kaa_profile.c:406] (0) - Endpoint profile is up= dated 2015/02/25 14:14:40 [WARNING] [kaa_channel_manager.c:357] (-6) - Failed to = find transport channel for service 1 2015/02/25 14:14:40 [TRACE] [kaa_demo.c:181] (0) - Adding transport channel= s 2015/02/25 14:14:40 [TRACE] [kaa_tcp_channel.c:166] (0) - Kaa TCP channel c= reating.... 2015/02/25 14:14:40 [TRACE] [kaa_tcp_channel.c:247] (0) - Kaa TCP channel k= eepalive is 300 2015/02/25 14:14:40 [TRACE] [kaa_tcp_channel.c:256] (0) - Kaa TCP channel (= protocol: id=3D0x56C8FF92, version=3D1) 2015/02/25 14:14:40 [TRACE] [kaa_tcp_channel.c:294] (0) - Kaa TCP channel c= reated 2015/02/25 14:14:40 [TRACE] [kaa_tcp_channel.c:166] (0) - Kaa TCP channel c= reating.... 2015/02/25 14:14:40 [TRACE] [kaa_tcp_channel.c:247] (0) - Kaa TCP channel k= eepalive is 300 2015/02/25 14:14:40 [TRACE] [kaa_tcp_channel.c:256] (0) - Kaa TCP channel (= protocol: id=3D0x56C8FF92, version=3D1) 2015/02/25 14:14:40 [TRACE] [kaa_tcp_channel.c:294] (0) - Kaa TCP channel c= reated 2015/02/25 14:14:40 [INFO] [kaa_channel_manager.c:229] (0) - Bootstrap tran= sport channel [0x1F2082EE] added (protocol: id=3D0x56C8FF92, version=3D1) ...=20 Further readingTo learn more about snappy Ubuntu Core, visit the official Ubuntu web site. To learn more about Kaa, look at the following guides and references. = >Guide What it is= for Getting started= p> Use it to quickly create your f= irst Kaa application. Design reference Use this reference to learn about features an= d capabilities of Kaa (Endpoint profiling, Events, Notifications, Logging, and other= features). Programming guide= a> Use this guide to create your o= wn Kaa applications. |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |