Code Monkey home page Code Monkey logo

Comments (11)

electrical avatar electrical commented on May 27, 2024

hi,

the container always needs to be destroyed but the image can be preserved by enabling this option ( see example in my nodeset configs )
https://github.com/elasticsearch/puppet-elasticsearch/blob/master/spec/acceptance/nodesets/centos-6-x64.yml#L14

from beaker.

leoc avatar leoc commented on May 27, 2024

Alright, thank you. I added this to the wiki.

Still, when I use that command and remove the BEAKER env variables beaker seems to run the following commands every run.

apt-get update
apt-get install --force-yes  -y curl
apt-get install --force-yes  -y ntpdate
apt-get install --force-yes  -y lsb-release

Shouldn't that be part of the image creation process, which should only run once unless/until I delete the image? Or might that be some problem with my projects spec_helper_acceptance.rb? It looks like that:

require 'beaker-rspec'
require 'pry'

hosts.each do |host|
  # install_package host, 'rubygems'
  # on host, 'DEBIAN_FRONTEND=noninteractive apt-get install --yes -q openssl libssl-dev'
  # on host, 'gem install puppet --no-ri --no-rdoc'
  on host, "mkdir -p #{host['distmoduledir']}"
end

RSpec.configure do |c|
  # Project root
  proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))

  # Readable test descriptions
  c.formatter = :documentation

  # Configure all nodes in nodeset
  c.before :suite do
    # Install module
    puppet_module_install(:source => proj_root, :module_name => 'puma')
  end
end

from beaker.

electrical avatar electrical commented on May 27, 2024

Hi,

Things that should in the image you can do with this:
https://github.com/elasticsearch/puppet-elasticsearch/blob/master/spec/acceptance/nodesets/centos-6-x64.yml#L11-L13

from beaker.

leoc avatar leoc commented on May 27, 2024

I know that. I am just wondering, why every run of the rake task is executing:

apt-get update
apt-get install --force-yes  -y curl
apt-get install --force-yes  -y ntpdate
apt-get install --force-yes  -y lsb-release

Those have not been defined by my projects configuration. Or so I suppose. :-)
And I think they should not be run by beaker but by the image creation process. Isn't it?
(At least when using the docker hypervisor)

from beaker.

electrical avatar electrical commented on May 27, 2024

Ah, those are in beaker it self in the pre-build steps.
That's to ensure that they will be installed no matter what.

from beaker.

electrical avatar electrical commented on May 27, 2024

See https://github.com/puppetlabs/beaker/blob/master/lib/beaker/host_prebuilt_steps.rb#L13-L16

from beaker.

leoc avatar leoc commented on May 27, 2024

Ah! I understand.

As I am not into the beaker development (yet :-).
What do you think about moving those concerns into the docker image creation process when using docker?

I'd love to create a pull request. My solution would be to not install the packages from the prebuilt steps when using docker and just adding the needed packages to https://github.com/puppetlabs/beaker/blob/master/lib/beaker/hypervisor/docker.rb#L96
Do you have any hints on that?

I think this would speed up the execution of specs tremendously.

from beaker.

leoc avatar leoc commented on May 27, 2024

I looked again. The validate_host method does check whether a package is installed.
So I think installing those packages per default in beakers docker code would suffice.
I will have a try and request a pull.

Thank you for your help on this. 👍

from beaker.

electrical avatar electrical commented on May 27, 2024

Hi,

The packages are setup by default unrelated to which hyper-visor you use.
This is to ensure that the required packages are installed even if the base image that is used have it installed or not.
I doubt it will have much use to send a PR for this to be very honest.

from beaker.

leoc avatar leoc commented on May 27, 2024

Hi again,

As far as I can see those packages are mandatory, as are the packages here:
https://github.com/puppetlabs/beaker/blob/master/lib/beaker/hypervisor/docker.rb#L115

Beaker always creates a new image; installing openssh. Why not simply install those packages there too?
It speeds up the execution and one does not have to add those packages to the projects host config manually.
And it would not break other hypervisors.

from beaker.

electrical avatar electrical commented on May 27, 2024

Hi,

Sorry that i miss understood you.
Yeah it makes sense to put them in that step.
I've put them in my nodeset files.

from beaker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.