Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-22777][Scheduler] Kubernetes mode dockerfile permission and distribution #20007

Closed
wants to merge 2 commits into from

Conversation

foxish
Copy link
Contributor

@foxish foxish commented Dec 18, 2017

What changes were proposed in this pull request?

  1. entrypoint.sh for Kubernetes spark-base image is marked as executable (644 -> 755)
  2. make-distribution script will now create kubernetes/dockerfiles directory when Kubernetes support is compiled.

How was this patch tested?

Manual testing

cc/ @ueshin @jiangxb1987 @mridulm @vanzin @rxin @liyinan926

# Only create and copy the dockerfiles directory if the kubernetes artifacts were built.
if [ -d "$SPARK_HOME"/resource-managers/kubernetes/core/target/ ]; then
mkdir -p "$DISTDIR/kubernetes/"
cp -a "$SPARK_HOME"/resource-managers/kubernetes/docker/src/main/dockerfiles "$DISTDIR/kubernetes/"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you expand more on why "-a" is needed? Thanks!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/resource-managers/kubernetes/docker/src/main/dockerfiles is a directory? how about /resource-managers/kubernetes/docker/src/main/dockerfiles/?

# Only create and copy the dockerfiles directory if the kubernetes artifacts were built.
if [ -d "$SPARK_HOME"/resource-managers/kubernetes/core/target/ ]; then
mkdir -p "$DISTDIR/kubernetes/"
cp -a "$SPARK_HOME"/resource-managers/kubernetes/docker/src/main/dockerfiles "$DISTDIR/kubernetes/"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to build-push-docker-images.sh in #19946, seems like the directories for Dockerfile are under dockerfiles instead of kubernetes/dockerfiles. Will you update the file later?

Copy link
Contributor Author

@foxish foxish Dec 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, will be updating the docs in that PR. Thanks!

@foxish
Copy link
Contributor Author

foxish commented Dec 18, 2017 via email

@jiangxb1987
Copy link
Contributor

LGTM

@ueshin
Copy link
Member

ueshin commented Dec 18, 2017

LGTM.

@SparkQA
Copy link

SparkQA commented Dec 18, 2017

Test build #85059 has finished for PR 20007 at commit 08328bb.

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

Copy link
Member

@felixcheung felixcheung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is 755 a good idea? how about 700?

# Only create and copy the dockerfiles directory if the kubernetes artifacts were built.
if [ -d "$SPARK_HOME"/resource-managers/kubernetes/core/target/ ]; then
mkdir -p "$DISTDIR/kubernetes/"
cp -a "$SPARK_HOME"/resource-managers/kubernetes/docker/src/main/dockerfiles "$DISTDIR/kubernetes/"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/resource-managers/kubernetes/docker/src/main/dockerfiles is a directory? how about /resource-managers/kubernetes/docker/src/main/dockerfiles/?

Copy link
Member

@felixcheung felixcheung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

won't hold the PR, but have questions above.

@foxish
Copy link
Contributor Author

foxish commented Dec 18, 2017

700 might break openshift that doesn't run these containers as root. @erikerlandson can you verify?

@erikerlandson
Copy link
Contributor

Yes, by default in openshift, containers run as an anonymous uid, and as group id 0. So there are a few things that need to be given access to gid 0. I asked some of our security people and they considered these mods to be acceptable.

@foxish
Copy link
Contributor Author

foxish commented Dec 18, 2017

@vanzin PTAL

@erikerlandson
Copy link
Contributor

If we wanted to lock down permissions a bit more, we might consider 750, but I'd prefer to make permission changes with more time for testing, maybe for 2.4

@vanzin
Copy link
Contributor

vanzin commented Dec 18, 2017

Merging to master.

@asfgit asfgit closed this in 0609dcc Dec 18, 2017
@foxish foxish deleted the fix-dockerfiles branch December 19, 2017 00:04
asfgit pushed a commit that referenced this pull request Dec 22, 2017
What changes were proposed in this pull request?

This PR contains documentation on the usage of Kubernetes scheduler in Spark 2.3, and a shell script to make it easier to build docker images required to use the integration. The changes detailed here are covered by #19717 and #19468 which have merged already.

How was this patch tested?
The script has been in use for releases on our fork. Rest is documentation.

cc rxin mateiz (shepherd)
k8s-big-data SIG members & contributors: foxish ash211 mccheah liyinan926 erikerlandson ssuchter varunkatta kimoonkim tnachen ifilonenko
reviewers: vanzin felixcheung jiangxb1987 mridulm

TODO:
- [x] Add dockerfiles directory to built distribution. (#20007)
- [x] Change references to docker to instead say "container" (#19995)
- [x] Update configuration table.
- [x] Modify spark.kubernetes.allocation.batch.delay to take time instead of int (#20032)

Author: foxish <ramanathana@google.com>

Closes #19946 from foxish/update-k8s-docs.
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