<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Docker on YARN Incorrect Program Arguments in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Docker-on-YARN-Incorrect-Program-Arguments/m-p/226363#M84692</link>
    <description>&lt;P&gt;Comma separating the launch_command fields and setting YARN_CONTAINER_RUNTIME_DOCKER_RUN_OVERRIDE_DISABLE=true in the service definition rather than yarn-site.env allowed me to use my custom entrypoint as expected in HDP 3.0.1. &lt;/P&gt;&lt;P&gt;Strangely, exporting YARN_CONTAINER_RUNTIME_DOCKER_RUN_OVERRIDE_DISABLE=true in the yarn-site.env worked fine in my Apache Hadoop 3.1.1 environment, but not in my Ambari-installed HDP 3.0.1 environment. The stdout and stderr redirects are not included in the docker run command in the Apache release. Must be some other setting involved, but I am past my issue, so I will leave it here.&lt;/P&gt;&lt;P&gt;Thanks, &lt;A rel="user" href="https://community.cloudera.com/users/62182/tparimi.html" nodeid="62182"&gt;@Tarun Parimi&lt;/A&gt;!&lt;/P&gt;&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/62182/tparimi.html" nodeid="62182"&gt;&lt;/A&gt; &lt;/P&gt;</description>
    <pubDate>Fri, 09 Nov 2018 04:32:06 GMT</pubDate>
    <dc:creator>shjelmfelt</dc:creator>
    <dc:date>2018-11-09T04:32:06Z</dc:date>
    <item>
      <title>Docker on YARN Incorrect Program Arguments</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Docker-on-YARN-Incorrect-Program-Arguments/m-p/226359#M84688</link>
      <description>&lt;P&gt;When running a Dockerized YARN service, YARN is not providing the correct input arguments.&lt;/P&gt;&lt;P&gt;The service is defined as follows. The entry point in the docker file is ["java", "-jar", "myapp.jar"]. For debugging, it outputs the incoming arguments and exits.&lt;/P&gt;&lt;PRE&gt;{
  "name": "myapp",
  "version": "1.0.0",
  "description": "myapp",
  "components" :
    [
      {
        "name": "myappcontainers",
        "number_of_containers": 1,
        "artifact": {
          "id": "myapp:1.0-SNAPSHOT",
          "type": "DOCKER"
        },
        "launch_command": "input1 input2",
        "resource": {
          "cpus": 1,
          "memory": "256"
        }
      }
    ]
}&lt;/PRE&gt;&lt;P&gt;Here is the output from YARN:&lt;/P&gt;&lt;PRE&gt;Launching docker container...

Docker run command: /usr/bin/docker run --name=container_e06_1541194419811_0006_01_000026 --user=1015:1015 --net=yarnnetwork -v /hadoop/yarn/local/filecache:/hadoop/yarn/local/filecache:ro -v /hadoop/yarn/local/usercache/admin/filecache:/hadoop/yarn/local/usercache/admin/filecache:ro -v /hadoop/yarn/log/application_1541194419811_0006/container_e06_1541194419811_0006_01_000026:/hadoop/yarn/log/application_1541194419811_0006/container_e06_1541194419811_0006_01_000026 -v /hadoop/yarn/local/usercache/admin/appcache/application_1541194419811_0006:/hadoop/yarn/local/usercache/admin/appcache/application_1541194419811_0006 --cgroup-parent=/hadoop-yarn/container_e06_1541194419811_0006_01_000026 --cap-drop=ALL --cap-add=SYS_CHROOT --cap-add=MKNOD --cap-add=SETFCAP --cap-add=SETPCAP --cap-add=DAC_READ_SEARCH --cap-add=FSETID --cap-add=SYS_PTRACE --cap-add=CHOWN --cap-add=SYS_ADMIN --cap-add=AUDIT_WRITE --cap-add=SETGID --cap-add=NET_RAW --cap-add=FOWNER --cap-add=SETUID --cap-add=DAC_OVERRIDE --cap-add=KILL --cap-add=NET_BIND_SERVICE --hostname=myappcontainers-3.myapp.admin.EXAMPLE.COM --group-add 1015 --env-file /hadoop/yarn/local/nmPrivate/application_1541194419811_0006/container_e06_1541194419811_0006_01_000026/docker.container_e06_1541194419811_0006_01_0000264842430064377299975.env myapp:1.0-SNAPSHOT input1 input2 1&amp;gt;/hadoop/yarn/log/application_1541194419811_0006/container_e06_1541194419811_0006_01_000026/stdout.txt 2&amp;gt;/hadoop/yarn/log/application_1541194419811_0006/container_e06_1541194419811_0006_01_000026/stderr.txt&lt;/PRE&gt;
&lt;PRE&gt;Received input: input1 input2 1&amp;gt;/hadoop/yarn/log/application_1541194419811_0006/container_e06_1541194419811_0006_01_000026/stdout.txt 2&amp;gt;/hadoop/yarn/log/application_1541194419811_0006/container_e06_1541194419811_0006_01_000026/stderr.txt&lt;/PRE&gt;&lt;P&gt;The program itself is given the redirection commands. Is there a way to disable this behavior?&lt;/P&gt;&lt;P&gt;The only two workarounds I have identified are:&lt;/P&gt;&lt;OL&gt;
&lt;LI&gt;Change the ENTRYPOINT in the dockerfile to be ["sh", "-c"] and the launch_command to "java -jar myjar.jar"&lt;/LI&gt;&lt;LI&gt;Change the program to use or ignore the "1&amp;gt;" and "2&amp;gt;" inputs&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Both of these solutions require repackaging in a way that does not conform to Docker best practice.&lt;/P&gt;</description>
      <pubDate>Sat, 03 Nov 2018 06:11:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Docker-on-YARN-Incorrect-Program-Arguments/m-p/226359#M84688</guid>
      <dc:creator>shjelmfelt</dc:creator>
      <dc:date>2018-11-03T06:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: Docker on YARN Incorrect Program Arguments</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Docker-on-YARN-Incorrect-Program-Arguments/m-p/226360#M84689</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/2781/shjelmfelt.html" nodeid="2781"&gt;@Sam Hjelmfelt&lt;/A&gt; Running Docker containers which have ENTRYPOINT in YARN Services requires additional configuration to be specified in the service spec. The env variable YARN_CONTAINER_RUNTIME_DOCKER_RUN_OVERRIDE_DISABLE needs to be set to true. Additionally the launch command parameters are separated with commas instead of space. Try running with the below spec.&lt;/P&gt;&lt;PRE&gt;{
  "name": "myapp",
  "version": "1.0.0",
  "description": "myapp",
  "components": [
    {
      "name": "myappcontainers",
      "number_of_containers": 1,
      "artifact": {
        "id": "myapp:1.0-SNAPSHOT",
        "type": "DOCKER"
      },
      "launch_command": "input1,input2",
      "resource": {
        "cpus": 1,
        "memory": "256"
      },
      "configuration": {
        "env": {
          "YARN_CONTAINER_RUNTIME_DOCKER_RUN_OVERRIDE_DISABLE": "true"
        }
      }
    }
  ]
}&lt;/PRE&gt;&lt;P&gt;For further reference, refer to the documentation &lt;A href="https://hadoop.apache.org/docs/r3.1.1/hadoop-yarn/hadoop-yarn-site/yarn-service/Examples.html#Docker_image_ENTRYPOINT_support" target="_blank"&gt;here&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Sat, 03 Nov 2018 12:00:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Docker-on-YARN-Incorrect-Program-Arguments/m-p/226360#M84689</guid>
      <dc:creator>TarunParimi</dc:creator>
      <dc:date>2018-11-03T12:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: Docker on YARN Incorrect Program Arguments</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Docker-on-YARN-Incorrect-Program-Arguments/m-p/226361#M84690</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/62182/tparimi.html" nodeid="62182"&gt;@Tarun Parimi&lt;/A&gt; Thanks for the tip. I set "YARN_CONTAINER_RUNTIME_DOCKER_RUN_OVERRIDE_DISABLE" in the yarn-env.sh, because I did not know I could set it on the service itself. This is a better solution, but does not address the main issue.&lt;/P&gt;&lt;P&gt;Unfortunately, comma separating the input parameters did not help either. Here is the output:&lt;/P&gt;&lt;PRE&gt;Docker run command: /usr/bin/docker run --name=container_e06_1541194419811_0015_01_000002 --user=1015:1015 --net=yarnnetwork -v /hadoop/yarn/local/filecache:/hadoop/yarn/local/filecache:ro -v /hadoop/yarn/local/usercache/shjelmfelt/filecache:/hadoop/yarn/local/usercache/admin/filecache:ro -v /hadoop/yarn/log/application_1541194419811_0015/container_e06_1541194419811_0015_01_000002:/hadoop/yarn/log/application_1541194419811_0015/container_e06_1541194419811_0015_01_000002 -v /hadoop/yarn/local/usercache/admin/appcache/application_1541194419811_0015:/hadoop/yarn/local/usercache/admin/appcache/application_1541194419811_0015 --cgroup-parent=/hadoop-yarn/container_e06_1541194419811_0015_01_000002 --cap-drop=ALL --cap-add=SYS_CHROOT --cap-add=MKNOD --cap-add=SETFCAP --cap-add=SETPCAP --cap-add=DAC_READ_SEARCH --cap-add=FSETID --cap-add=SYS_PTRACE --cap-add=CHOWN --cap-add=SYS_ADMIN --cap-add=AUDIT_WRITE --cap-add=SETGID --cap-add=NET_RAW --cap-add=FOWNER --cap-add=SETUID --cap-add=DAC_OVERRIDE --cap-add=KILL --cap-add=NET_BIND_SERVICE --hostname=myappcontainers-0.myapp.admin.EXAMPLE.COM --group-add 1015 --env-file /hadoop/yarn/local/nmPrivate/application_1541194419811_0015/container_e06_1541194419811_0015_01_000002/docker.container_e06_1541194419811_0015_01_0000022942289027318724111.env 172.26.224.119:5000/myapp:1.0-SNAPSHOT input1 input2 1&amp;gt;/hadoop/yarn/log/application_1541194419811_0015/container_e06_1541194419811_0015_01_000002/stdout.txt 2&amp;gt;/hadoop/yarn/log/application_1541194419811_0015/container_e06_1541194419811_0015_01_000002/stderr.txt 
Received input: input1,input2 1&amp;gt;/hadoop/yarn/log/application_1541194419811_0015/container_e06_1541194419811_0015_01_000002/stdout.txt 2&amp;gt;/hadoop/yarn/log/application_1541194419811_0015/container_e06_1541194419811_0015_01_000002/stderr.txt
&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Nov 2018 04:29:01 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Docker-on-YARN-Incorrect-Program-Arguments/m-p/226361#M84690</guid>
      <dc:creator>shjelmfelt</dc:creator>
      <dc:date>2018-11-06T04:29:01Z</dc:date>
    </item>
    <item>
      <title>Re: Docker on YARN Incorrect Program Arguments</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Docker-on-YARN-Incorrect-Program-Arguments/m-p/226362#M84691</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/2781/shjelmfelt.html" nodeid="2781"&gt;@Sam Hjelmfelt&lt;/A&gt; I don't think setting YARN_CONTAINER_RUNTIME_DOCKER_RUN_OVERRIDE_DISABLE in yarn-env.sh, will set the same in the ContainerLaunchContext. Have you tried setting it in the service spec itself to see if it helps ?&lt;/P&gt;</description>
      <pubDate>Tue, 06 Nov 2018 14:27:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Docker-on-YARN-Incorrect-Program-Arguments/m-p/226362#M84691</guid>
      <dc:creator>TarunParimi</dc:creator>
      <dc:date>2018-11-06T14:27:50Z</dc:date>
    </item>
    <item>
      <title>Re: Docker on YARN Incorrect Program Arguments</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Docker-on-YARN-Incorrect-Program-Arguments/m-p/226363#M84692</link>
      <description>&lt;P&gt;Comma separating the launch_command fields and setting YARN_CONTAINER_RUNTIME_DOCKER_RUN_OVERRIDE_DISABLE=true in the service definition rather than yarn-site.env allowed me to use my custom entrypoint as expected in HDP 3.0.1. &lt;/P&gt;&lt;P&gt;Strangely, exporting YARN_CONTAINER_RUNTIME_DOCKER_RUN_OVERRIDE_DISABLE=true in the yarn-site.env worked fine in my Apache Hadoop 3.1.1 environment, but not in my Ambari-installed HDP 3.0.1 environment. The stdout and stderr redirects are not included in the docker run command in the Apache release. Must be some other setting involved, but I am past my issue, so I will leave it here.&lt;/P&gt;&lt;P&gt;Thanks, &lt;A rel="user" href="https://community.cloudera.com/users/62182/tparimi.html" nodeid="62182"&gt;@Tarun Parimi&lt;/A&gt;!&lt;/P&gt;&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/62182/tparimi.html" nodeid="62182"&gt;&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 09 Nov 2018 04:32:06 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Docker-on-YARN-Incorrect-Program-Arguments/m-p/226363#M84692</guid>
      <dc:creator>shjelmfelt</dc:creator>
      <dc:date>2018-11-09T04:32:06Z</dc:date>
    </item>
    <item>
      <title>Re: Docker on YARN Incorrect Program Arguments</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Docker-on-YARN-Incorrect-Program-Arguments/m-p/226364#M84693</link>
      <description>&lt;P&gt;How to pass args to your app inside the docker when you run it with spark-submit like  ../bin/spark-submit  --master yarn --conf
spark.executorEnv.YARN_CONTAINER_RUNTIME_TYPE=docker --conf spark.executorEnv.
YARN_CONTAINER_RUNTIME_DOCKER_IMAGE=test .. ?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2019 01:26:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Docker-on-YARN-Incorrect-Program-Arguments/m-p/226364#M84693</guid>
      <dc:creator>imzaur777</dc:creator>
      <dc:date>2019-06-14T01:26:40Z</dc:date>
    </item>
    <item>
      <title>Re: Docker on YARN Incorrect Program Arguments</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Docker-on-YARN-Incorrect-Program-Arguments/m-p/226365#M84694</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.hortonworks.com/users/62182/tparimi.html"&gt;@Tarun Parimi&lt;/A&gt; Thanks for the tip. It helped me too.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2019 01:26:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Docker-on-YARN-Incorrect-Program-Arguments/m-p/226365#M84694</guid>
      <dc:creator>dhiraj</dc:creator>
      <dc:date>2019-06-14T01:26:44Z</dc:date>
    </item>
  </channel>
</rss>

