-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[SerialConsole] Add new extension to support Serial Console #3529
Conversation
Made send nmi/sysrq/reset not use virtual terminal. Reformatted code to improve styling. Now Cli errors are used to report errors. When configuring terminal, errors reporting is improved.
Now a resource is checked to see whether it exists, it is running, and custom boot diagnostics is enabled, all before a call to the serial console resource provider is made.
Now AzureConnectionError is used and serial console can be launched as long as VM is not deallocating or deallocated.
Testing for sending SysRq and NMI to VM's
Modified previous tests and added tests for VMSS's
Loading bug where pressing enter while loading would attempt to make a new connection to the serial console is now fixed. Also now check the OS version of the connected VM and change the loading screen if it is Windows and remove the SysRq option.
Now SysRq checks to make sure the connection is to a Linux VM. Removed unnecessary storage create command from tests.
Changed parts of check resource to fix some edge case errors
Fixed problem were testing would fail for reset vm command. Updated test recording files, readme, metedata to remove upper cli version limit, and fixed style in some files.
Added dependencies and changed readme file location
…into serialconsole-dev
Thank you for your contribution adrianabedon! We will review the pull request and get back to you soon. |
SerialConsole |
These commands enable or disable serial console across a subscription. Also updated help docs, README, and tests for new commands.
import numpy # pylint: disable=unused-import | ||
import wsaccel # pylint: disable=unused-import |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you use these library?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The websocket client recommended that numpy and wsaccel be imported to improve the speed of sending data. However, this advice has changed in the last couple of weeks and now only wsaccel is recommended. I will remove the numpy import.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, upon further investigation, wsaccel is not needed if utf8 validation is disabled. I will remove it as well.
self.webSocket = None | ||
self.terminalInstance = None | ||
self.serialConsoleInstance = None | ||
self.terminatingApp = False | ||
self.loading = True | ||
self.firstMessage = True | ||
self.blockPrint = False | ||
self.trycount = 0 | ||
self.OSIsWindows = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should use snake case instead of camel case for the names of property, variable and function in python. #Resolved
Code no longer needs numpy/wsaccel dependecy to run quickly so they were removed.
|
||
|
||
ARM_ENDPOINT = "https://management.azure.com" | ||
RP_PROVIDER = "Microsoft.SerialConsole" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ARM ENDPOINT will be changed when the could is switched. So this value should be read from cli_ctx.cloud
property. It's defined here https://github.com/Azure/azure-cli/blob/3feea02888ea67f033f407174a3a7a340158b81a/src/azure-cli-core/azure/cli/core/cloud.py#L297-L332
This client code was generated using the autorest.az code generator. Some small changes to error checking and messaging.
No longer need custom boot diagnostics for VM. Changed testing to reflect changes.
The Cli would automatically initialize colorama breaking a lot of the Virtual Terminal Sequences that were used in the program
@adrianabedon Please let me know when it's ready to release. |
add serial-console extension
Cli commands:
az serial-console connect
az serial-console send nmi/sysrq/reset
This checklist is used to make sure that common guidelines for a pull request are followed.
General Guidelines
azdev style <YOUR_EXT>
locally? (pip install azdev
required)python scripts/ci/test_index.py -q
locally?For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your PR is merged into master branch, a new PR will be created to update
src/index.json
automatically.The precondition is to put your code inside this repo and upgrade the version in the PR but do not modify
src/index.json
.