-
Notifications
You must be signed in to change notification settings - Fork 459
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
Support bundle upload #3356
Support bundle upload #3356
Conversation
…t-bundle_upload
…t-bundle_upload
edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Core/logs/ILogsUploader.cs
Outdated
Show resolved
Hide resolved
public Option<string> Since { get; } | ||
|
||
[JsonProperty("iothubHostname")] | ||
public Option<string> IothubHostname { get; } |
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.
How is this used?
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.
iotedge check has it as an option, so the support bundle does too
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.
What happens if a user specifies a different IoTHub?
I think this parameter definitely seems odd - I would say remove it and use the IOTHub that EdgeAgent is using.
@veyalla ?
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.
Using IoT Hub that edge agent is using would actually be an improvement over running support-bundle locally because currently we cannot run any connectivity tests when using DPS because we can't get the iot hub name from config yaml. The recommendation for DPS-provisioned devices is to use the command line parameter to explicitly specify iot hub name which is behavior the direct method is implementing.
However, it would cause inconsistent behavior for the same command when run locally vs remotely which is weird. There was some thoughts from @arsing around getting the iot hub name from a cached provisioning result when run locally on a DPS provisioned device. If that can be implemented we could have a consistent experience.
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.
provisioning_backup.json
has the hub name, so iotedge check
/ support-bundle
could read it from there.
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.
(If you do make that change, you'll probably want to keep the --iothub-hostname
parameter to check
/ support-bundle
so that passing it is not an error, such as when running old EA with new host package.)
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.
IMO, we should make the change Arnav is suggesting, it will improve troubleshooting experience for customers running check / support-bundle locally and also provide consistency when running it locally or remotely. Thoughts @CindyXing ?
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.
Yes, wherever we can infer the IoThub, we should I can't think of a scenario where support bundle or iotedge check would need to talk to a different IoTHub.
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.
So for this pr, I'll remove the iothubHostname param, and just fill it in from ea's known hostname
|
||
public class SupportBundleRequestHandler : RequestHandlerBase<SupportBundleRequest, TaskStatusResponse> | ||
{ | ||
public delegate Task<Stream> GetSupportBundle(Option<string> since, Option<string> iothubHostname, Option<bool> edgeRuntimeOnly, CancellationToken token); |
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.
Instead of a delegate seems like an Interface might be cleaner?
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.
I'm not sure which interface I would use, but a delegate seemed like an clean way to pass a single function in. I've used this pattern before in the code base.
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.
One question, otherwise the .NET code LGTM
edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Edgelet/ModuleManagementHttpClient.cs
Outdated
Show resolved
Hide resolved
{ | ||
this.Enabled = enabled; | ||
this.DisableCloudSubscriptions = disableCloudSubscriptions; | ||
this.EnableUploadLogs = enableUploadLogs; | ||
this.EnableGetLogs = enableGetLogs; | ||
this.EnableUploadSupportBundle = enableUploadSupportBundle; |
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.
So, in 1.0.10, we'll keep this and uploadlogs, getlogs as experimental features?
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 plan is to move at least get and upload logs out of experimental for 1.10, this will probably stay in experimental
* Rename logs => module logs * make handler classes * include new dm * chkpnt * start able to write to in memory * fix types * output to console * fix flags * start able to write to in memory * fix types * output to console * fix flags * re-enable tests * import zip module and use display * use --output - for stdout * call support bundle * parse params * add new api version * reuse http client * flesh out request * make logs uploader more generic * fix merge issue * bring in api changes * fix version * add get_result * move support bundle logic to own file * remove s * collect bundle * wrap read in body * return support bundle size * send full sb * fix fileResponse * read params * parse_since * pass hostname * clippy * re-enable first test * add logs test back * rename ILogsUPloader file to IRequestsUploader * remove unused IDisposable * get iothub hostname from edgeAgent Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
* Rename logs => module logs * make handler classes * include new dm * chkpnt * start able to write to in memory * fix types * output to console * fix flags * start able to write to in memory * fix types * output to console * fix flags * re-enable tests * import zip module and use display * use --output - for stdout * call support bundle * parse params * add new api version * reuse http client * flesh out request * make logs uploader more generic * fix merge issue * bring in api changes * fix version * add get_result * move support bundle logic to own file * remove s * collect bundle * wrap read in body * return support bundle size * send full sb * fix fileResponse * read params * parse_since * pass hostname * clippy * re-enable first test * add logs test back * rename ILogsUPloader file to IRequestsUploader * remove unused IDisposable * get iothub hostname from edgeAgent Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This allows the support bundle to be uploaded in a similar matter to the built in logs upload. Currently the support bundle is held in memory while it is streamed to the cloud, but is architectured such that it can be stored and streamed from a file on disk in the future.
C# Changes
Rust Changes
Note: The 2020-07-07 mgmt api version is brand new, and these additions are planned.