Skip to content

Conversation

@sel
Copy link
Contributor

@sel sel commented Oct 22, 2018

What changes were proposed in this pull request?

docker-image-tool.sh uses getopts in which a colon signifies that an
option takes an argument. Since -n does not take an argument it
should not have a colon.

How was this patch tested?

Following the reproduction in JIRA:-

  1. Created a custom Dockerfile to use for the spark-r container image.
    In each of the steps below the path to this Dockerfile is passed with the '-R' option.
    (spark-r is used here simply as an example, the bug applies to all options)

  2. Built container images without '-n'.
    The result is that the '-R' option is honoured and the hello-world image is built for spark-r, as expected.

  3. Built container images with '-n' to reproduce the issue
    The result is that the '-R' option is ignored and the default container image for spark-r is built

  4. Applied the patch and re-built container images with '-n' and did not reproduce the issue
    The result is that the '-R' option is honoured and the hello-world image is built for spark-r, as expected.

docker-image-tool.sh uses getopts in which a colon signifies that an
option takes an argument.  Since -n does not take an argument it
should not have a colon.

Signed-off-by: Steve <[email protected]>
@viirya
Copy link
Member

viirya commented Oct 23, 2018

cc @vanzin

@kiszk
Copy link
Member

kiszk commented Oct 23, 2018

Based on bash syntax, this change makes sense. I would like to wait for @vanzin 's comment.

@ifilonenko
Copy link
Contributor

Can you add a [K8S] flag to this PR as this is related to the Kubernetes code. Otherwise, this change looks good to me.

@sel sel changed the title [SPARK-25803] Fix docker-image-tool.sh -n option [SPARK-25803] [K8S] Fix docker-image-tool.sh -n option Oct 23, 2018
@sel sel changed the title [SPARK-25803] [K8S] Fix docker-image-tool.sh -n option [SPARK-25803][K8S] Fix docker-image-tool.sh -n option Oct 24, 2018
@ifilonenko
Copy link
Contributor

test this please

@SparkQA
Copy link

SparkQA commented Oct 25, 2018

@SparkQA
Copy link

SparkQA commented Oct 25, 2018

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/4456/

@SparkQA
Copy link

SparkQA commented Oct 25, 2018

Test build #97993 has finished for PR 22798 at commit a07d105.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@vanzin
Copy link
Contributor

vanzin commented Oct 25, 2018

Merging to master / 2.4.

asfgit pushed a commit that referenced this pull request Oct 25, 2018
## What changes were proposed in this pull request?

docker-image-tool.sh uses getopts in which a colon signifies that an
option takes an argument.  Since -n does not take an argument it
should not have a colon.

## How was this patch tested?

Following the reproduction in [JIRA](https://issues.apache.org/jira/browse/SPARK-25803):-

0. Created a custom Dockerfile to use for the spark-r container image.
In each of the steps below the path to this Dockerfile is passed with the '-R' option.
(spark-r is used here simply as an example, the bug applies to all options)

1. Built container images without '-n'.
The [result](https://gist.github.com/sel/59f0911bb1a6a485c2487cf7ca770f9d) is that the '-R' option is honoured and the hello-world image is built for spark-r, as expected.

2. Built container images with '-n' to reproduce the issue
The [result](https://gist.github.com/sel/e5cabb9f3bdad5d087349e7fbed75141) is that the '-R' option is ignored and the default container image for spark-r is built

3. Applied the patch and re-built container images with '-n' and did not reproduce the issue
The [result](https://gist.github.com/sel/6af14b95012ba8ff267a4fce6e3bd3bf) is that the '-R' option is honoured and the hello-world image is built for spark-r, as expected.

Closes #22798 from sel/fix-docker-image-tool-nocache.

Authored-by: Steve <[email protected]>
Signed-off-by: Marcelo Vanzin <[email protected]>
(cherry picked from commit 9b98d91)
Signed-off-by: Marcelo Vanzin <[email protected]>
@asfgit asfgit closed this in 9b98d91 Oct 25, 2018
@sel sel deleted the fix-docker-image-tool-nocache branch October 25, 2018 20:49
jackylee-ch pushed a commit to jackylee-ch/spark that referenced this pull request Feb 18, 2019
## What changes were proposed in this pull request?

docker-image-tool.sh uses getopts in which a colon signifies that an
option takes an argument.  Since -n does not take an argument it
should not have a colon.

## How was this patch tested?

Following the reproduction in [JIRA](https://issues.apache.org/jira/browse/SPARK-25803):-

0. Created a custom Dockerfile to use for the spark-r container image.
In each of the steps below the path to this Dockerfile is passed with the '-R' option.
(spark-r is used here simply as an example, the bug applies to all options)

1. Built container images without '-n'.
The [result](https://gist.github.com/sel/59f0911bb1a6a485c2487cf7ca770f9d) is that the '-R' option is honoured and the hello-world image is built for spark-r, as expected.

2. Built container images with '-n' to reproduce the issue
The [result](https://gist.github.com/sel/e5cabb9f3bdad5d087349e7fbed75141) is that the '-R' option is ignored and the default container image for spark-r is built

3. Applied the patch and re-built container images with '-n' and did not reproduce the issue
The [result](https://gist.github.com/sel/6af14b95012ba8ff267a4fce6e3bd3bf) is that the '-R' option is honoured and the hello-world image is built for spark-r, as expected.

Closes apache#22798 from sel/fix-docker-image-tool-nocache.

Authored-by: Steve <[email protected]>
Signed-off-by: Marcelo Vanzin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants