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

Add support for windows clusters. #2211

Merged
merged 1 commit into from
Mar 4, 2017
Merged

Conversation

brendandburns
Copy link
Member

@@ -399,6 +399,10 @@ def acs_create(resource_group_name, deployment_name, name, ssh_key_value, dns_na
:param tags: Tags object.
:type tags: object
:param dict custom_headers: headers that will be added to the request
:param windows: If true, the cluster will be built for running windows container.
Copy link

Choose a reason for hiding this comment

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

"Windows containers" - capital W

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

if windows:
windows_profile = {
"adminUsername": admin_username,
"adminPassword": admin_password,
Copy link

Choose a reason for hiding this comment

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

Is there validation in the CLI for Windows passwords and can it be used here? The cloud user account policy is here: https://docs.microsoft.com/en-us/azure/active-directory/active-directory-passwords-policy

Copy link
Member Author

Choose a reason for hiding this comment

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

There's no validation in there yet (even for VMs) I'll try to add it in a different PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

will the current default value of empty string work? If not, i suggest put in a line to just throw

Copy link
Contributor

Choose a reason for hiding this comment

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

FYI, VM's password validation is here

Copy link
Member Author

Choose a reason for hiding this comment

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

validation added.

Copy link

@anhowe anhowe left a comment

Choose a reason for hiding this comment

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

some minor comments, lgtm

@brendandburns
Copy link
Member Author

Thanks for the review. @yugang-msft can I can a review for this?

@@ -350,7 +350,7 @@ def acs_create(resource_group_name, deployment_name, name, ssh_key_value, dns_na
content_version=None, admin_username="azureuser", agent_count="3",
agent_vm_size="Standard_D2_v2", location=None, master_count="3",
orchestrator_type="dcos", service_principal=None, client_secret=None, tags=None,
custom_headers=None, raw=False,
custom_headers=None, windows=False, admin_password="", raw=False,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest update the params.py file to make windows as a flag, rather with values true and false

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

if windows:
windows_profile = {
"adminUsername": admin_username,
"adminPassword": admin_password,
Copy link
Contributor

Choose a reason for hiding this comment

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

will the current default value of empty string work? If not, i suggest put in a line to just throw

if windows:
windows_profile = {
"adminUsername": admin_username,
"adminPassword": admin_password,
Copy link
Contributor

Choose a reason for hiding this comment

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

FYI, VM's password validation is here

@brendandburns
Copy link
Member Author

Comments addressed. ptal.

Thanks
--brendna

Copy link
Contributor

@yugangw-msft yugangw-msft left a comment

Choose a reason for hiding this comment

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

Left 2 questions to clarify

@@ -70,6 +70,8 @@ def _get_default_install_location(exe_name):
register_extra_cli_argument('acs create', 'generate_ssh_keys', action='store_true', help='Generate SSH public and private key files if missing')
register_cli_argument('acs create', 'agent_vm_size', completer=get_vm_size_completion_list)

register_cli_argument('acs create', 'windows', action='store_false', help='If true, deploy a windows container cluster.')
Copy link
Contributor

Choose a reason for hiding this comment

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

why not store_true? This automatically creates a default value of False, which I believe is you want
store_false will default to True when the command-line argument is not present. Is that what you want?

Copy link
Member Author

Choose a reason for hiding this comment

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

That makes no sense to me :P, but you are right I want a default value of False...

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed the naming is a bit odd. It is from the built-in argparse package which CLI builds on top of

os_type = 'Linux'
if windows:
if len(admin_password) == 0:
raise CLIError('--admin-password is required.')
Copy link
Contributor

Choose a reason for hiding this comment

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

The upcoming check of <6 is good enough, so I suggest we just remove this if

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd prefer to have a cleaner error messages.

@brendandburns
Copy link
Member Author

Changes addressed, please re-check.

Thanks!
--brendan

@yugangw-msft
Copy link
Contributor

@brendandburns could you resolve the conflict, so i can merge?

@derekbekoe derekbekoe added the ACS az acs/aks/openshift label Feb 28, 2017
@brendandburns
Copy link
Member Author

@yugangw-msft, done.

Thanks

@codecov-io
Copy link

Codecov Report

Merging #2211 into master will decrease coverage by -0.05%.
The diff coverage is 8.33%.

@@            Coverage Diff            @@
##           master   #2211      +/-   ##
=========================================
- Coverage   72.24%   72.2%   -0.05%     
=========================================
  Files         323     323              
  Lines       18086   18098      +12     
  Branches     2650    2654       +4     
=========================================
+ Hits        13067   13068       +1     
- Misses       4196    4206      +10     
- Partials      823     824       +1
Impacted Files Coverage Δ
...re-cli-acs/azure/cli/command_modules/acs/custom.py 34.34% <0%> (-0.85%)
...e-cli-acs/azure/cli/command_modules/acs/_params.py 69.09% <100%> (+0.57%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7bb18e0...49f2d1d. Read the comment 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.

None yet

6 participants