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 acs module support for version 2017-07-01 #4010

Merged
merged 19 commits into from
Jul 13, 2017
Merged

Conversation

rjtsdl
Copy link
Contributor

@rjtsdl rjtsdl commented Jul 12, 2017


This checklist is used to make sure that common guidelines for a pull request are followed.

General Guidelines

  • The PR has modified HISTORY.rst with an appropriate description of the change (see Modifying change log).

Command Guidelines

  • Each command and parameter has a meaningful description.
  • Each new command has a test.

(see Authoring Command Modules)

TODO list

  • Test Recording files to be generated
  • Add help message for using multiple agentpool

@msftclas
Copy link

@rjtsdl,
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot

@rjtsdl rjtsdl changed the title Add acs module support for version 2017-07-01 [WIP] Add acs module support for version 2017-07-01 Jul 12, 2017
@rjtsdl rjtsdl changed the title [WIP] Add acs module support for version 2017-07-01 [WIP]: Add acs module support for version 2017-07-01 Jul 12, 2017
@rjtsdl rjtsdl force-pushed the jiren-dev branch 4 times, most recently from 0770598 to 920a8b1 Compare July 12, 2017 23:33
@RoleBasedServicePrincipalPreparer()
def test_acs_create_kubernetes(self, resource_group, sp_name, sp_password):
acs_name = self.create_random_name('cliacstest', 16)
acs_name = self.create_random_name('acs', 14)
ssh_pubkey_file = self.generate_ssh_keys().replace('\\', '\\\\')
cmd = 'acs create -g {} -n {} --orchestrator-type Kubernetes --service-principal {} ' \
'--client-secret {} --ssh-key-value {}'
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 was trying to add more tests.
After a second thought, the tests i want to add are more about the version 2017-07-01. It is not available everywhere now. So the test would be a bit weird.

I will defer the tests work for now.

@rjtsdl
Copy link
Contributor Author

rjtsdl commented Jul 12, 2017

@brendandburns @anhowe, PTAL

@rjtsdl rjtsdl changed the title [WIP]: Add acs module support for version 2017-07-01 Add acs module support for version 2017-07-01 Jul 12, 2017
* api version 2017-07-01 support
* update dcos and swarm to use latest api version instead of 2016-03-30
* major refactoring

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Highlight the changes.

Copy link
Member

Choose a reason for hiding this comment

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

'Major refactoring' isn't useful for the end-user.
If you can expand on that on any changes that affect your commands (what an end-user will see), please include that; otherwise I'd remove this line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Make sense. I will remove the line.

* api version 2017-07-01 support
* update dcos and swarm to use latest api version instead of 2016-03-30
* major refactoring

Copy link
Member

Choose a reason for hiding this comment

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

'Major refactoring' isn't useful for the end-user.
If you can expand on that on any changes that affect your commands (what an end-user will see), please include that; otherwise I'd remove this line.

- name: Create a Kubernetes cluster with ssh key provided
text: az acs create --orchestrator-type Kubernetes -g <resource_group_name> -n <acs_cluster_name> --ssh-key-value <ssh_key_value_or_path>
- name: Create a acs cluster with two agent pools
text: az acs create -g <resource_group_name> -n <acs_cluster_name> --agent-profiles "[{'name':'agentpool1'},{'name':'agentpool2'}]"
Copy link
Member

Choose a reason for hiding this comment

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

<resource_group_name> -> MyResourceGroup
e.g. https://docs.microsoft.com/en-us/cli/azure/acs#create

Same with the other params here.

I think docs prefer that format as it can then be used directly whereas the angle brackets probably wouldn't be accepted by the service.

:param background: True if command should be run in the foreground,
false to run it in a separate thread
:param background: True to run it in a separate thread,
False should be run in the foreground
:type command: Boolean
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The comment doesn't make sense to me. So i correct it. PTAL

@brendandburns
Copy link
Member

LGTM. I defer to @derekbekoe for final approval.

@rjtsdl
Copy link
Contributor Author

rjtsdl commented Jul 13, 2017

@derekbekoe, here is the error of pr test failure. Only for python 2.7 one. The other two passed.
The error seems not from this module. It is from azure-cli-core. Do you know how can i make the pr test pass?

Run pylint
Modules: azure-cli-core, azure-cli-testsdk, azure-cli, acr, acs, appservice, batch, billing, cdn, cloud, cognitiveservices, component, configure, consumption, cosmosdb, dla, dls, feedback, find, interactive, iot, keyvault, lab, monitor, network, profile, rdbms, redis, resource, role, sf, sql, storage, taskhelp, vm
Telemetry upload begins
Traceback (most recent call last):
  File "/home/travis/build/Azure/azure-cli/src/azure-cli-core/azure/cli/core/telemetry_upload.py", line 68, in <module>
    upload(sys.argv[1])
  File "/home/travis/build/Azure/azure-cli/src/azure-cli-core/azure/cli/core/decorators.py", line 86, in _wrapped_func
    raise ex
TypeError: can't multiply sequence by non-int of type 'str'
************* Module azure.cli.command_modules.acs.custom
E:633, 0: invalid syntax (<string>, line 633) (syntax-error)

@rjtsdl
Copy link
Contributor Author

rjtsdl commented Jul 13, 2017

I fix a place where i use some python 3.0+ supported syntax. It probably related to the error above. I am still confused by the error message though.

@codecov-io
Copy link

codecov-io commented Jul 13, 2017

Codecov Report

Merging #4010 into master will decrease coverage by 0.01%.
The diff coverage is 70.31%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #4010      +/-   ##
=========================================
- Coverage   70.51%   70.5%   -0.02%     
=========================================
  Files         428     428              
  Lines       27559   27609      +50     
  Branches     4218    4229      +11     
=========================================
+ Hits        19433   19465      +32     
- Misses       6873    6883      +10     
- Partials     1253    1261       +8
Impacted Files Coverage Δ
...li-acs/azure/cli/command_modules/acs/acs_client.py 46.72% <ø> (ø) ⬆️
...ure-cli-acs/azure/cli/command_modules/acs/_help.py 100% <100%> (ø) ⬆️
...e-cli-acs/azure/cli/command_modules/acs/_params.py 75.71% <100%> (+6.07%) ⬆️
...i-acs/azure/cli/command_modules/acs/_validators.py 40% <50%> (+0.71%) ⬆️
...re-cli-acs/azure/cli/command_modules/acs/custom.py 43.24% <60.86%> (+0.33%) ⬆️

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 9eb33c1...9fac6cd. Read the comment docs.

@rjtsdl
Copy link
Contributor Author

rjtsdl commented Jul 13, 2017

@derekbekoe , how can i get write access? Not able to merge :(
Or you can help me merge :)

@derekbekoe derekbekoe merged commit 2a59cee into Azure:master Jul 13, 2017
@rjtsdl rjtsdl deleted the jiren-dev branch July 13, 2017 17:48
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.

6 participants