Soft Patch Panel
 help / color / mirror / Atom feed
* [spp] [PATCH 0/8] Build image with custom repo name
@ 2018-10-01  5:01 ogawa.yasufumi
  2018-10-01  5:01 ` [spp] [PATCH 1/8] tools/sppc: build image with custom git repo ogawa.yasufumi
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: ogawa.yasufumi @ 2018-10-01  5:01 UTC (permalink / raw)
  To: spp, ferruh.yigit, ogawa.yasufumi

From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>

SPP container tools support for building an image with fixed repository
name of DPDK, SPP and pktgen. It means that you cannot use, for
example, `custom-dpdk` as the name of your DPDK repository. This update
is to enable users to use any of repository name.

The name of repository is extracted from the URL. For example, it
extracts `custom-dpdk` from `https://github.com/user/custom-dpdk.git`.

Yasufumi Ogawa (8):
  tools/sppc: build image with custom git repo
  tools/sppc: dockerfile for custom SPP repo
  tools/sppc: dockerfile for custom Pktgen repo
  tools/sppc: add paths to Dockerfiles of SPP
  tools/sppc: update app launcer for custom SPP repo
  tools/sppc: add workdir docker option
  tools/sppc: add paths to Dockerfiles of pktgen
  tools/sppc: update launcer for custom pktgen repo

 tools/sppc/app/pktgen.py                         | 12 +++----
 tools/sppc/app/spp-nfv.py                        |  5 +--
 tools/sppc/app/spp-primary.py                    |  5 +--
 tools/sppc/app/spp-vm.py                         |  5 +--
 tools/sppc/build/main.py                         | 46 +++++++++++++++++-------
 tools/sppc/build/ubuntu/pktgen/Dockerfile.16.04  | 14 +++++---
 tools/sppc/build/ubuntu/pktgen/Dockerfile.18.04  | 14 +++++---
 tools/sppc/build/ubuntu/pktgen/Dockerfile.latest | 14 +++++---
 tools/sppc/build/ubuntu/spp/Dockerfile.16.04     | 20 +++++++----
 tools/sppc/build/ubuntu/spp/Dockerfile.18.04     | 20 +++++++----
 tools/sppc/build/ubuntu/spp/Dockerfile.latest    | 20 +++++++----
 tools/sppc/conf/env.py                           |  1 -
 tools/sppc/lib/app_helper.py                     |  4 +++
 13 files changed, 113 insertions(+), 67 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [spp] [PATCH 1/8] tools/sppc: build image with custom git repo
  2018-10-01  5:01 [spp] [PATCH 0/8] Build image with custom repo name ogawa.yasufumi
@ 2018-10-01  5:01 ` ogawa.yasufumi
  2018-10-01  5:01 ` [spp] [PATCH 2/8] tools/sppc: dockerfile for custom SPP repo ogawa.yasufumi
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ogawa.yasufumi @ 2018-10-01  5:01 UTC (permalink / raw)
  To: spp, ferruh.yigit, ogawa.yasufumi

From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>

SPP container supports to create an image with a custom repository other
than on dpdk.org. However, the name of directory should be the same as
them. For example, the name of custom DPDK repo should also be 'dpdk'.

This patch is for supporting to use any of directory name. The name of
directory is extracted from the git URL. For example, directory name of
'https://github.com/user/custom-dpdk.git' is 'custom-dpdk'.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 tools/sppc/build/main.py | 46 ++++++++++++++++++++++++++++++++++------------
 tools/sppc/conf/env.py   |  1 -
 2 files changed, 34 insertions(+), 13 deletions(-)

diff --git a/tools/sppc/build/main.py b/tools/sppc/build/main.py
index d33a6f2..9618bab 100755
--- a/tools/sppc/build/main.py
+++ b/tools/sppc/build/main.py
@@ -73,14 +73,18 @@ def parse_args():
     return parser.parse_args()
 
 
-def create_env_sh(dst_dir):
+def create_env_sh(dst_dir, rte_sdk, target, target_dir):
     """Create config file for DPDK environment variables
 
     Create 'env.sh' which defines $RTE_SDK and $RTE_TARGET inside a
     container to be referredd from 'run.sh' and Dockerfile.
     """
-    contents = "export RTE_SDK=%s\n" % env.RTE_SDK
-    contents += "export RTE_TARGET=%s" % env.RTE_TARGET
+    contents = "export RTE_SDK=%s\n" % rte_sdk
+    contents += "export RTE_TARGET=%s\n" % env.RTE_TARGET
+    if target == 'pktgen':
+        contents += "export PKTGEN_DIR=%s" % target_dir
+    elif target == 'spp':
+        contents += "export SPP_DIR=%s" % target_dir
 
     f = open('%s/env.sh' % dst_dir, 'w')
     f.write(contents)
@@ -91,7 +95,7 @@ def main():
     args = parse_args()
 
     if args.target is not None:
-        target_dir = '%s/%s/%s' % (  # Dockerfile is contained here
+        dockerfile_dir = '%s/%s/%s' % (  # Dockerfile is contained here
             work_dir, args.dist_name, args.target)
         # Container image name, for exp 'sppc/dpdk-ubuntu:18.04'
         container_image = common.container_img_name(
@@ -103,7 +107,7 @@ def main():
         exit()
 
     # Decide which of Dockerfile with given base image version
-    dockerfile = '%s/Dockerfile.%s' % (target_dir, args.dist_ver)
+    dockerfile = '%s/Dockerfile.%s' % (dockerfile_dir, args.dist_ver)
 
     # Overwrite container's name if it is given.
     if args.container_image is not None:
@@ -125,18 +129,34 @@ def main():
     else:
         spp_branch = ''
 
+    # Setup project directory by extracting from any of git URL.
+    # If DPDK is hosted on 'https://github.com/user/custom-dpdk.git',
+    # the directory is 'custom-dpdk'.
+    dpdk_dir = args.dpdk_repo.split('/')[-1].split('.')[0]
+    pktgen_dir = args.pktgen_repo.split('/')[-1].split('.')[0]
+    spp_dir = args.spp_repo.split('/')[-1].split('.')[0]
+
+    # RTE_SDK is decided with DPDK's dir.
+    rte_sdk = '%s/%s' % (env.HOMEDIR, dpdk_dir)
+
     # Check for just creating env.sh, or run docker build.
     if args.only_envsh is True:
         if args.dry_run is False:
-            create_env_sh(target_dir)
-            print("Info: '%s/env.sh' created." % target_dir)
+            if target == 'pktgen':
+                create_env_sh(dockerfile_dir, rte_sdk, target, pktgen_dir)
+            elif target == 'spp':
+                create_env_sh(dockerfile_dir, rte_sdk, target, spp_dir)
+            print("Info: '%s/env.sh' created." % dockerfile_dir)
             exit()
         else:
             print("Info: Nothin done because you gave %s with %s." % (
                 '--only-envsh', '--dry-run'))
             exit()
     else:
-        create_env_sh(target_dir)
+        if args.target == 'pktgen':
+            create_env_sh(dockerfile_dir, rte_sdk, args.target, pktgen_dir)
+        elif args.target == 'spp':
+            create_env_sh(dockerfile_dir, rte_sdk, args.target, spp_dir)
 
     # Setup environment variables on host to pass 'docker build'.
     env_opts = [
@@ -154,7 +174,7 @@ def main():
 
     docker_cmd += [
         '--build-arg', 'home_dir=%s' % env.HOMEDIR, '\\',
-        '--build-arg', 'rte_sdk=%s' % env.RTE_SDK, '\\',
+        '--build-arg', 'rte_sdk=%s' % rte_sdk, '\\',
         '--build-arg', 'rte_target=%s' % env.RTE_TARGET, '\\',
         '--build-arg', 'dpdk_repo=%s' % args.dpdk_repo, '\\',
         '--build-arg', 'dpdk_branch=%s' % dpdk_branch, '\\']
@@ -162,16 +182,18 @@ def main():
     if args.target == 'pktgen':
         docker_cmd += [
             '--build-arg', 'pktgen_repo=%s' % args.pktgen_repo, '\\',
-            '--build-arg', 'pktgen_branch=%s' % pktgen_branch, '\\']
+            '--build-arg', 'pktgen_branch=%s' % pktgen_branch, '\\',
+            '--build-arg', 'pktgen_dir=%s' % pktgen_dir, '\\']
     elif args.target == 'spp':
         docker_cmd += [
             '--build-arg', 'spp_repo=%s' % args.spp_repo, '\\',
-            '--build-arg', 'spp_branch=%s' % spp_branch, '\\']
+            '--build-arg', 'spp_branch=%s' % spp_branch, '\\',
+            '--build-arg', 'spp_dir=%s' % spp_dir, '\\']
 
     docker_cmd += [
         '-f', '%s' % dockerfile, '\\',
         '-t', container_image, '\\',
-        target_dir]
+        dockerfile_dir]
 
     common.print_pretty_commands(docker_cmd)
 
diff --git a/tools/sppc/conf/env.py b/tools/sppc/conf/env.py
index f6df15a..549b4dc 100644
--- a/tools/sppc/conf/env.py
+++ b/tools/sppc/conf/env.py
@@ -4,7 +4,6 @@
 
 
 HOMEDIR = '/root'
-RTE_SDK = '/root/dpdk'
 RTE_TARGET = 'x86_64-native-linuxapp-gcc'
 
 CONTAINER_IMG_NAME = {
-- 
2.7.4

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [spp] [PATCH 2/8] tools/sppc: dockerfile for custom SPP repo
  2018-10-01  5:01 [spp] [PATCH 0/8] Build image with custom repo name ogawa.yasufumi
  2018-10-01  5:01 ` [spp] [PATCH 1/8] tools/sppc: build image with custom git repo ogawa.yasufumi
@ 2018-10-01  5:01 ` ogawa.yasufumi
  2018-10-01  5:01 ` [spp] [PATCH 3/8] tools/sppc: dockerfile for custom Pktgen repo ogawa.yasufumi
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ogawa.yasufumi @ 2018-10-01  5:01 UTC (permalink / raw)
  To: spp, ferruh.yigit, ogawa.yasufumi

From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>

This update is to change dockerfiles of SPP for applying the change of
build script for using any of git repository.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 tools/sppc/build/ubuntu/spp/Dockerfile.16.04  | 12 +++++++-----
 tools/sppc/build/ubuntu/spp/Dockerfile.18.04  | 12 +++++++-----
 tools/sppc/build/ubuntu/spp/Dockerfile.latest | 11 ++++++-----
 3 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/tools/sppc/build/ubuntu/spp/Dockerfile.16.04 b/tools/sppc/build/ubuntu/spp/Dockerfile.16.04
index cceb7e3..b55f056 100644
--- a/tools/sppc/build/ubuntu/spp/Dockerfile.16.04
+++ b/tools/sppc/build/ubuntu/spp/Dockerfile.16.04
@@ -7,6 +7,7 @@ ARG dpdk_repo
 ARG dpdk_branch
 ARG spp_repo
 ARG spp_branch
+ARG spp_dir
 
 ENV PATH ${rte_sdk}/${rte_target}/app:${PATH}
 ENV http_proxy ${http_proxy}
@@ -14,6 +15,7 @@ ENV https_proxy $https_proxy
 ENV no_proxy ${no_proxy}
 ENV RTE_SDK ${rte_sdk}
 ENV RTE_TARGET ${rte_target}
+ENV SPP_DIR ${spp_dir}
 
 RUN apt-get update && apt-get install -y \
     git \
@@ -31,14 +33,14 @@ RUN apt-get update && apt-get install -y \
     && rm -rf /var/lib/apt/lists/*
 
 WORKDIR $home_dir
-RUN git clone $dpdk_branch $dpdk_repo
-RUN git clone $spp_branch $spp_repo
+RUN git clone ${dpdk_branch} ${dpdk_repo}
+RUN git clone ${spp_branch} ${spp_repo}
 
 # Compile DPDK and SPP
-WORKDIR $rte_sdk
-RUN make install T=$rte_target
+WORKDIR ${rte_sdk}
+RUN make install T=${rte_target}
 
-WORKDIR ${home_dir}/spp
+WORKDIR ${home_dir}/${spp_dir}
 RUN make
 
 # Set working directory when container is launched
diff --git a/tools/sppc/build/ubuntu/spp/Dockerfile.18.04 b/tools/sppc/build/ubuntu/spp/Dockerfile.18.04
index 51a0902..8377623 100644
--- a/tools/sppc/build/ubuntu/spp/Dockerfile.18.04
+++ b/tools/sppc/build/ubuntu/spp/Dockerfile.18.04
@@ -7,6 +7,7 @@ ARG dpdk_repo
 ARG dpdk_branch
 ARG spp_repo
 ARG spp_branch
+ARG spp_dir
 
 ENV PATH ${rte_sdk}/${rte_target}/app:${PATH}
 ENV http_proxy ${http_proxy}
@@ -14,6 +15,7 @@ ENV https_proxy $https_proxy
 ENV no_proxy ${no_proxy}
 ENV RTE_SDK ${rte_sdk}
 ENV RTE_TARGET ${rte_target}
+ENV SPP_DIR ${spp_dir}
 
 RUN apt-get update && apt-get install -y \
     git \
@@ -31,14 +33,14 @@ RUN apt-get update && apt-get install -y \
     && rm -rf /var/lib/apt/lists/*
 
 WORKDIR $home_dir
-RUN git clone $dpdk_branch $dpdk_repo
-RUN git clone $spp_branch $spp_repo
+RUN git clone ${dpdk_branch} ${dpdk_repo}
+RUN git clone ${spp_branch} ${spp_repo}
 
 # Compile DPDK and SPP
-WORKDIR $rte_sdk
-RUN make install T=$rte_target
+WORKDIR ${rte_sdk}
+RUN make install T=${rte_target}
 
-WORKDIR ${home_dir}/spp
+WORKDIR ${home_dir}/${spp_dir}
 RUN make
 
 # Set working directory when container is launched
diff --git a/tools/sppc/build/ubuntu/spp/Dockerfile.latest b/tools/sppc/build/ubuntu/spp/Dockerfile.latest
index 3142c11..3b96080 100644
--- a/tools/sppc/build/ubuntu/spp/Dockerfile.latest
+++ b/tools/sppc/build/ubuntu/spp/Dockerfile.latest
@@ -7,6 +7,7 @@ ARG dpdk_repo
 ARG dpdk_branch
 ARG spp_repo
 ARG spp_branch
+ARG spp_dir
 
 ENV PATH ${rte_sdk}/${rte_target}/app:${PATH}
 ENV http_proxy ${http_proxy}
@@ -31,14 +32,14 @@ RUN apt-get update && apt-get install -y \
     && rm -rf /var/lib/apt/lists/*
 
 WORKDIR $home_dir
-RUN git clone $dpdk_branch $dpdk_repo
-RUN git clone $spp_branch $spp_repo
+RUN git clone ${dpdk_branch} ${dpdk_repo}
+RUN git clone ${spp_branch} ${spp_repo}
 
 # Compile DPDK and SPP
-WORKDIR $rte_sdk
-RUN make install T=$rte_target
+WORKDIR ${rte_sdk}
+RUN make install T=${rte_target}
 
-WORKDIR ${home_dir}/spp
+WORKDIR ${home_dir}/${spp_dir}
 RUN make
 
 # Set working directory when container is launched
-- 
2.7.4

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [spp] [PATCH 3/8] tools/sppc: dockerfile for custom Pktgen repo
  2018-10-01  5:01 [spp] [PATCH 0/8] Build image with custom repo name ogawa.yasufumi
  2018-10-01  5:01 ` [spp] [PATCH 1/8] tools/sppc: build image with custom git repo ogawa.yasufumi
  2018-10-01  5:01 ` [spp] [PATCH 2/8] tools/sppc: dockerfile for custom SPP repo ogawa.yasufumi
@ 2018-10-01  5:01 ` ogawa.yasufumi
  2018-10-01  5:01 ` [spp] [PATCH 4/8] tools/sppc: add paths to Dockerfiles of SPP ogawa.yasufumi
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ogawa.yasufumi @ 2018-10-01  5:01 UTC (permalink / raw)
  To: spp, ferruh.yigit, ogawa.yasufumi

From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>

This update is to change dockerfiles of Pktgen for applying the change
of build script for using any of git repository.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 tools/sppc/build/ubuntu/pktgen/Dockerfile.16.04  | 12 +++++++-----
 tools/sppc/build/ubuntu/pktgen/Dockerfile.18.04  | 12 +++++++-----
 tools/sppc/build/ubuntu/pktgen/Dockerfile.latest | 12 +++++++-----
 3 files changed, 21 insertions(+), 15 deletions(-)

diff --git a/tools/sppc/build/ubuntu/pktgen/Dockerfile.16.04 b/tools/sppc/build/ubuntu/pktgen/Dockerfile.16.04
index e72dc74..dc2c503 100644
--- a/tools/sppc/build/ubuntu/pktgen/Dockerfile.16.04
+++ b/tools/sppc/build/ubuntu/pktgen/Dockerfile.16.04
@@ -7,6 +7,7 @@ ARG dpdk_repo
 ARG dpdk_branch
 ARG pktgen_repo
 ARG pktgen_branch
+ARG pktgen_dir
 
 ENV PATH ${rte_sdk}/${rte_target}/app:${PATH}
 ENV http_proxy ${http_proxy}
@@ -14,6 +15,7 @@ ENV https_proxy $https_proxy
 ENV no_proxy ${no_proxy}
 ENV RTE_SDK ${rte_sdk}
 ENV RTE_TARGET ${rte_target}
+ENV PKTGEN_DIR ${pktgen_dir}
 
 RUN apt-get update && apt-get install -y \
     git \
@@ -32,14 +34,14 @@ RUN apt-get update && apt-get install -y \
     && rm -rf /var/lib/apt/lists/*
 
 WORKDIR $home_dir
-RUN git clone $dpdk_branch $dpdk_repo
-RUN git clone $pktgen_branch $pktgen_repo
+RUN git clone ${dpdk_branch} ${dpdk_repo}
+RUN git clone ${pktgen_branch} ${pktgen_repo}
 
 # Compile DPDK and pktgen
-WORKDIR $rte_sdk
-RUN make install T=$rte_target
+WORKDIR ${rte_sdk}
+RUN make install T=${rte_target}
 
-WORKDIR ${home_dir}/pktgen-dpdk
+WORKDIR ${home_dir}/${pktgen_dir}
 RUN make
 
 # Set working directory when container is launched
diff --git a/tools/sppc/build/ubuntu/pktgen/Dockerfile.18.04 b/tools/sppc/build/ubuntu/pktgen/Dockerfile.18.04
index 6097fbc..31632e4 100644
--- a/tools/sppc/build/ubuntu/pktgen/Dockerfile.18.04
+++ b/tools/sppc/build/ubuntu/pktgen/Dockerfile.18.04
@@ -7,6 +7,7 @@ ARG dpdk_repo
 ARG dpdk_branch
 ARG pktgen_repo
 ARG pktgen_branch
+ARG pktgen_dir
 
 ENV PATH ${rte_sdk}/${rte_target}/app:${PATH}
 ENV http_proxy ${http_proxy}
@@ -14,6 +15,7 @@ ENV https_proxy $https_proxy
 ENV no_proxy ${no_proxy}
 ENV RTE_SDK ${rte_sdk}
 ENV RTE_TARGET ${rte_target}
+ENV PKTGEN_DIR ${pktgen_dir}
 
 RUN apt-get update && apt-get install -y \
     git \
@@ -32,14 +34,14 @@ RUN apt-get update && apt-get install -y \
     && rm -rf /var/lib/apt/lists/*
 
 WORKDIR $home_dir
-RUN git clone $dpdk_branch $dpdk_repo
-RUN git clone $pktgen_branch $pktgen_repo
+RUN git clone ${dpdk_branch} ${dpdk_repo}
+RUN git clone ${pktgen_branch} ${pktgen_repo}
 
 # Compile DPDK and pktgen
-WORKDIR $rte_sdk
-RUN make install T=$rte_target
+WORKDIR ${rte_sdk}
+RUN make install T=${rte_target}
 
-WORKDIR ${home_dir}/pktgen-dpdk
+WORKDIR ${home_dir}/${pktgen_dir}
 RUN make
 
 # Set working directory when container is launched
diff --git a/tools/sppc/build/ubuntu/pktgen/Dockerfile.latest b/tools/sppc/build/ubuntu/pktgen/Dockerfile.latest
index ae70368..fa4b8fb 100644
--- a/tools/sppc/build/ubuntu/pktgen/Dockerfile.latest
+++ b/tools/sppc/build/ubuntu/pktgen/Dockerfile.latest
@@ -7,6 +7,7 @@ ARG dpdk_repo
 ARG dpdk_branch
 ARG pktgen_repo
 ARG pktgen_branch
+ARG pktgen_dir
 
 ENV PATH ${rte_sdk}/${rte_target}/app:${PATH}
 ENV http_proxy ${http_proxy}
@@ -14,6 +15,7 @@ ENV https_proxy $https_proxy
 ENV no_proxy ${no_proxy}
 ENV RTE_SDK ${rte_sdk}
 ENV RTE_TARGET ${rte_target}
+ENV PKTGEN_DIR ${pktgen_dir}
 
 RUN apt-get update && apt-get install -y \
     git \
@@ -32,14 +34,14 @@ RUN apt-get update && apt-get install -y \
     && rm -rf /var/lib/apt/lists/*
 
 WORKDIR $home_dir
-RUN git clone $dpdk_branch $dpdk_repo
-RUN git clone $pktgen_branch $pktgen_repo
+RUN git clone ${dpdk_branch} ${dpdk_repo}
+RUN git clone ${pktgen_branch} ${pktgen_repo}
 
 # Compile DPDK and pktgen
-WORKDIR $rte_sdk
-RUN make install T=$rte_target
+WORKDIR ${rte_sdk}
+RUN make install T=${rte_target}
 
-WORKDIR ${home_dir}/pktgen-dpdk
+WORKDIR ${home_dir}/${pktgen_dir}
 RUN make
 
 # Set working directory when container is launched
-- 
2.7.4

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [spp] [PATCH 4/8] tools/sppc: add paths to Dockerfiles of SPP
  2018-10-01  5:01 [spp] [PATCH 0/8] Build image with custom repo name ogawa.yasufumi
                   ` (2 preceding siblings ...)
  2018-10-01  5:01 ` [spp] [PATCH 3/8] tools/sppc: dockerfile for custom Pktgen repo ogawa.yasufumi
@ 2018-10-01  5:01 ` ogawa.yasufumi
  2018-10-01  5:01 ` [spp] [PATCH 5/8] tools/sppc: update app launcer for custom SPP repo ogawa.yasufumi
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ogawa.yasufumi @ 2018-10-01  5:01 UTC (permalink / raw)
  To: spp, ferruh.yigit, ogawa.yasufumi

From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>

If you clone a custom SPP repo and its directory name is not 'spp',
you failed to launch an appcontainer script because the scripts does
not know the name of custom repo and cannot find SPP's executable file.

To be found the executable in container, this patch adds PATH entries
of the executables of custom repo to Dockerfile. By this change.
appcontainer can find the executables without the custom repo's name
while launching appcontainer.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 tools/sppc/build/ubuntu/spp/Dockerfile.16.04  | 8 ++++++--
 tools/sppc/build/ubuntu/spp/Dockerfile.18.04  | 8 ++++++--
 tools/sppc/build/ubuntu/spp/Dockerfile.latest | 9 +++++++--
 3 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/tools/sppc/build/ubuntu/spp/Dockerfile.16.04 b/tools/sppc/build/ubuntu/spp/Dockerfile.16.04
index b55f056..27311ea 100644
--- a/tools/sppc/build/ubuntu/spp/Dockerfile.16.04
+++ b/tools/sppc/build/ubuntu/spp/Dockerfile.16.04
@@ -9,13 +9,17 @@ ARG spp_repo
 ARG spp_branch
 ARG spp_dir
 
-ENV PATH ${rte_sdk}/${rte_target}/app:${PATH}
 ENV http_proxy ${http_proxy}
-ENV https_proxy $https_proxy
+ENV https_proxy ${https_proxy}
 ENV no_proxy ${no_proxy}
 ENV RTE_SDK ${rte_sdk}
 ENV RTE_TARGET ${rte_target}
 ENV SPP_DIR ${spp_dir}
+ENV PATH ${rte_sdk}/${rte_target}/app:${PATH}
+ENV PATH ${home_dir}/${spp_dir}/src/primary/${rte_target}/:${PATH}
+ENV PATH ${home_dir}/${spp_dir}/src/nfv/${rte_target}/:${PATH}
+ENV PATH ${home_dir}/${spp_dir}/src/vf/${rte_target}/:${PATH}
+ENV PATH ${home_dir}/${spp_dir}/src/vm/${rte_target}/:${PATH}
 
 RUN apt-get update && apt-get install -y \
     git \
diff --git a/tools/sppc/build/ubuntu/spp/Dockerfile.18.04 b/tools/sppc/build/ubuntu/spp/Dockerfile.18.04
index 8377623..f2afa74 100644
--- a/tools/sppc/build/ubuntu/spp/Dockerfile.18.04
+++ b/tools/sppc/build/ubuntu/spp/Dockerfile.18.04
@@ -9,13 +9,17 @@ ARG spp_repo
 ARG spp_branch
 ARG spp_dir
 
-ENV PATH ${rte_sdk}/${rte_target}/app:${PATH}
 ENV http_proxy ${http_proxy}
-ENV https_proxy $https_proxy
+ENV https_proxy ${https_proxy}
 ENV no_proxy ${no_proxy}
 ENV RTE_SDK ${rte_sdk}
 ENV RTE_TARGET ${rte_target}
 ENV SPP_DIR ${spp_dir}
+ENV PATH ${rte_sdk}/${rte_target}/app:${PATH}
+ENV PATH ${home_dir}/${spp_dir}/src/primary/${rte_target}/:${PATH}
+ENV PATH ${home_dir}/${spp_dir}/src/nfv/${rte_target}/:${PATH}
+ENV PATH ${home_dir}/${spp_dir}/src/vf/${rte_target}/:${PATH}
+ENV PATH ${home_dir}/${spp_dir}/src/vm/${rte_target}/:${PATH}
 
 RUN apt-get update && apt-get install -y \
     git \
diff --git a/tools/sppc/build/ubuntu/spp/Dockerfile.latest b/tools/sppc/build/ubuntu/spp/Dockerfile.latest
index 3b96080..246ceb8 100644
--- a/tools/sppc/build/ubuntu/spp/Dockerfile.latest
+++ b/tools/sppc/build/ubuntu/spp/Dockerfile.latest
@@ -9,12 +9,17 @@ ARG spp_repo
 ARG spp_branch
 ARG spp_dir
 
-ENV PATH ${rte_sdk}/${rte_target}/app:${PATH}
 ENV http_proxy ${http_proxy}
-ENV https_proxy $https_proxy
+ENV https_proxy ${https_proxy}
 ENV no_proxy ${no_proxy}
 ENV RTE_SDK ${rte_sdk}
 ENV RTE_TARGET ${rte_target}
+ENV SPP_DIR ${spp_dir}
+ENV PATH ${rte_sdk}/${rte_target}/app:${PATH}
+ENV PATH ${home_dir}/${spp_dir}/src/primary/${rte_target}/:${PATH}
+ENV PATH ${home_dir}/${spp_dir}/src/nfv/${rte_target}/:${PATH}
+ENV PATH ${home_dir}/${spp_dir}/src/vf/${rte_target}/:${PATH}
+ENV PATH ${home_dir}/${spp_dir}/src/vm/${rte_target}/:${PATH}
 
 RUN apt-get update && apt-get install -y \
     git \
-- 
2.7.4

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [spp] [PATCH 5/8] tools/sppc: update app launcer for custom SPP repo
  2018-10-01  5:01 [spp] [PATCH 0/8] Build image with custom repo name ogawa.yasufumi
                   ` (3 preceding siblings ...)
  2018-10-01  5:01 ` [spp] [PATCH 4/8] tools/sppc: add paths to Dockerfiles of SPP ogawa.yasufumi
@ 2018-10-01  5:01 ` ogawa.yasufumi
  2018-10-01  5:01 ` [spp] [PATCH 6/8] tools/sppc: add workdir docker option ogawa.yasufumi
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ogawa.yasufumi @ 2018-10-01  5:01 UTC (permalink / raw)
  To: spp, ferruh.yigit, ogawa.yasufumi

From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>

To launch executable in custom repo, change the path from absolute
path to just filename. Path of the file is defined as PATH in each
of Dockerfiles and no need to use absolute path by previous change.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 tools/sppc/app/spp-nfv.py     | 5 +----
 tools/sppc/app/spp-primary.py | 5 +----
 tools/sppc/app/spp-vm.py      | 5 +----
 3 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/tools/sppc/app/spp-nfv.py b/tools/sppc/app/spp-nfv.py
index cdb61a8..6506fed 100755
--- a/tools/sppc/app/spp-nfv.py
+++ b/tools/sppc/app/spp-nfv.py
@@ -79,10 +79,7 @@ def main():
         docker_run_opt = '-it'
 
     # Setup spp_nfv command.
-    cmd_path = '%s/../spp/src/nfv/%s/spp_nfv' % (
-        env.RTE_SDK, env.RTE_TARGET)
-
-    spp_cmd = [cmd_path, '\\']
+    spp_cmd = ['spp_nfv', '\\']
 
     # Do not use 'app_helper.setup_eal_opts()' because spp_nfv does
     # not use virtio.
diff --git a/tools/sppc/app/spp-primary.py b/tools/sppc/app/spp-primary.py
index a3fc9f8..6a004f6 100755
--- a/tools/sppc/app/spp-primary.py
+++ b/tools/sppc/app/spp-primary.py
@@ -106,10 +106,7 @@ def main():
         container_image, '\\']
 
     # Setup spp primary command.
-    cmd_path = '%s/../spp/src/primary/%s/spp_primary' % (
-        env.RTE_SDK, env.RTE_TARGET)
-
-    spp_cmd = [cmd_path, '\\']
+    spp_cmd = ['spp_primary', '\\']
 
     # Do not use 'app_helper.setup_eal_opts()' because spp_primary does
     # not use virtio vdev but TAP or vhost, which should be added manually.
diff --git a/tools/sppc/app/spp-vm.py b/tools/sppc/app/spp-vm.py
index 864ec61..d590253 100755
--- a/tools/sppc/app/spp-vm.py
+++ b/tools/sppc/app/spp-vm.py
@@ -75,10 +75,7 @@ def main():
         common.error_exit('SPP_CTRL_IP')
 
     # Setup spp_vm command.
-    cmd_path = '%s/../spp/src/vm/%s/spp_vm' % (
-        env.RTE_SDK, env.RTE_TARGET)
-
-    spp_cmd = [cmd_path, '\\']
+    spp_cmd = ['spp_vm', '\\']
 
     file_prefix = 'spp-l2fwd-container%d' % dev_ids_list[0]
     eal_opts = app_helper.setup_eal_opts(args, file_prefix)
-- 
2.7.4

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [spp] [PATCH 6/8] tools/sppc: add workdir docker option
  2018-10-01  5:01 [spp] [PATCH 0/8] Build image with custom repo name ogawa.yasufumi
                   ` (4 preceding siblings ...)
  2018-10-01  5:01 ` [spp] [PATCH 5/8] tools/sppc: update app launcer for custom SPP repo ogawa.yasufumi
@ 2018-10-01  5:01 ` ogawa.yasufumi
  2018-10-01  5:01 ` [spp] [PATCH 7/8] tools/sppc: add paths to Dockerfiles of pktgen ogawa.yasufumi
  2018-10-01  5:01 ` [spp] [PATCH 8/8] tools/sppc: update launcer for custom pktgen repo ogawa.yasufumi
  7 siblings, 0 replies; 9+ messages in thread
From: ogawa.yasufumi @ 2018-10-01  5:01 UTC (permalink / raw)
  To: spp, ferruh.yigit, ogawa.yasufumi

From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>

Some of apps require to be launched from specific directory even if PATH
is configured properly. For instance, pktgen should be launched from
project root because for finding `Pktgen.lua` in the directory.

This update is for adding workdir option for specifying a directory
from which the app is launched.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 tools/sppc/lib/app_helper.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/sppc/lib/app_helper.py b/tools/sppc/lib/app_helper.py
index c15c852..38c9ade 100644
--- a/tools/sppc/lib/app_helper.py
+++ b/tools/sppc/lib/app_helper.py
@@ -102,6 +102,10 @@ def add_sppc_args(parser):
         default='latest',
         help="Version of Linux distribution")
     parser.add_argument(
+        '--workdir',
+        type=str,
+        help="Path of directory in which the command is launched")
+    parser.add_argument(
         '-ci', '--container-image',
         type=str,
         help="Name of container image")
-- 
2.7.4

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [spp] [PATCH 7/8] tools/sppc: add paths to Dockerfiles of pktgen
  2018-10-01  5:01 [spp] [PATCH 0/8] Build image with custom repo name ogawa.yasufumi
                   ` (5 preceding siblings ...)
  2018-10-01  5:01 ` [spp] [PATCH 6/8] tools/sppc: add workdir docker option ogawa.yasufumi
@ 2018-10-01  5:01 ` ogawa.yasufumi
  2018-10-01  5:01 ` [spp] [PATCH 8/8] tools/sppc: update launcer for custom pktgen repo ogawa.yasufumi
  7 siblings, 0 replies; 9+ messages in thread
From: ogawa.yasufumi @ 2018-10-01  5:01 UTC (permalink / raw)
  To: spp, ferruh.yigit, ogawa.yasufumi

From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>

If you clone a custom pktgenrepo and its directory name is not
'pktgen-dpdk',
you failed to launch an appcontainer script because the scripts does
not know the name of custom repo and cannot find executable.

To be found the executable in container, this patch adds PATH entries
of the executables of custom repo to Dockerfile. By this change.
appcontainer can find the executables without the custom repo's name
while launching appcontainer.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 tools/sppc/build/ubuntu/pktgen/Dockerfile.16.04  | 2 ++
 tools/sppc/build/ubuntu/pktgen/Dockerfile.18.04  | 2 ++
 tools/sppc/build/ubuntu/pktgen/Dockerfile.latest | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/tools/sppc/build/ubuntu/pktgen/Dockerfile.16.04 b/tools/sppc/build/ubuntu/pktgen/Dockerfile.16.04
index dc2c503..dac5a2a 100644
--- a/tools/sppc/build/ubuntu/pktgen/Dockerfile.16.04
+++ b/tools/sppc/build/ubuntu/pktgen/Dockerfile.16.04
@@ -16,6 +16,8 @@ ENV no_proxy ${no_proxy}
 ENV RTE_SDK ${rte_sdk}
 ENV RTE_TARGET ${rte_target}
 ENV PKTGEN_DIR ${pktgen_dir}
+ENV PATH ${rte_sdk}/${rte_target}/app:${PATH}
+ENV PATH ${home_dir}/${pktgen_dir}/app/${rte_target}/:${PATH}
 
 RUN apt-get update && apt-get install -y \
     git \
diff --git a/tools/sppc/build/ubuntu/pktgen/Dockerfile.18.04 b/tools/sppc/build/ubuntu/pktgen/Dockerfile.18.04
index 31632e4..6a0640d 100644
--- a/tools/sppc/build/ubuntu/pktgen/Dockerfile.18.04
+++ b/tools/sppc/build/ubuntu/pktgen/Dockerfile.18.04
@@ -16,6 +16,8 @@ ENV no_proxy ${no_proxy}
 ENV RTE_SDK ${rte_sdk}
 ENV RTE_TARGET ${rte_target}
 ENV PKTGEN_DIR ${pktgen_dir}
+ENV PATH ${rte_sdk}/${rte_target}/app:${PATH}
+ENV PATH ${home_dir}/${pktgen_dir}/app/${rte_target}/:${PATH}
 
 RUN apt-get update && apt-get install -y \
     git \
diff --git a/tools/sppc/build/ubuntu/pktgen/Dockerfile.latest b/tools/sppc/build/ubuntu/pktgen/Dockerfile.latest
index fa4b8fb..3f0508d 100644
--- a/tools/sppc/build/ubuntu/pktgen/Dockerfile.latest
+++ b/tools/sppc/build/ubuntu/pktgen/Dockerfile.latest
@@ -16,6 +16,8 @@ ENV no_proxy ${no_proxy}
 ENV RTE_SDK ${rte_sdk}
 ENV RTE_TARGET ${rte_target}
 ENV PKTGEN_DIR ${pktgen_dir}
+ENV PATH ${rte_sdk}/${rte_target}/app:${PATH}
+ENV PATH ${home_dir}/${pktgen_dir}/app/${rte_target}/:${PATH}
 
 RUN apt-get update && apt-get install -y \
     git \
-- 
2.7.4

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [spp] [PATCH 8/8] tools/sppc: update launcer for custom pktgen repo
  2018-10-01  5:01 [spp] [PATCH 0/8] Build image with custom repo name ogawa.yasufumi
                   ` (6 preceding siblings ...)
  2018-10-01  5:01 ` [spp] [PATCH 7/8] tools/sppc: add paths to Dockerfiles of pktgen ogawa.yasufumi
@ 2018-10-01  5:01 ` ogawa.yasufumi
  7 siblings, 0 replies; 9+ messages in thread
From: ogawa.yasufumi @ 2018-10-01  5:01 UTC (permalink / raw)
  To: spp, ferruh.yigit, ogawa.yasufumi

From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>

To launch executable in custom repo, change the path from absolute
path to just filename. Path of the file is defined as PATH in each
of Dockerfiles and no need to use absolute path by previous change.
In addition, pktgen should be launched from the directory which includes
`Pktgen.lua` but cannot found it if you use custom repo. To avoid it,
add specifying workdir for launching from the directory.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 tools/sppc/app/pktgen.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/sppc/app/pktgen.py b/tools/sppc/app/pktgen.py
index 0b79bd3..708633b 100755
--- a/tools/sppc/app/pktgen.py
+++ b/tools/sppc/app/pktgen.py
@@ -74,16 +74,16 @@ def main():
     sock_files = app_helper.sock_files(dev_ids_list)
 
     # Setup docker command.
+    if args.workdir is not None:
+        wd = args.workdir
+    else:
+        wd = '/root/pktgen-dpdk'
     docker_cmd = ['sudo', 'docker', 'run', '\\']
     docker_opts = app_helper.setup_docker_opts(
-        args, target_name, sock_files,
-        '%s/../pktgen-dpdk' % env.RTE_SDK)
-
-    cmd_path = '%s/../pktgen-dpdk/app/%s/pktgen' % (
-        env.RTE_SDK, env.RTE_TARGET)
+            args, target_name, sock_files, wd)
 
     # Setup pktgen command
-    pktgen_cmd = [cmd_path, '\\']
+    pktgen_cmd = ['pktgen', '\\']
 
     file_prefix = 'spp-pktgen-container%d' % dev_ids_list[0]
     eal_opts = app_helper.setup_eal_opts(args, file_prefix)
-- 
2.7.4

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-10-01  5:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-01  5:01 [spp] [PATCH 0/8] Build image with custom repo name ogawa.yasufumi
2018-10-01  5:01 ` [spp] [PATCH 1/8] tools/sppc: build image with custom git repo ogawa.yasufumi
2018-10-01  5:01 ` [spp] [PATCH 2/8] tools/sppc: dockerfile for custom SPP repo ogawa.yasufumi
2018-10-01  5:01 ` [spp] [PATCH 3/8] tools/sppc: dockerfile for custom Pktgen repo ogawa.yasufumi
2018-10-01  5:01 ` [spp] [PATCH 4/8] tools/sppc: add paths to Dockerfiles of SPP ogawa.yasufumi
2018-10-01  5:01 ` [spp] [PATCH 5/8] tools/sppc: update app launcer for custom SPP repo ogawa.yasufumi
2018-10-01  5:01 ` [spp] [PATCH 6/8] tools/sppc: add workdir docker option ogawa.yasufumi
2018-10-01  5:01 ` [spp] [PATCH 7/8] tools/sppc: add paths to Dockerfiles of pktgen ogawa.yasufumi
2018-10-01  5:01 ` [spp] [PATCH 8/8] tools/sppc: update launcer for custom pktgen repo ogawa.yasufumi

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).