summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/book-enea-nfv-access-guide-intel/doc/using_nfv_access_sdks.xml127
1 files changed, 50 insertions, 77 deletions
diff --git a/doc/book-enea-nfv-access-guide-intel/doc/using_nfv_access_sdks.xml b/doc/book-enea-nfv-access-guide-intel/doc/using_nfv_access_sdks.xml
index 8a3bd27..075675e 100644
--- a/doc/book-enea-nfv-access-guide-intel/doc/using_nfv_access_sdks.xml
+++ b/doc/book-enea-nfv-access-guide-intel/doc/using_nfv_access_sdks.xml
@@ -72,6 +72,10 @@
72 <para>Environment Setup Script which defines the environment 72 <para>Environment Setup Script which defines the environment
73 variables</para> 73 variables</para>
74 </listitem> 74 </listitem>
75
76 <listitem>
77 <para>Element ODM SDK</para>
78 </listitem>
75 </itemizedlist> 79 </itemizedlist>
76 80
77 <para>To install the SDK on your host development machine, there is an 81 <para>To install the SDK on your host development machine, there is an
@@ -123,6 +127,19 @@
123 </orderedlist> 127 </orderedlist>
124 </section> 128 </section>
125 129
130 <section id="install-odm-sdk">
131 <title>Installing the Element ODM SDK</title>
132
133 <para>The Element ODM SDK contains a compressed archive file,
134 odm-sdk-x.y.z-arch.tar.gz. Please refer to the Element ODM documentaion
135 located at the Documentaion folder for how to install and use the ODM
136 SDK.</para>
137
138 <programlisting>Documentation/
139 Element_ODM_Kick_Start_Guide.pdf
140 Element_On_Device_Mgmt_Guide.pdf</programlisting>
141 </section>
142
126 <section id="crosscomp-apps"> 143 <section id="crosscomp-apps">
127 <title>Cross-Compiling Applications from Command Line</title> 144 <title>Cross-Compiling Applications from Command Line</title>
128 145
@@ -388,7 +405,7 @@ NOTE: devtool creates a Git repository locally during the extraction under
388 <listitem> 405 <listitem>
389 <para>Use any recipe from &lt;SDK_dir&gt;/layers/poky/meta*</para> 406 <para>Use any recipe from &lt;SDK_dir&gt;/layers/poky/meta*</para>
390 407
391 <programlisting>$ devtool mdify recipe 408 <programlisting>$ devtool modify recipe
392 409
393EX: 410EX:
394$ devtool modify curl</programlisting> 411$ devtool modify curl</programlisting>
@@ -453,9 +470,11 @@ NOTE: following directories and files are created:
453 <para><programlisting>$ devtool build [recipe] 470 <para><programlisting>$ devtool build [recipe]
454 471
455EX: 472EX:
473$ devtool build bbexample
474or
456$ devtool build isic</programlisting>The recipe build results can be seen 475$ devtool build isic</programlisting>The recipe build results can be seen
457 here:<literal> 476 here:<literal>
458 <literal>&lt;SDK_dir&gt;/tmp/work/&lt;arch&gt;-enea-linux/isic</literal></literal></para> 477 <literal>&lt;SDK_dir&gt;/tmp/work/&lt;arch&gt;-enea-linux/&lt;recipe&gt;</literal></literal></para>
459 </listitem> 478 </listitem>
460 </orderedlist> 479 </orderedlist>
461 </section> 480 </section>
@@ -477,8 +496,17 @@ $ devtool build isic</programlisting>The recipe build results can be seen
477 <listitem> 496 <listitem>
478 <para>Deploy to target:</para> 497 <para>Deploy to target:</para>
479 498
480 <programlisting>$ devtool deploy-target isic root@&lt;target_ip_address&gt; 499 <programlisting>Example 1: deploy bbexample application
481root@xeon-d:~# isic 500$ devtool deploy-target bbexample root@&lt;target_ip_address&gt;
501
502Now run the bbexample on target:
503# bbexample
504Hello Yocto World...
505Hello World (from a shared library!)
506
507Example 2: deploy isic application
508$ devtool deploy-target isic root@&lt;target_ip_address&gt;
509# isic
482isic: error while loading shared libraries: libnet.so.9: cannot open shared 510isic: error while loading shared libraries: libnet.so.9: cannot open shared
483object file: No such file or directory 511object file: No such file or directory
484 512
@@ -488,9 +516,8 @@ $ devtool modify libnet
488$ devtool build libnet 516$ devtool build libnet
489$ devtool deploy-target libnet root@&lt;target_ip_address&gt; 517$ devtool deploy-target libnet root@&lt;target_ip_address&gt;
490 518
491Now isic runs on target: 519Now run the isic on target:
492 520# isic
493root@xeon-d:~# isic
494usage: isic [-v] [-D] -s &lt;source ip&gt; -d &lt;destination ip&gt; [-r &lt;random seed&gt;] 521usage: isic [-v] [-D] -s &lt;source ip&gt; -d &lt;destination ip&gt; [-r &lt;random seed&gt;]
495...</programlisting> 522...</programlisting>
496 </listitem> 523 </listitem>
@@ -501,102 +528,48 @@ usage: isic [-v] [-D] -s &lt;source ip&gt; -d &lt;destination ip&gt; [-r &lt;ran
501 528
502 <programlisting>$ devtool undeploy-target isic root@&lt;target_ip_address&gt;</programlisting> 529 <programlisting>$ devtool undeploy-target isic root@&lt;target_ip_address&gt;</programlisting>
503 </listitem> 530 </listitem>
504
505 <listitem>
506 <para>Delete recipe and source files from workspace:</para>
507
508 <programlisting>$ devtool finish isic recipes/isic
509
510NOTE: Leaving source tree &lt;SDK_dir&gt;/workspace/sources/isic as-is;
511if you no longer need it then please delete it manually
512
513rm -rf &lt;SDK_dir&gt;/workspace/appends/isic_0.07.bbappend
514rm -rf &lt;SDK_dir&gt;/workspace/source/isic</programlisting>
515 </listitem>
516 </orderedlist> 531 </orderedlist>
517 </section> 532 </section>
518 533
519 <section id="docker_deploy"> 534 <section id="docker_deploy">
520 <title>Creating and Deploying a Docker image</title> 535 <title>Creating and Deploying a Docker image</title>
521 536
522 <para>Docker can build images automatically by reading the instructions 537 <para>You can build a docker container image from your Extensible SDK
523 from a Dockerfile. A Dockerfile is a text document that contains all the 538 and add your application into the container image.</para>
524 commands a user could call on the command line to assemble an image. For
525 detailed info about docker, please refer to the <ulink
526 url="https://docs.docker.com/">Docker documentation.</ulink></para>
527 539
528 <orderedlist> 540 <orderedlist>
529 <listitem> 541 <listitem>
530 <para>Create a Dockefile for helloworld:</para> 542 <para>Create container image recipe in the workspace layer e.g.
531 543 cont-image and add the following lines:</para>
532 <programlisting>#######################################
533# helloworld example Dockerfile
534########################################
535
536FROM ubuntu
537MAINTAINER John Smith &lt;John.Smith@gmail.com&gt;
538LABEL version="0.1" description="Helloworld example"
539
540COPY path/to/helloworld /helloworld
541
542CMD /helloworld</programlisting>
543
544 <note>
545 <para>Don't forget to add required dependecies for the recipe in
546 the docker image as well. As we saw in the previous example isic
547 depended on libnet so we had to build and deploy libnet to target
548 separately. The same needs to be done here, e.g. if you build a
549 docker image for isic, you need to add libnet to the container
550 filesystem.</para>
551 </note>
552 </listitem>
553
554 <listitem>
555 <para>Build it:</para>
556 544
557 <programlisting>$ docker build . 545 <programlisting>IMAGE_INSTALL += "your_application"
558.....
559Successfully built fb7d03c7cba1</programlisting>
560 </listitem>
561 546
562 <listitem> 547LICENSE = "MIT"
563 <para>Run the docker image:</para>
564 548
565 <programlisting>$ docker run --name helloworld fb7d03c7cba1 549IMAGE_FSTYPES = "container"
566Hello World run from host!!</programlisting>
567 </listitem>
568
569 <listitem>
570 <para>Save:</para>
571 550
572 <programlisting>$ docker save fb7d03c7cba1 | gzip &gt; helloworld.tar.gz</programlisting> 551inherit core-image</programlisting>
573 </listitem> 552 </listitem>
574 553
575 <listitem> 554 <listitem>
576 <para>Deploy to target:</para> 555 <para>Add the following line in local.conf:</para>
577 556
578 <programlisting>$ scp helloworld.tar.gz root@&lt;target IP-address&gt;:/home/root</programlisting> 557 <programlisting>IMAGE_CONTAINER_NO_DUMMY = "1"</programlisting>
579 </listitem> 558 </listitem>
580 559
581 <listitem> 560 <listitem>
582 <para>Load the docker image on target:</para> 561 <para>Build the container image:</para>
583
584 <programlisting>root@xeon-d:~# docker load -i helloworld.tar.gz</programlisting>
585 </listitem>
586 562
587 <listitem> 563 <programlisting>$ devtool build-image cont-image
588 <para>List docker images:</para>
589 564
590 <programlisting>root@xeon-d:~# docker images 565NOTE: The image build result can be seen here:<literal>
591REPOSITORY TAG IMAGE ID CREATED SIZE 566 <literal>&lt;SDK_dir&gt;</literal></literal>/tmp/deploy/images/qemux86-64/</programlisting>
592&lt;none&gt; &lt;none&gt; fb7d03c7cba1 3 hours ago 79.6MB</programlisting>
593 </listitem> 567 </listitem>
594 568
595 <listitem> 569 <listitem>
596 <para>Run the docker image:</para> 570 <para>Copy the image to target and import in Docker:</para>
597 571
598 <programlisting>root@xeon-d:~# docker run fb7d03c7cba1 572 <programlisting># docker import cont-image-qemux86.tar.bz2 your_application</programlisting>
599Hello World run from inside docker target!!</programlisting>
600 </listitem> 573 </listitem>
601 </orderedlist> 574 </orderedlist>
602 </section> 575 </section>