Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Feature: on node user creation #303

Merged
merged 14 commits into from
Jan 27, 2018

Conversation

jafreck
Copy link
Member

@jafreck jafreck commented Dec 23, 2017

Fix #272
Fix #305

zip_resource_files = upload_node_scripts.zip_scripts(self.blob_client, cluster_conf.custom_scripts, cluster_conf.spark_configuration)
if cluster_conf.user_configuration:
user_conf = yaml.dump({'username': cluster_conf.user_configuration.username,
'password': cluster_conf.user_configuration.password,
Copy link
Contributor

Choose a reason for hiding this comment

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

We may want to omit password until we support encryption.

Copy link
Member Author

Choose a reason for hiding this comment

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

If we disable password here that means that we would no longer support adding a user with password at cluster creation time. That's a potentially breaking change, so maybe this should PR should wait for or include the encryption feature.

Copy link
Member Author

@jafreck jafreck Dec 24, 2017

Choose a reason for hiding this comment

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

If the goal is just to not have the password in cleartext in user.yaml, we could also hash it, and create the user using the hash.

That would break ssh'ing outside of AZTK, though.

'cluster_id': cluster_conf.cluster_id})
else:
user_conf = None
zip_resource_files = upload_node_scripts.zip_scripts(self.blob_client, cluster_conf.custom_scripts, cluster_conf.spark_configuration, user_conf)
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: line too long

@@ -114,5 +114,9 @@ def zip_scripts(blob_client, custom_scripts, spark_conf):
for jar in spark_conf.jars:
zipf = __add_file_to_zip(zipf, jar, 'jars', binary=True)

if user_conf:
zipf = __add_str_to_zip(zipf, user_conf, 'user.yaml')
Copy link
Contributor

Choose a reason for hiding this comment

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

why _add_str_to_zip? Isn't this a file?

Copy link
Member Author

Choose a reason for hiding this comment

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

The user_conf is a byte string that is written to a file in node_scripts called user.yaml. user.yaml is not a file on the client.

__add_str_to_zip() is probably not the best name for what this method does, though.

Copy link
Contributor

@paselem paselem left a comment

Choose a reason for hiding this comment

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

Looks like you're missing docs for this. When writing them, please note that using an ssh key-pair is the preferred method of adding a user to a node.

@@ -23,6 +23,13 @@ def __init__(self, name: str = None, script: str = None, run_on=None):
self.run_on = run_on


class UserConfiguration:
def __init__(self, username: str, ssh_key: str = None, password: str = None):
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this get auto-populated from the users' secrets.yaml?

Copy link
Member Author

Choose a reason for hiding this comment

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

On the CLI, yeah -- that happens here:
https://github.com/jafreck/aztk/blob/06f85c2538db98e168fed8c38fe9b88524f95e5f/cli/spark/endpoints/cluster/cluster_create.py#L87

For the SDK, no the secrets.yaml file is not used at all.

@jafreck jafreck merged commit 85a472c into Azure:master Jan 27, 2018
jafreck added a commit that referenced this pull request Feb 23, 2018
* Feature: on node user creation (#303)

* client side on node user creation

* start create user on node implementation

* fix on node user creation

* remove debug statements

* remove commented code

* line too long

* fix spinner password prompt ui bug

* set wait to false by default, formatting

* encrypt password on client, decrypt on node

* update docs, log warning if password used

* Fix list-apps crash (#364)

* Allow submitting jobs into a VNET (#365)

* Add subnet_id to job submission cluster config

* add some docs

* Feature: Spark mixed mode support (#350)

* add support for aad creds for storage on node

* add mixed mode support

* add docs

* switch error order

* add dedicated to get_cluster

* remove mixed mode in print_cluster_conf

* Feature: spark init docker repo customization (#358)

* customize docker_repo based on init args

* whitespace

* add some docs

* r-base to r

* case insensitive r flag, typo fix

* Bug: Load default Jars for job submission CLI (#367)

* load jars in .aztk/ by default

* rewrite loading config files

* Feature: Cluster Run and Copy (#304)

* start implementation of cluster run

* fix cluster_run

* start debug sequential user add and delete

* parallelize user creation and deletion, start implementation of cluster scp

* continue cluster_scp implementation

* debug statements, disconnect error: permission denied

* untesteed parakimo implementation of clus_run

* continue debugging user creation bug

* fix bug with pool user creation, start concurrent implementation

* start fix of paramiko cluster_run and cluster_copy

* working paramiko cluster_run implementation, start cluster_scp

* fix cluster_scp command

* update requirements, rename cluster_run function

* remove unused shell functions

* parallelize run and scp, add container_name, create logs wrapper

* change scp to copy, clean up

* sort imports

* remove asyncssh from node requirements

* remove old import

* remove bad error handling

* make cluster user management methods private

* remove comment

* remove accidental commit

* fix merge, move delete to finally clause

* add docs

* formatting

* Feature: Refactor cluster config to use ClusterConfiguration model (#343)

* Bug: fix core-site.xml typo (#378)

* fix typo

* crlf->lf

* Bug: fix regex for is_gpu_enabled (#380)

* fix regex for is_gpu_enabled

* crlf->lf

* Bug: spark SDK example fix (#383)

* start fix sdk

* fix sdk example

* crlf->lf

* Fix: Custom scripts not read from cluster.yaml (#388)

* Feature: spark shuffle service (#374)

* start shuffle service by default

* whitespace, delete misplaced file

* crlf->lf

* crlf->lf

* move spark scratch space off os drive

* Feature: enable dynamic allocation by default (#386)

* Bug: stop using mutable default parameters (#392)

* Bug: always upload spark job logs errors (#395)

* Bug: spark submit upload error log type error (#397)

* Bug: Spark Job list apps exit code 0 (#396)

* Bug: fix spark-submit cores args (#399)

* Fix: Trying to add user before master is ready show better error (#402)

* Bug: move spark.local.dir to location usable by rstudioserver (#407)

* Feature: SDK support for file-like configuration objects (#373)

* add support for filelike objects for conifguration files

* fix custom scripts

* remove os.pathlike

* merge error

* Feature: Basic Cluster and Job Submission SDK Tests (#344)

* add initial cluster tests

* add cluster tests, add simple job submission test scenario

* sort imports

* fix job tests

* fix job tests

* remove pytest from travis build

* cluster per test, parallel pytest plugin

* delete cluster after tests, wait until deleted

* fix bugs

* catch right error, change cluster_id to base_cluster_id

* fix test name

* fixes

*  move tests to intregration_tests dir

* update travis to run non-integration tests

* directory structure, decoupled job tests

* fix job tests, issue with submit_job

* fix bug

* add test docs

* add cluster and job delete to finally clause

* Feature: Spark add worker on master option (#415)

* Add worker_on_master to ClusterConfiguration

* add worker_on_master to JobConfiguration

* Feature: task affinity to master node (#413)

* Release: v0.6.0 (#416)

* update changelog and version

* underscores to stars
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.

2 participants