puppetlabs / bolt-vanagon

Apache License 2.0
2 stars 31 forks source link

Use Tarball method for MSI based packages #146

Closed jpogran closed 4 years ago

jpogran commented 4 years ago

This PR increases the speed at which Bolt MSI installs complete by using tarballs of the included Ruby gems instead of tracking each file in the MSI table.

Acceptance Criteria:

  1. Install MSI built from this PR on a fresh machine without failure. Run example command
  2. Install MSI built from this PR on a fresh machine without failure. Then uninstall from machine without failure. All files installed should be removed.
  3. Install bolt 2.24.1, then install MSI built from this PR. Product should upgrade without failure. Run example command
  4. Install bolt 2.24.1, then install MSI built from this PR, then uninstall. All files installed should be removed without failure.

Example command: bolt command '$PSVersionTable' -t localhost

Fixes https://github.com/puppetlabs/bolt/issues/2099 https://github.com/puppetlabs/bolt/issues/1177

jpogran commented 4 years ago

Bolt 2.24:

➜ ls "$env:ProgramFiles\Puppet Labs\Bolt" -Dir | %{ $m = gci $_.fullname -rec -for | measure; [pscustomobject]@{ name = $_.name; count = $m.count } }

name    count
----    -----
bin        58
include   138
lib     13129
misc        1
share    7952
ssl        11

New installer:


PS C:\Users\Administrator> ls "$env:ProgramFiles\Puppet Labs\Bolt" | %{ $m = gci $_.fullname -rec -for | measure; [pscustomobject]@{ name = $_.name; count = $m.count } }

name    count
----    -----
bin        58
include   138
lib     13133
misc        1
share    7959
ssl        11
``
jpogran commented 4 years ago

Install times range from 30 seconds to 1 minute for an automated install that has minimal logging. This is an improvement from previous install times of 2-5 minutes.

PS > msiexec /i C:\Users\Administrator\Desktop\puppet-bolt-2.25.0.10.g7b6aac5-x64.msi /q /l log.txt
PS > gc .\log.txt |select -First 1 -Last 1
=== Logging started: 9/2/2020  17:55:06 ===
=== Logging stopped: 9/2/2020  17:55:37 ===
PS > [datetime]"17:55:37" - [datetime]"17:55:06" | select totalseconds,totalmilliseconds
TotalSeconds TotalMilliseconds
------------ -----------------
          31             31000

Upgrades are faster than before, but will still take as long as the previous version to install plus the time for the new version. For example, upgrading from 2.24.1 to this version takes a few minutes

PS > msiexec /i C:\Users\Administrator\Desktop\puppet-bolt-2.25.0.10.g7b6aac5-x64.msi /q /l log.txt
PS > gc .\log.txt |select -First 1 -Last 1
=== Logging started: 9/2/2020  18:17:06 ===
=== Logging stopped: 9/2/2020  18:19:00 ===
PS > [datetime]"18:19:00" - [datetime]"18:17:06" | select totalseconds,totalmilliseconds
TotalSeconds TotalMilliseconds
------------ -----------------
         114            114000

After using bolt to install gems, the user install gems are still present after uninstall. This is expected as they are not tracked by the MSI process. If we want the MSI to delete anything put inside the install directory, that can be done, but should be a new ticket.

jpogran commented 4 years ago

Ran through jenkins, and it succeeded: https://jenkins-master-prod-1.delivery.puppetlabs.net/view/bolt/job/platform_bolt-vanagon_vanagon-suite-init_no-PEZ-daily-main/102/

lucywyman commented 4 years ago

Verified that user-installed gems persist across upgrades, even from versions of Bolt before this change.