Jira (PUP-10268) Investigate what would mean to have semantic versions for Package Resource

15 views
Skip to first unread message

Mihai Buzgau (JIRA)

unread,
Feb 5, 2020, 6:08:04 AM2/5/20
to puppe...@googlegroups.com
Mihai Buzgau created an issue
 
Puppet / Task PUP-10268
Investigate what would mean to have semantic versions for Package Resource
Issue Type: Task Task
Assignee: Unassigned
Created: 2020/02/05 3:07 AM
Priority: Normal Normal
Reporter: Mihai Buzgau
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Gabriel Nagy (JIRA)

unread,
Feb 13, 2020, 4:27:05 AM2/13/20
to puppe...@googlegroups.com

Gabriel Nagy (JIRA)

unread,
Feb 13, 2020, 10:43:03 AM2/13/20
to puppe...@googlegroups.com
Gabriel Nagy commented on Task PUP-10268
 
Re: Investigate what would mean to have semantic versions for Package Resource
  • SemanticPuppet::Version and SemanticPuppet::VersionRange are implemented in puppet (ruby)
  • their counterparts: SemVer[], and SemVerRange() are implemented as types in the puppet language
  • a semver range can be passed into a package resource...

package { 'mc':
  ensure => SemVerRange('>= 1.0.0 <2.0.0'),
}

  • ...but has to be handled in each provider separately:

if @resource.should(:ensure).is_a?(SemanticPuppet::VersionRange)
  # do stuff
  range = @resource.should(:ensure)
end

2.6.3 :001 > require 'puppet'
 => true
2.6.3 :002 > version = SemanticPuppet::Version.parse('0.9.1')
2.6.3 :003 > range = SemanticPuppet::VersionRange.parse(">=1.0.0 <2.0.0")
2.6.3 :004 > version
 => 0.9.1 
2.6.3 :005 > range
 => >=1.0.0 <2.0.0 
2.6.3 :006 > range.include?(version)
 => false 

  • for each provider we have to keep a list of possible versions for each package
  • e.g. gem:

    $ gem search --all --exact irb
    irb (1.2.1, 1.2.0, 1.1.1, 1.1.0, 1.0.0, 0.9.6)
    

  • sort the versions in descending order (newest first) and install the first one that conforms to the SemVerRange

Gabriel Nagy (JIRA)

unread,
Feb 17, 2020, 7:39:05 AM2/17/20
to puppe...@googlegroups.com
Gabriel Nagy commented on Task PUP-10268

versionable package providers:

  • apt

  • gem
  • pip

  • rpm
  • yum
  • dnf
  • zypper

    apt

  • ranges cannot be specified in install command
  • have to list all available versions then install a specific version:

    root@fractional-bard:~# apt-cache policy puppet-agent
    puppet-agent:
      Installed: (none)
      Candidate: 6.12.0-1buster
      Version table:
         6.8.0-1buster 500
            500 http://apt.puppetlabs.com buster/puppet amd64 Packages
         6.4.5-1buster 500
            500 http://apt.puppetlabs.com buster/puppet amd64 Packages
         6.4.4-1buster 500
            500 http://apt.puppetlabs.com buster/puppet amd64 Packages
    

    apt-get install puppet-agent=6.4.4-1buster

    yum

  • ranges cannot be specified in install command
  • have to list all available versions then install a specific version:

    [root@tired-vellum ~]# yum -d 0 --showduplicates list puppet-agent
    Available Packages
    puppet-agent.x86_64   6.10.1-1.el8    puppet        
    puppet-agent.x86_64   6.11.0-1.el8    puppet        
    puppet-agent.x86_64   6.11.1-1.el8    puppet        
    puppet-agent.x86_64   6.12.0-1.el8    puppet        
    

    yum install puppet-agent-6.12.0-1.el8

    gem

  • version ranges can be specified in the install command:

    $ gem install rake -v ">10.5.0, < 13.0.0"
    Successfully installed rake-12.3.3
    Parsing documentation for rake-12.3.3
    Installing ri documentation for rake-12.3.3
    Done installing documentation for rake after 1 seconds
    1 gem installed
    

    pip

  • version ranges can be specified in the install command:

    $ pip install "flask>0.9,<=1.0
    Collecting flask<=1.0,>0.9
      Downloading Flask-1.0-py2.py3-none-any.whl (97 kB)
         |████████████████████████████████| 97 kB 773 kB/s 
    Requirement already satisfied: Werkzeug>=0.14 in ./lib/python3.8/site-packages (from flask<=1.0,>0.9) (0.16.1)
    Requirement already satisfied: itsdangerous>=0.24 in ./lib/python3.8/site-packages (from flask<=1.0,>0.9) (1.1.0)
    Requirement already satisfied: click>=5.1 in ./lib/python3.8/site-packages (from flask<=1.0,>0.9) (7.0)
    Requirement already satisfied: Jinja2>=2.10 in ./lib/python3.8/site-packages (from flask<=1.0,>0.9) (2.11.1)
    Requirement already satisfied: MarkupSafe>=0.23 in ./lib/python3.8/site-packages (from Jinja2>=2.10->flask<=1.0,>0.9) (1.1.1)
    Installing collected packages: flask
    Successfully installed flask-1.0
    

Tara Krishnan (JIRA)

unread,
Feb 18, 2020, 1:57:05 PM2/18/20
to puppe...@googlegroups.com

Sara Meisburger are there other package providers which should be included on this list? 

Tara Krishnan (JIRA)

unread,
Feb 20, 2020, 1:12:05 PM2/20/20
to puppe...@googlegroups.com
Tara Krishnan updated an issue
 
Change By: Tara Krishnan
Comment: [~sara] are there other package providers which should be included on this list? 

Tara Krishnan (JIRA)

unread,
Feb 20, 2020, 1:16:04 PM2/20/20
to puppe...@googlegroups.com
 
Re: Investigate what would mean to have semantic versions for Package Resource

Josh Cooper do you think other package managers should be added to this list? 

Josh Cooper (JIRA)

unread,
Feb 20, 2020, 2:24:09 PM2/20/20
to puppe...@googlegroups.com
Josh Cooper commented on Task PUP-10268

Seems like a good list for now. Will dnf, pip3 and puppet_gem also gain this ability since they inherit from yum, pip and gem respectively?

Melissa Stone (Jira)

unread,
Mar 11, 2020, 2:45:04 PM3/11/20
to puppe...@googlegroups.com

I didn't see this anywhere, but how often are we going to refresh the list of package versions that are available? If we do that every puppet run, that's not an insignificant use of resources. Are we going to make sure the latest package available that satisfies the version range is installed? Or as long as the installed package satisfies the version range, will we bother updating the list of available package versions? Will that behavior be consistent across package providers, or will each provider do that differently? These would be good questions to answer in the acceptance criteria for this work.

This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages