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 Kubernetes support to ACS. #1258

Merged
merged 1 commit into from
Nov 10, 2016

Conversation

brendandburns
Copy link
Member

@yugang-msft

Thanks!
--brendan

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.

Please fix pylint errors and get CI green. Also clarify review comments.


cli_command('acs dcos browse', dcos_browse)
cli_command('acs dcos install-cli', dcos_install_cli)
cli_command('acs create', acs_create)
cli_command('acs dcos browse', dcos_browse)
Copy link
Contributor

Choose a reason for hiding this comment

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

please delete this line, as this is a duplicate of 3 lines above

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.

file_url = ''
system = platform.system()
if system == 'Windows':
file_url = 'https://storage.googleapis.com/kubernetes-release/release/v1.4.4/bin/windows/amd64/kubectl.exe'
Copy link
Contributor

@yugangw-msft yugangw-msft Nov 7, 2016

Choose a reason for hiding this comment

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

Consider to exposing the version like you did for dcos. Up to you at this moment though

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.

sys.stdout.write ('.')
sys.stdout.flush()
time.sleep(2 + 2 * x)
print('done')
Copy link
Contributor

Choose a reason for hiding this comment

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

use sys.stdout.write just be consistent?

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 prefer print for it's platform indepdent newline.


import azure.cli.core._logging as _logging
from azure.cli.command_modules.acs import acs_client, proxy
from azure.cli.command_modules.vm.mgmt_acs.lib import \
AcsCreationClient as ACSClient
Copy link
Member

Choose a reason for hiding this comment

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

mgmt_acs should be moved into this command module rather than the acs module having a dependency on vm.

Copy link
Contributor

Choose a reason for hiding this comment

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

@derekbekoe, this will be cleaned up in 2 weeks per conversation with Brendan

Copy link
Member Author

Choose a reason for hiding this comment

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

ack. I promise to fix this asap, but I need to get this in for the 11/11 cut.

Thanks for the flexibility.

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.

More pylint errors to clean up

@@ -168,7 +168,7 @@ def _deploy_arm_template_core(resource_group_name, template_file=None, template_
parameters = json.loads(parameters)
if parameters:
parameters = parameters.get('parameters', parameters)

Copy link
Contributor

Choose a reason for hiding this comment

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

this change is unnecessary and might well cause a pylint errir

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.

@@ -79,6 +79,8 @@ def get_vm_size_completion_list(prefix, action, parsed_args, **kwargs):#pylint:
register_cli_argument('acs', 'container_service_name', options_list=('--name', '-n'), help='The name of the container service', completer=get_resource_name_completion_list('Microsoft.ContainerService/ContainerServices'))
register_cli_argument('acs create', 'agent_vm_size', completer=get_vm_size_completion_list)
register_cli_argument('acs scale', 'new_agent_count', type=int, help='The number of agents for the cluster')
register_cli_argument('acs create', 'service_principal', help='Service principal for making calls into Azure APIs')
register_cli_argument('acs create', 'client_secret', help='Client secret to use with the service principal for making calls to Azure APIs')
Copy link
Contributor

Choose a reason for hiding this comment

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

For your consideration, azure-cli commands use password terminology across for this concept. For consistency I would suggest you use the password here. Both terminologies are correct, but have used at different layers.
At this point it is your call, because you have to update related method as well

@yugangw-msft
Copy link
Contributor

yugangw-msft commented Nov 8, 2016

@brendandburns , other than pylint error, you should take a look at the test failure of acs create particularly the command no longer return the 3 pieces of information to user such as masterFQDN, agentFQDN, and ssh command. So you probably should incorporate the output artifacts from the quick start template. Please chat with @sauryadas for more context

@brendandburns
Copy link
Member Author

@yugangw-msft I actually see that output in the example output that the JMESPath assertion is testing. I'm really not certain why the query isn't picking it up.

Is there a quick way to just run that one test?

Thanks
--brendan

@yugangw-msft
Copy link
Contributor

yugangw-msft commented Nov 8, 2016

@brendandburns, can you paste the output of the create ?
I know the cause, please refer to my later comment below

@yugangw-msft
Copy link
Contributor

yugangw-msft commented Nov 8, 2016

@brendandburns, yes you can run that test:

python -m unittest azure.cli.command_modules.vm.tests.test_vm_commands.AzureContainerServiceScenarioTest.test_acs_create_update 

and to fix the test (assume you have communicated with @sauryadas), is to use fully qualified property path such as properties.outputs.masterFQDN.value. The reason for the change is the command now outputs the full blown object, rather the old customized slimmed down version

@yugangw-msft
Copy link
Contributor

@brendandburns,
For JMESPATH in test, please ensure to point to "properties.outputs.masterFQDN.value"
For pylints error on using print, you should put ‘from future import print_function’ at the top

@brendandburns brendandburns force-pushed the download-k8s-2 branch 2 times, most recently from 1a41ffd to de94d0e Compare November 9, 2016 22:30
@derekbekoe
Copy link
Member

derekbekoe commented Nov 9, 2016

PR #1059 has been merged so a rebase will be required with a couple of changes to the acs/commands.py and vm/commands.py files.

Changes required in acs/commands.py:

  • Remove the from .custom (...) import statements.
  • Change command registration (see snippets)
cli_command('acs create', acs_create)
cli_command('acs kubernetes install-cli', k8s_install_cli)
cli_command('acs kubernetes get-credentials', acs_get_credentials)

Would change to:

cli_command(__name__, 'acs create', 'azure.cli.command_modules.acs.custom#acs_create')
cli_command(__name__, 'acs kubernetes install-cli', 'azure.cli.command_modules.acs.custom#k8s_install_cli')
cli_command(__name__, 'acs kubernetes get-credentials', 'azure.cli.command_modules.acs.custom#get')

Changes required for the vm/commands.py conflict:

  • Remove the registration of the acs create command from this file.
  • In vm/_client_factory.py, remove the method cf_acs_create()

@brendandburns
Copy link
Member Author

@derekbekoe yep, I made that refactor, ptal.

thanks!
--brendan

@brendandburns brendandburns force-pushed the download-k8s-2 branch 5 times, most recently from aeb5496 to 1038577 Compare November 10, 2016 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants