From: ogawa.yasufumi@lab.ntt.co.jp
To: ferruh.yigit@intel.com, spp@dpdk.org
Cc: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
Subject: [spp] [PATCH 07/15] docs: add build image guide for SPP container
Date: Fri, 15 Jun 2018 16:06:07 +0900 [thread overview]
Message-ID: <20180615070615.15594-8-ogawa.yasufumi@lab.ntt.co.jp> (raw)
In-Reply-To: <20180615070615.15594-1-ogawa.yasufumi@lab.ntt.co.jp>
From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
docs/guides/tools/sppc/build_img.rst | 181 +++++++++++++++++++++++++++
1 file changed, 181 insertions(+)
create mode 100644 docs/guides/tools/sppc/build_img.rst
diff --git a/docs/guides/tools/sppc/build_img.rst b/docs/guides/tools/sppc/build_img.rst
new file mode 100644
index 0000000..bb85ce6
--- /dev/null
+++ b/docs/guides/tools/sppc/build_img.rst
@@ -0,0 +1,181 @@
+.. _spp_container_build_img:
+
+.. SPDX-License-Identifier: BSD-3-Clause
+ Copyright(c) 2017-2018 Nippon Telegraph and Telephone Corporation
+
+
+.. _sppc_build_img_bi:
+
+Build Images
+============
+
+As explained in :doc:`getting_started` section,
+container image is built with ``build/main.py``.
+This script is for running ``docker build`` with a set of
+``--build-args`` options for building DPDK applications.
+
+This script supports building application from any of repositories.
+For example, you can build SPP hosted on your repository
+``https://github.com/your/spp.git``
+with DPDK 18.02 as following.
+
+.. code-block:: console
+
+ $ cd /path/to/spp/tools/sppc
+ $ python build/build.py --dpdk-branch v18.02 \
+ --spp-repo https://github.com/your/spp.git
+
+Refer all of options running with ``-h`` option.
+
+.. code-block:: console
+
+ $ python build/main.py -h
+ usage: main.py [-h] [-t TARGET] [-ci CONTAINER_IMAGE]
+ [--dist-name DIST_NAME]
+ [--dist-ver DIST_VER] [--dpdk-repo DPDK_REPO]
+ [--dpdk-branch DPDK_BRANCH] [--pktgen-repo PKTGEN_REPO]
+ [--pktgen-branch PKTGEN_BRANCH] [--spp-repo SPP_REPO]
+ [--spp-branch SPP_BRANCH] [--only-envsh] [--dry-run]
+
+ Docker image builder for DPDK applications
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -t TARGET, --target TARGET
+ Build target ('dpdk', 'pktgen' or 'spp')
+ -ci CONTAINER_IMAGE, --container-image CONTAINER_IMAGE
+ Name of container image
+ --dist-name DIST_NAME
+ Name of Linux distribution
+ --dist-ver DIST_VER Version of Linux distribution
+ --dpdk-repo DPDK_REPO
+ Git URL of DPDK
+ --dpdk-branch DPDK_BRANCH
+ Specific version or branch of DPDK
+ --pktgen-repo PKTGEN_REPO
+ Git URL of pktgen-dpdk
+ --pktgen-branch PKTGEN_BRANCH
+ Specific version or branch of pktgen-dpdk
+ --spp-repo SPP_REPO Git URL of SPP
+ --spp-branch SPP_BRANCH
+ Specific version or branch of SPP
+ --only-envsh Create config 'env.sh' and exit without docker build
+ --dry-run Print matrix for checking and exit without docker
+ build
+
+
+.. _sppc_build_img_vci:
+
+Version Control for Images
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+SPP container provides version control as combination of
+target name, Linux distribution name and version.
+Built images are referred such as ``sppc/dpdk-ubuntu:latest`` or
+``sppc/spp-ubuntu:16.04``.
+``sppc`` is just a prefix to indicate an image of SPP container.
+
+Build script decides a name from given options or default values.
+If you run build script with only target and without distribution
+name and version, it uses default values ``ubuntu`` and ``latest``.
+
+.. code-block:: console
+
+ # build 'sppc/dpdk-ubuntu:latest'
+ $ python build/main.py -t dpdk
+
+ # build 'sppc/spp-ubuntu:16.04'
+ $ python build/main.py -t spp --dist-ver 16.04
+
+.. note::
+
+ SPP container does not support distributions other than Ubuntu
+ currently.
+ It is because SPP container has no Dockerfiles for building
+ CentOS, Fedora or so. It will be supported in a future release.
+
+ You can build any of distributions with build script
+ if you prepare Dockerfile by yourself.
+ How Dockerfiles are managed is described in
+ :ref:`sppc_build_img_dockerfiles` section.
+
+
+App container scripts also understand this naming rule.
+For launching ``testpmd`` on Ubuntu 16.04,
+simply give ``--dist-ver`` to indicate the version and other options
+for ``testpmd`` itself.
+
+.. code-block:: console
+
+ # launch testpmd on 'sppc/dpdk-ubuntu:16.04'
+ $ python app/testpmd.py --dist-ver 16.04 -l 3-4 ...
+
+But, how can we build images for different versions of DPDK,
+such as 17.11 and 18.05, on the same distribution?
+In this case, you can use ``--container-image`` or ``-ci`` option for
+using any of names. It is also referred from app container scripts.
+
+.. code-block:: console
+
+ # build image with arbitrary name
+ $ python build/main.py -t dpdk -ci sppc/dpdk17.11-ubuntu:latest \
+ --dpdk-branch v17.11
+
+ # launch testpmd with '-ci'
+ $ python app/testpmd.py -ci sppc/dpdk17.11-ubuntu:latest -l 3-4 ...
+
+
+.. _sppc_build_img_dockerfiles:
+
+Dockerfiles
+~~~~~~~~~~~
+
+SPP container includes Dockerfiles for each of distributions and
+its versions.
+For instance, Dockerfiles for Ubuntu are found in ``build/ubuntu``
+directory.
+You notice that each of Dockerfiles has its version as a part of
+file name.
+In other words, the list of Dockerfiles under the ``ubuntu`` directory
+shows all of supported versions of Ubuntu.
+You can not find Dockerfiles for CentOS as ``build/centos`` or other
+distributions because it is not supported currently.
+It is included in a future release.
+
+.. code-block:: console
+
+ $ tree build/ubuntu/
+ build/ubuntu/
+ ├── dpdk
+ │ ├── Dockerfile.16.04
+ │ ├── Dockerfile.18.04
+ │ └── Dockerfile.latest
+ ├── pktgen
+ │ ├── Dockerfile.16.04
+ │ ├── Dockerfile.18.04
+ │ └── Dockerfile.latest
+ └── spp
+ ├── Dockerfile.16.04
+ ├── Dockerfile.18.04
+ └── Dockerfile.latest
+
+
+.. _sppc_build_img_inspect:
+
+Inspect Inside of Container
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Container is useful, but just bit annoying to inspect inside
+the container because it is cleaned up immediately after process
+is finished and there is no clue what is happened in.
+
+``build/run.sh`` is a helper script to inspect inside the container.
+You can run ``bash`` on the container to confirm behaviour of
+targetting application, or run any of command.
+
+This script refers ``ubuntu/dpdk/env.sh`` for Ubuntu image to include
+environment variables.
+So, it is failed to ``build/run.sh`` if this config file
+does not exist.
+You can create it from ``build/build.py`` with ``--only-envsh`` option
+if you removed it accidentally.
--
2.17.1
next prev parent reply other threads:[~2018-06-15 7:06 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-15 7:06 [spp] [PATCH 00/15] Introduction of SPP container tools ogawa.yasufumi
2018-06-15 7:06 ` [spp] [PATCH 01/15] docs: add index of SPP container tool ogawa.yasufumi
2018-06-15 7:06 ` [spp] [PATCH 02/15] docs: add overview of SPP container ogawa.yasufumi
2018-06-15 7:06 ` [spp] [PATCH 03/15] docs: add overview image " ogawa.yasufumi
2018-06-15 7:06 ` [spp] [PATCH 04/15] docs: add getting started guide " ogawa.yasufumi
2018-06-15 7:06 ` [spp] [PATCH 05/15] docs: add image of example for gsg ogawa.yasufumi
2018-06-15 7:06 ` [spp] [PATCH 06/15] docs: add install guide for SPP container ogawa.yasufumi
2018-06-15 7:06 ` ogawa.yasufumi [this message]
2018-06-15 7:06 ` [spp] [PATCH 08/15] docs: add manual for app container launchers ogawa.yasufumi
2018-06-15 7:06 ` [spp] [PATCH 09/15] docs: add use cases of SPP container ogawa.yasufumi
2018-06-15 7:06 ` [spp] [PATCH 10/15] docs: add usecase image of testing vhost ogawa.yasufumi
2018-06-15 7:06 ` [spp] [PATCH 11/15] docs: add usecase image of testing ring ogawa.yasufumi
2018-06-15 7:06 ` [spp] [PATCH 12/15] docs: add usecase image of pktgen and l2fwd ogawa.yasufumi
2018-06-15 7:06 ` [spp] [PATCH 13/15] docs: add usecase image of using less lcores ogawa.yasufumi
2018-06-15 7:06 ` [spp] [PATCH 14/15] docs: add usecase image of load balancer ogawa.yasufumi
2018-06-15 7:06 ` [spp] [PATCH 15/15] docs: add how to develop guide for SPP container ogawa.yasufumi
2018-06-15 12:47 ` Nakamura Hioryuki
2018-06-18 2:33 ` Yasufumi Ogawa
2018-06-18 6:21 ` [spp] [PATCH v2 00/15] Fix mistakes of SPP container documentation ogawa.yasufumi
2018-06-18 6:21 ` [spp] [PATCH v2 01/15] docs: add index of SPP container tool ogawa.yasufumi
2018-06-18 6:21 ` [spp] [PATCH v2 02/15] docs: add overview of SPP container ogawa.yasufumi
2018-06-18 6:21 ` [spp] [PATCH v2 03/15] docs: add overview image " ogawa.yasufumi
2018-06-18 6:21 ` [spp] [PATCH v2 04/15] docs: add getting started guide " ogawa.yasufumi
2018-06-18 6:21 ` [spp] [PATCH v2 05/15] docs: add image of example for gsg ogawa.yasufumi
2018-06-18 6:21 ` [spp] [PATCH v2 06/15] docs: add install guide for SPP container ogawa.yasufumi
2018-06-18 6:21 ` [spp] [PATCH v2 07/15] docs: add build image " ogawa.yasufumi
2018-06-18 6:21 ` [spp] [PATCH v2 08/15] docs: add manual for app container launchers ogawa.yasufumi
2018-06-18 6:21 ` [spp] [PATCH v2 10/15] docs: add usecase image of testing vhost ogawa.yasufumi
2018-06-18 6:21 ` [spp] [PATCH v2 11/15] docs: add usecase image of testing ring ogawa.yasufumi
2018-06-18 6:21 ` [spp] [PATCH v2 12/15] docs: add usecase image of pktgen and l2fwd ogawa.yasufumi
2018-06-18 6:21 ` [spp] [PATCH v2 13/15] docs: add usecase image of using less lcores ogawa.yasufumi
2018-06-18 6:21 ` [spp] [PATCH v2 14/15] docs: add usecase image of load balancer ogawa.yasufumi
2018-06-18 6:21 ` [spp] [PATCH v2 15/15] docs: add how to develop guide for SPP container ogawa.yasufumi
2018-08-15 15:39 ` [spp] [PATCH v2 00/15] Fix mistakes of SPP container documentation Ferruh Yigit
2018-07-24 8:00 ` [spp] [PATCH v2 09/15] docs: add use cases of SPP container ogawa.yasufumi
2018-07-24 8:20 ` Yasufumi Ogawa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180615070615.15594-8-ogawa.yasufumi@lab.ntt.co.jp \
--to=ogawa.yasufumi@lab.ntt.co.jp \
--cc=ferruh.yigit@intel.com \
--cc=spp@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).