diff options
| author | Sona Sarmadi <sona.sarmadi@enea.com> | 2018-06-15 16:30:06 +0200 |
|---|---|---|
| committer | Sona Sarmadi <sona.sarmadi@enea.com> | 2018-06-15 17:43:35 +0200 |
| commit | e51010980185f9dccb35fc1ef1657438c4c204af (patch) | |
| tree | 320d107909037d372fedca647753e560d1ce2132 | |
| parent | 665d5b76055d719e2934fc48c26e3f2ad091eda8 (diff) | |
| download | nfv-access-documentation-e51010980185f9dccb35fc1ef1657438c4c204af.tar.gz | |
SDKs: updated Using the Enea NFV Access SDKs
- Added Extensible SDK
- Added Element ODM section
Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
| -rw-r--r-- | doc/book-enea-nfv-access-guide-intel/doc/using_nfv_access_sdks.xml | 127 |
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 <SDK_dir>/layers/poky/meta*</para> | 406 | <para>Use any recipe from <SDK_dir>/layers/poky/meta*</para> |
| 390 | 407 | ||
| 391 | <programlisting>$ devtool mdify recipe | 408 | <programlisting>$ devtool modify recipe |
| 392 | 409 | ||
| 393 | EX: | 410 | EX: |
| 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 | ||
| 455 | EX: | 472 | EX: |
| 473 | $ devtool build bbexample | ||
| 474 | or | ||
| 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><SDK_dir>/tmp/work/<arch>-enea-linux/isic</literal></literal></para> | 477 | <literal><SDK_dir>/tmp/work/<arch>-enea-linux/<recipe></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@<target_ip_address> | 499 | <programlisting>Example 1: deploy bbexample application |
| 481 | root@xeon-d:~# isic | 500 | $ devtool deploy-target bbexample root@<target_ip_address> |
| 501 | |||
| 502 | Now run the bbexample on target: | ||
| 503 | # bbexample | ||
| 504 | Hello Yocto World... | ||
| 505 | Hello World (from a shared library!) | ||
| 506 | |||
| 507 | Example 2: deploy isic application | ||
| 508 | $ devtool deploy-target isic root@<target_ip_address> | ||
| 509 | # isic | ||
| 482 | isic: error while loading shared libraries: libnet.so.9: cannot open shared | 510 | isic: error while loading shared libraries: libnet.so.9: cannot open shared |
| 483 | object file: No such file or directory | 511 | object 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@<target_ip_address> | 517 | $ devtool deploy-target libnet root@<target_ip_address> |
| 490 | 518 | ||
| 491 | Now isic runs on target: | 519 | Now run the isic on target: |
| 492 | 520 | # isic | |
| 493 | root@xeon-d:~# isic | ||
| 494 | usage: isic [-v] [-D] -s <source ip> -d <destination ip> [-r <random seed>] | 521 | usage: isic [-v] [-D] -s <source ip> -d <destination ip> [-r <random seed>] |
| 495 | ...</programlisting> | 522 | ...</programlisting> |
| 496 | </listitem> | 523 | </listitem> |
| @@ -501,102 +528,48 @@ usage: isic [-v] [-D] -s <source ip> -d <destination ip> [-r <ran | |||
| 501 | 528 | ||
| 502 | <programlisting>$ devtool undeploy-target isic root@<target_ip_address></programlisting> | 529 | <programlisting>$ devtool undeploy-target isic root@<target_ip_address></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 | |||
| 510 | NOTE: Leaving source tree <SDK_dir>/workspace/sources/isic as-is; | ||
| 511 | if you no longer need it then please delete it manually | ||
| 512 | |||
| 513 | rm -rf <SDK_dir>/workspace/appends/isic_0.07.bbappend | ||
| 514 | rm -rf <SDK_dir>/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 | |||
| 536 | FROM ubuntu | ||
| 537 | MAINTAINER John Smith <John.Smith@gmail.com> | ||
| 538 | LABEL version="0.1" description="Helloworld example" | ||
| 539 | |||
| 540 | COPY path/to/helloworld /helloworld | ||
| 541 | |||
| 542 | CMD /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 | ..... | ||
| 559 | Successfully built fb7d03c7cba1</programlisting> | ||
| 560 | </listitem> | ||
| 561 | 546 | ||
| 562 | <listitem> | 547 | LICENSE = "MIT" |
| 563 | <para>Run the docker image:</para> | ||
| 564 | 548 | ||
| 565 | <programlisting>$ docker run --name helloworld fb7d03c7cba1 | 549 | IMAGE_FSTYPES = "container" |
| 566 | Hello World run from host!!</programlisting> | ||
| 567 | </listitem> | ||
| 568 | |||
| 569 | <listitem> | ||
| 570 | <para>Save:</para> | ||
| 571 | 550 | ||
| 572 | <programlisting>$ docker save fb7d03c7cba1 | gzip > helloworld.tar.gz</programlisting> | 551 | inherit 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@<target IP-address>:/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 | 565 | NOTE: The image build result can be seen here:<literal> |
| 591 | REPOSITORY TAG IMAGE ID CREATED SIZE | 566 | <literal><SDK_dir></literal></literal>/tmp/deploy/images/qemux86-64/</programlisting> |
| 592 | <none> <none> 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> |
| 599 | Hello World run from inside docker target!!</programlisting> | ||
| 600 | </listitem> | 573 | </listitem> |
| 601 | </orderedlist> | 574 | </orderedlist> |
| 602 | </section> | 575 | </section> |
