From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 77285A04F1; Mon, 9 Dec 2019 11:18:22 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C11A15B3C; Mon, 9 Dec 2019 11:18:21 +0100 (CET) Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by dpdk.org (Postfix) with ESMTP id 1BAE22C12 for ; Mon, 9 Dec 2019 11:18:20 +0100 (CET) Received: by mail-pg1-f194.google.com with SMTP id a33so6673663pgm.5 for ; Mon, 09 Dec 2019 02:18:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=NEZxkc+mtaCMQSDgb68ojDDC9P47uIq0ZxiIbL5sX6g=; b=bamUC8BiOHaNe7Jzap+L5rVvvTYqrgiQ8V3dFNwMBUcUYKCKr0URG+5kJMM7m944Xt CpJi5j/J9K0tRLhb6lAI9rG5MsqsNelSYDj2j9Eqwu5eZYqbn/cDHlh+Vri5noNEs9K/ JNpTpXPK2FjN5G/6cpYpc4uiqynxWsDuAtMUyOCfdrAKwlwdXnq7Sl7zvQTftQGJqg43 wPXm3KkvPrHl079tRWJE7YQ3WPh4OUSsa1l+107YL+c5aWYTNGXzBJ+yXb7BrV28T0vC 6DjpPMyOcumL2nEFlnM8QE3xARKuXYhDpo8jVxOOIhO+xQI4Ls022tAmMt9mXPOdlpxu 8jrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=NEZxkc+mtaCMQSDgb68ojDDC9P47uIq0ZxiIbL5sX6g=; b=AeJTXbXjCQ1M1NXlUiojwBuzDlGpprkyNnm7F/Rti6w5lImr7TP86T0wnY4dPTOepv byHWz7d5PTJINrJuoNWDoqlKZTjB6bkg+RTEZ+caamjEhWTVjJ6GpAieJame07X3ZsbQ v9kTVqd4onhGF58SjEBxx1lAyWNRoDOJUZNke84Ca6EODoibP4oFl+/opafyUz+NqeU3 Onw+niOBxd6N6sIu7vs8QtK10o2Cv/2RxIOz93RhQQ9vUgr5d+NBLjyqK0QKi7VWKzbJ C26/sdlWwcvNYLuIgdNvnvb8X9De2D29qKT71JlOdFZxoxp5Eh8WpJdgHvsnusY26vH1 q5bg== X-Gm-Message-State: APjAAAVJtiFV02p/af7yJed4LrzmOUOcr24tNO9HeBZe/nYRy3r2qO/f wW8Rvb94y7FItyMnL+q8VPg= X-Google-Smtp-Source: APXvYqxvEL02NuPhqNsiupCgUoyhdxAtlGkG0AvvEj7aD0nqk9FLWBc4uW3QC+1iB9X3WAtxQCnr8Q== X-Received: by 2002:a65:621a:: with SMTP id d26mr17512472pgv.151.1575886699072; Mon, 09 Dec 2019 02:18:19 -0800 (PST) Received: from mugwort.local ([192.47.164.146]) by smtp.gmail.com with ESMTPSA id k190sm24586286pga.73.2019.12.09.02.18.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Dec 2019 02:18:18 -0800 (PST) To: "Halim, Abdul" , "Ruifeng Wang (Arm Technology China)" , "dev@dpdk.org" Cc: "Kinsella, Ray" , nd , "Richardson, Bruce" References: <1566924290-451677-1-git-send-email-abdul.halim@intel.com> <1575373341-29969-1-git-send-email-abdul.halim@intel.com> <199e2fda-bfb2-bd46-0b89-9d575f6c8989@gmail.com> From: Yasufumi Ogawa Message-ID: Date: Mon, 9 Dec 2019 19:18:14 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v3] build: add dockerfile for building docker image X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Abdul, On 2019/12/06 20:12, Halim, Abdul wrote: >> -----Original Message----- >> From: Yasufumi Ogawa >> Sent: Thursday, December 5, 2019 7:52 PM >> To: Ruifeng Wang (Arm Technology China) ; >> Halim, Abdul ; dev@dpdk.org >> Cc: Kinsella, Ray ; nd >> Subject: Re: [dpdk-dev] [PATCH v3] build: add dockerfile for building docker >> image >> [...] >>> >>> Hi Abdul, >>> >>> I tried the steps on AArch64 platform, and hit error as below: >>> >>> $ sudo docker build -t ${DOCKERAPP_TAG} -f Dockerfile.dpdkSampleApp . >>> Sending build context to Docker daemon 2.55GB >>> Step 1/4 : FROM dpdk >>> ---> 955448007987 >>> Step 2/4 : ADD . /opt/dpdk >>> ---> d8b58019a7e2 >>> Step 3/4 : WORKDIR /opt/dpdk/examples/helloworld >>> ---> Running in 14fc89f7d3cd >>> Removing intermediate container 14fc89f7d3cd >>> ---> 065a682c58fd >>> Step 4/4 : RUN make && cp build/helloworld-shared >> /usr/local/bin/helloworld >>> ---> Running in 11e755a7180b >>> Makefile:44: *** "Please define RTE_SDK environment variable". Stop. >>> The command '/bin/sh -c make && cp build/helloworld-shared >>> /usr/local/bin/helloworld' returned a non-zero code: 2 >>> >>> Missing define of RTE_SDK and RTE_TARGET? >> >> Hi Ruifeng, >> >> I think you run you run the command in dpdk/extras. However, this >> 'Dockerfile.dpdkSampleApp' is expected to be run in dpdk's root dir so that it >> is mounted as '/opt/dpdk' in the second step above. I have tested this >> Dockerfile on Ubuntu 18.04 and compiled without any error. >> RTE_SDK is set correctly, but dpdk's directory is not mounted in the >> container. >> >> Abdul, >> >> >> +docker build -t ${DOCKERAPP_TAG} -f Dockerfile.dpdkSampleApp . >> >> I think this line should be corrected as following, and make it clear it should >> be run in dpdk's root. >> >> docker build -t ${DOCKERAPP_TAG} -f extras/Dockerfile.dpdkSampleApp . >> >> Even if the container image is built successfully, there is another problem in >> running app because it isn't run in privileged mode. >> >> root@0d2a309dfd2c:/opt/dpdk/examples/helloworld# helloworld >> EAL: Detected 16 lcore(s) >> EAL: Detected 1 NUMA nodes >> ... >> EAL: Failed to get current mempolicy: Operation not permitted. Assuming >> MPOL_DEFAULT. >> set_mempolicy: Operation not permitted >> set_mempolicy: Operation not permitted >> EAL: error allocating rte services array >> EAL: FATAL: rte_service_init() failed >> EAL: rte_service_init() failed >> PANIC in main(): >> Cannot init EAL >> 5: [helloworld(+0x84a) [0x55555555484a]] >> 4: [/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) >> [0x7ffff7721b97]] >> 3: [helloworld(+0x818) [0x555555554818]] >> 2: [/usr/local/lib/x86_64-linux-gnu/librte_eal.so.20.1(__rte_panic+0xbd) >> [0x7ffff7afb410]] >> 1: >> [/usr/local/lib/x86_64-linux-gnu/librte_eal.so.20.1(rte_dump_stack+0x2e) >> [0x7ffff7b1598e]] >> Aborted (core dumped) >> >> I think '--privileged' option should be added to avoid the error. >> >> $ docker run --rm --privileged -it -v /dev/hugepages:/dev/hugepages dpdk- >> helloworld >> >> I have one more suggestion. You might have added $USER to docker group >> and run docker without sudo like as following. >> >> $ sudo groupadd docker >> $ sudo usermod -aG docker $USER >> >> I wounder it is better to use sudo in your examples, or add the instruction for >> users not familiar with docker. >> >> Regards, >> Yasufumi > > Hi Yasufumi, > Thank you for your feedback. > The steps for creating the sample app docker file explains that that we > are creating the file at dpdk root directory. So the assumption here is the docker > run command also run from there. Not sure if we need to repeat this later also. > > The 'cat' command above creates the docker file in dpdk > root directory for simplicity. Actually, we just needed the examples/helloworld > source code from there. As for other user application, the docker file could > be anywhere, not necessarily in dpdk tree at all. User need to run docker build > from where their own docker file is. Yes. > > The dpdk 'base' container should be used as shared-lib to build dpdk application > with libdpdk. So, the dpdk source code, RTE_SDK or RTE_TARGET is not needed > unless the pkg-config is unable to find libdpdk. Sorry, I mixed up with the case of using these env variables. > > I will update the patch with suggested '--privileged' flag on docker run command. > Not sure if we should cover the docker permissions and docker specific > configurations on this doc though. I am sure user can find those resources > somewhere else if needed. OK. It is just a suggestion. I though that it is better to include basic usage concisely, but no need if user can find it easily. Regards, Yasufumi > > Hi Ruifeng, > Unfortunately I could not create Aarch64 environment to test this. Could you please > run the following command in your env and see if you can get output as below: > > $ docker run --rm dpdk pkg-config --list-all | grep libdpdk > libdpdk DPDK - The Data Plane Development Kit (DPDK). > > > Regards, > Abdul > >> >>> >>>> + >>>> +This sample app now can be run like any other applicaiton in a >>>> +docker >>>> container. >>>> + >>>> +``` >>>> +$ docker run --rm -it -v /dev/hugepages:/dev/hugepages >>>> +dpdk-helloworld ``` >>>> + >>>> +## Running the sample app >>>> +Once inside the container run helloword binary >>>> + >>>> +``` >>>> +$ root@11233ed2e69c # helloworld >>>> +``` >>>> + >>>> -- >>>> 1.8.3.1 >>>> >>>> -------------------------------------------------------------- >>>> Intel Research and Development Ireland Limited Registered in Ireland >>>> Registered Office: Collinstown Industrial Park, Leixlip, County >>>> Kildare Registered Number: 308263 >>>> >>>> >>>> This e-mail and any attachments may contain confidential material for >>>> the sole use of the intended recipient(s). Any review or distribution >>>> by others is strictly prohibited. If you are not the intended >>>> recipient, please contact the sender and delete all copies. >>> > -------------------------------------------------------------- > Intel Research and Development Ireland Limited > Registered in Ireland > Registered Office: Collinstown Industrial Park, Leixlip, County Kildare > Registered Number: 308263 > > > This e-mail and any attachments may contain confidential material for the sole > use of the intended recipient(s). Any review or distribution by others is > strictly prohibited. If you are not the intended recipient, please contact the > sender and delete all copies. >