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

macOS PE tarballs include arch now #1747

Merged
merged 1 commit into from
Jul 27, 2022

Conversation

joshcooper
Copy link
Contributor

Assume PE tarballs for macOS include the architecture unless it's an older agent
version. This fixes an issue when beaker-pe tries to fetch the tarball from the
PE server.

Assume PE tarballs for macOS include the architecture unless it's an older agent
version. This fixes an issue when beaker-pe tries to fetch the tarball from the
PE server.
@codecov
Copy link

codecov bot commented Jul 25, 2022

Codecov Report

Merging #1747 (52b426b) into master (95b4d76) will decrease coverage by 0.04%.
The diff coverage is 0.00%.

❗ Current head 52b426b differs from pull request most recent head 0008b7f. Consider uploading reports for the commit 0008b7f to get more accurate results

@@            Coverage Diff             @@
##           master    #1747      +/-   ##
==========================================
- Coverage   74.89%   74.85%   -0.05%     
==========================================
  Files          82       82              
  Lines        4868     4871       +3     
==========================================
  Hits         3646     3646              
- Misses       1222     1225       +3     
Impacted Files Coverage Δ
lib/beaker/host/mac/pkg.rb 53.84% <0.00%> (-3.30%) ⬇️

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 95b4d76...0008b7f. Read the comment docs.

@joshcooper
Copy link
Contributor Author

@joshcooper
Copy link
Contributor Author

To verify using beaker-pe

$ cd ~/work/beaker-pe
$ export BEAKER_VERSION=file:///home/josh/work/beaker
$ bundle update
...
Using beaker 4.37.0 from source at `/home/josh/work/beaker` and installing its executables
...
$ cat <<END > hosts.cfg
---
HOSTS:
  centos7-64-1:
    pe_dir: https://artifactory.delivery.puppetlabs.net/artifactory/generic_enterprise__local/main/ci-ready
    pe_ver: 2021.7.0-rc5-7-g8761c79
    platform: el-7-x86_64
    hypervisor: abs
    template: centos-7-x86_64
    roles:
    - agent
    - master
    - database
    - dashboard
  osx1015-64-1:
    pe_dir: https://artifactory.delivery.puppetlabs.net/artifactory/generic_enterprise__local/main/ci-ready
    pe_ver: 2021.7.0-rc5-7-g8761c79
    platform: osx-10.15-x86_64
    template: osx-1015-x86_64
    hypervisor: abs
    roles:
    - agent
CONFIG:
  nfs_server: none
  consoleport: 443
END
$ bundle exec beaker init --xml --debug --repo-proxy --hosts hosts.cfg --type foss --tests acceptance/tests --pre-suite acceptance/pre_suite/install.rb --load-path acceptance/lib
$ bundle exec beaker provision
$ bundle exec beaker exec
...
Fetching: https://pm.puppet.com/puppet-agent/2021.7.0-rc5-7-g8761c79/7.18.0/repos/puppet-agent-osx-10.15-x86_64.tar.gz
...

@joshcooper
Copy link
Contributor Author

In cases where puppet_agent_version is not defined, beaker will lookup the version based on what's installed on the PE server:

Warning: No :puppet_agent_version in host xxx or local options. Read puppet-agent version 7.18.0 from master

That works for install, but I need to try an upgrade, e.g. install 7.17.0 and then try to upgrade to 7.18.0

@joshcooper
Copy link
Contributor Author

joshcooper commented Jul 27, 2022

This installed 2019.8.x and upgraded to 2021.7.x

export BEAKER_VERSION=file:///home/josh/work/beaker
bundle install

export pe_ver=2021.7.0-rc5-7-g8761c79
export pe_dir=https://artifactory.delivery.puppetlabs.net/artifactory/generic_enterprise__local/main/ci-ready
export pe_dep_versions=config/versions/pe_version
export pe_upgrade_version=2021.7.0-rc5-11-gda43709
export pe_version=2019.8.12-rc1-133-gcdd63e0

bundle exec beaker-hostgenerator centos7-64mcd-osx12-ARM64fa --hypervisor abs --global-config '{ssh={forward_agent=true},forge_host=api-forge-aio02-petest.puppet.com}' > hosts.yaml
bundle exec beaker init --xml --debug --repo-proxy --hosts hosts.yaml --type pe --tests acceptance/tests --helper lib/beaker_helper.rb --pre-suite setup/install.rb,setup/agent_upgrade.rb --test-tag-exclude pe_infra_only,security
bundle exec beaker provision  
bundle exec beaker exec
...
  * Install agents
    
    pix-arm64-macos12-1.XXX (pix-arm64-macos12-1.XXX) 11:21:42$ FRICTIONLESS_TRACE='true'; export FRICTIONLESS_TRACE; cd /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/2022-07-27_11.16.01.XXXXXX.ZbSjKzSF && curl -O -k https://prim-xenon.delivery.puppetlabs.net:8140/packages/current/install.bash && bash install.bash
        % Total    % Received % Xferd  Average Speed   Time    Time     Tim      e  Current
                                       Dload  Upload   Total   Spent    Left  Speed
        0     0    0     0    0     0            0      0 --:--:-- --:--:-- --:--:--     0      100 26587  100 26587    0     0   214k      0 --:--:-- --:--:-- --:--:--  2      29k
      bulk downloading plugins
      + curl -k -o /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/installer.weDtawQs -L --write-out %{http_code} -s https://prim-xenon.delivery.puppetlabs.net:8140/packages/bulk_pluginsync.tar.gz
      extracting plugins
      + curl -k -o /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/installer.pSD4A5oq -L --write-out %{http_code} -s https://prim-xenon.delivery.puppetlabs.net:8140/packages/2019.8.12-rc1-133-gcdd63e0/osx-12-arm64.bash
      /dev/disk4          	GUID_partition_scheme          	
      /dev/disk4s1        	Apple_APFS                     	
      /dev/disk5          	EF57347C-0000-11AA-AA11-0030654	
      /dev/disk5s1        	41504653-0000-11AA-AA11-0030654	/private/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/puppet-enterprise-installer.w0gjdEXn
      installer: Package name is puppet-agent
      installer: Installing at base path /
      installer: The install was successful.
...
  * Upgrade PE
...
        Notice: /Stage[main]/Pe_repo::Platform::Osx_12_arm64/Pe_repo::Osx[osx-12-arm64]/Pe_repo::Repo[osx-12-arm64 2021.7.0-rc5-11-gda43709]/File[/opt/puppetlabs/server/data/packages/public/2021.7.0-rc5-11-gda43709/osx-12-arm64-7.18.0]/ensure: created
        Notice: /Stage[main]/Pe_repo::Platform::Osx_12_arm64/Pe_repo::Osx[osx-12-arm64]/Pe_repo::Repo[osx-12-arm64 2021.7.0-rc5-11-gda43709]/File[/opt/puppetlabs/server/data/packages/public/2021.7.0-rc5-11-gda43709/osx-12-arm64]/ensure: created
        Notice: /Stage[main]/Pe_repo::Platform::Osx_12_arm64/Pe_repo::Osx[osx-12-arm64]/Pe_repo::Repo[osx-12-arm64 2021.7.0-rc5-11-gda43709]/Pe_staging::Deploy[puppet-agent-osx-12-arm64.tar.gz]/Pe_staging::File[puppet-agent-osx-12-arm64.tar.gz]/Exec[/opt/puppetlabs/server/data/staging/pe_repo-puppet-agent-7.18.0/puppet-agent-osx-12-arm64.tar.gz]/returns: executed successfully
        Notice: /Stage[main]/Pe_repo::Platform::Osx_12_arm64/Pe_repo::Osx[osx-12-arm64]/Pe_repo::Repo[osx-12-arm64 2021.7.0-rc5-11-gda43709]/Pe_staging::Deploy[puppet-agent-osx-12-arm64.tar.gz]/Pe_staging::Extract[puppet-agent-osx-12-arm64.tar.gz]/Exec[extract puppet-agent-osx-12-arm64.tar.gz]/returns: executed successfully (corrective)
...
  * Verify agents upgraded
...
  pix-arm64-macos12-1.XXX (pix-arm64-macos12-1.XXX) 11:37:35$ puppet --version
      7.18.0
  
...
              - Test Case Summary for suite 'tests' -
       Total Suite Time: 218.39 seconds
      Average Test Time: 4.55 seconds
              Attempted: 48
                 Passed: 10
                 Failed: 0
                Errored: 0
                Skipped: 38
                Pending: 0
                  Total: 48


# macOS puppet-agent tarballs haven't always included arch
agent_version = opts[:puppet_agent_version]
download_file = if agent_version && (agent_version.to_f < 6.28 || agent_version.to_f < 7.18)
Copy link
Contributor Author

@joshcooper joshcooper Jul 27, 2022

Choose a reason for hiding this comment

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

From what I can tell, this method is only ever called from beaker-pe and puppet_agent_version is always passed as an option. It starts in beaker-pe, where we call get_puppet_agent_version

That method either raises or returns a non-nil value

Then we call install_puppet_agent_pe_promoted_repo_on

That method is implemented in beaker-puppet Not sure why it's in beaker-puppet (!?)

And that calls Beaker::Host#pe_puppet_agent_promoted_package_info which is the method this PR changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants