Skip to content
This repository was archived by the owner on Dec 4, 2024. It is now read-only.

Conversation

@akirillov
Copy link
Contributor

What changes were proposed in this pull request?

Resolves https://jira.mesosphere.com/browse/DCOS-49020

  • Spark Mesos Dispatcher will launch Driver and Executors using {{service.user}} by default
  • Tests to verify support for user override via spark.mesos.executor.docker.parameters=user=<user> and spark.mesos.driverEnv.SPARK_USER=<user>

How were these changes tested?

  • newly added integration tests covering all combination of containerizers for Dispatcher and Spark apps
  • running test_spark_users.py against both CoreOS and CentOS clusters

Release Notes

  • Spark Mesos Dispatcher launches Driver and Executors using {{service.user}} by default for both Docker and Mesos containerizers
  • Improved support for docker_user UID override for CentOS/RHEL (no need to specify UID at the time of job submit)
  • Added support for user override for submitted jobs. It possible to launch a job as nobody while Dispatcher is running is root

Copy link
Contributor

@samvantran samvantran left a comment

Choose a reason for hiding this comment

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

Changes look good and I like the breadth of tests. I did have a few comments but not blocking but looks like the test_users failed. I see this error log where it attempts to clean up drivers https://teamcity.mesosphere.io/viewLog.html?tab=buildLog&logTab=tree&filter=debug&expand=all&buildId=1661915&_focus=85531

fi

if [ "${SPARK_DOCKER_USER}" != "" ]; then
echo "spark.mesos.dispatcher.driverDefault.spark.mesos.executor.docker.parameters=user=${SPARK_DOCKER_USER}" >> ${SPARK_HOME}/conf/mesos-cluster-dispatcher.properties
Copy link
Contributor

Choose a reason for hiding this comment

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

wow what a config +1 for taking care of this for the user

@pytest.mark.parametrize('user,use_ucr_containerizer,use_ucr_for_spark_submit', [
("nobody", True, True),
("nobody", True, False),
("nobody", False, True),
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to test scenarios where users launch dispatchers with docker but submit jobs with UCR? I guess it doesn't hurt but is this realistic?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

By default, Dispatcher is deployed using Docker containerizer. From here we can think of the next scenarios:

  • a user submits a job (False, False)
  • a user discovers UCR option, updates Dispatcher config, but keeps submitting jobs as before (True, False)
  • user discovers spark-submit option spark.mesos.containerizer=mesos but runs Dispatcher with default config (False, True)
  • a user is experienced and enables UCR in both Dispatcher and jobs (True, True)

The whole goal of this exhaustive testing is to make sure we don't miss some not-so-obvious combination of containerizers in which user propagation breaks.

args=submit_args)
try:
sdk_tasks.check_running(app_name, 1, timeout_seconds=300)
driver_task = shakedown.get_task(driver_task_id, completed=False)
Copy link
Contributor

Choose a reason for hiding this comment

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

we ought to move away from shakedown but it doesn't have to be this PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I created a Jira ticket for it, probably it makes sense to wait until we have proper dependency management for the testing package from dcos-commons.

@akirillov akirillov force-pushed the DCOS-49020-propagate-docker-user-to-driver-and-executors branch 3 times, most recently from 574ebf2 to bf694e1 Compare March 7, 2019 20:12
@akirillov akirillov force-pushed the DCOS-49020-propagate-docker-user-to-driver-and-executors branch from bf694e1 to 9f3ceae Compare March 8, 2019 01:47
@akirillov akirillov merged commit 4e4d11d into master Mar 8, 2019
@akirillov akirillov deleted the DCOS-49020-propagate-docker-user-to-driver-and-executors branch March 8, 2019 05:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants