aws / aws-tools-for-powershell

The AWS Tools for PowerShell lets developers and administrators manage their AWS services from the PowerShell scripting environment.
Apache License 2.0
236 stars 78 forks source link

AWS.Tools.Common gets installed with each module #88

Closed bkolodny closed 4 years ago

bkolodny commented 4 years ago

When running Install-AWSToolsModule or Update-AWSToolsModule AWS.Tools.Common gets installed with each module install or update.

Expected Behavior

AWS.Tools.Common should only be installed or updated once. After that, there should be a check to see if it's at the correct version and installed before installing or updating it.

Current Behavior

When running Install-AWSToolsModule or Update-AWSToolsModule AWS.Tools.Common gets installed with each module install or update. So if I have 50 modules to update, it will install AWS.Tools.Common 50 times, for a total of 100 install actions.

Steps to Reproduce (for bugs)

Update-AWSToolsModule

Context

It takes hours to update the AWS.Tools modules on my computer.

Your Environment

Include as many relevant details about the environment where the bug was discovered.

tlindsay42 commented 4 years ago

Tagging #73 per Context

matteo-prosperi commented 4 years ago

Hello, thanks for opening this issue. Which version of AWS.Tools.Installer are you using? I am using 1.0.0.0 on my machine and I don't experience multiple installations of AWS.Tools.Common. These are the relevant parts of the verbose logs on my machine.

PS> Update-AWSToolsModule -Verbose
VERBOSE: [Update-AWSToolsModule] ConfirmPreference=High WhatIfPreference=False VerbosePreference=Continue Force=False
...
VERBOSE: [Update-AWSToolsModule] Found modules AWS.Tools.Common, AWS.Tools.EC2, AWS.Tools.S3
...
Installing AWS Tools version 4.0.1.1
...
VERBOSE: [Install-AWSToolsModule] Downloading modules to temporary repository
...
VERBOSE: [Save-AWSToolsModule] Downloading module AWS.Tools.Common to ...
VERBOSE: GET https://www.powershellgallery.com/api/v2/package/AWS.Tools.Common/4.0.1.1 with 0-byte payload
...
VERBOSE: [Save-AWSToolsModule] Downloading module AWS.Tools.EC2 to ...
VERBOSE: GET https://www.powershellgallery.com/api/v2/package/AWS.Tools.EC2/4.0.1.1 with 0-byte payload
...
VERBOSE: [Save-AWSToolsModule] Found dependency AWS.Tools.Common
...
VERBOSE: [Save-AWSToolsModule] Downloading module AWS.Tools.S3 to ...
VERBOSE: GET https://www.powershellgallery.com/api/v2/package/AWS.Tools.S3/4.0.1.1 with 0-byte payload
...
VERBOSE: [Save-AWSToolsModule] Found dependency AWS.Tools.Common
VERBOSE: [Save-AWSToolsModule] ConfirmPreference=None WhatIfPreference=False 
...
VERBOSE: [Install-AWSToolsModule] Installing modules
Installing module AWS.Tools.Common version 4.0.1.1
Installing module AWS.Tools.EC2 version 4.0.1.1
Installing module AWS.Tools.S3 version 4.0.1.1
VERBOSE: [Install-AWSToolsModule] Modules install complete
...

As you can see AWS.Tools.Common is only downloaded and installed once.

Apart from the issue of multiple installations of AWS.Tools.Common, Update-AWSToolsModule and Install-AWSToolsModule are definitely slower than we would like. We will work to improve performances where possible.

We also don't recommend using AWS.Tools to users who use many different AWS services because Install-Module and Import-Module are much slower working with many small modules than a single large one. So, if you judge that update or import times of AWS.Tools are inadequate for your use case, we recommend to use AWSPowerShell.NetCore instead. AWSPowerShell.NetCore has the same features as AWS.Tools in a single module, so it works best if you plan using many AWS services together.

We will also consider making all the AWS.Tools modules available as a single download, so that they can be downloaded and copied to the module folder quickly as an alternative to using Install-Module.

matteo-prosperi commented 4 years ago

Hello, the latest release of AWS.Tools.Installer has improvements to the installation speed. I think this is close to the fastest we can get while still relying on Install-Module to perform the module installation. Did you have a chance of updating AWS.Tools.Installer and try it?