puppetlabs / puppet-dev-tools

Puppet development tools in a Docker image
Apache License 2.0
12 stars 25 forks source link

Why external Ruby? #7

Open TJM opened 5 years ago

TJM commented 5 years ago

Why are we installing external ruby, when PDK comes with its own embedded Ruby, probably with most the needed components already? Ideally, the gems that we are using would be part of PDK anyhow. (eventually)

ccaum commented 5 years ago

The Rakefile included in this image doesn't use the PDK Ruby. PDK can include multiple Rubies and we need one set one to use for the non-PDK content in the image.

TJM commented 5 years ago

Can we not just pick one (most recent) included in the PDK? As I noted, "ideally the gems we are using would be part of PDK anyhow" ... but if they are not, they could easily be added just like they are added to the SCL Ruby, right?

TJM commented 5 years ago

I have made some effort on this. I have been trying to "trick" PDK into installing the extra gems, but it then tries to install a newer version of puppet which requires ffi (native) and that means I need a bunch of development tools again.

I had a process to create a simple test module, add a .sync.yml to it then run pdk update, but if I can't remove all the compilers and nonsense, then it defeats the purpose. I was able to strip out ~280MB by removing all that stuff, but then ran into the issue above that I am trying to sort through.

Gemfile:
  required:
    ':development':
      - gem: onceover
      - gem: ra10ke
TJM commented 5 years ago

Maybe the tools required are more intense, but we could try doing like they have done here to install gems into the PDK ruby: https://github.com/puppetlabs/pdk-docker/blob/fcaf898d166316e9a2623f7f50066fb62101e3e9/Dockerfile#L16-L17

Haven't put any effort into testing this yet, but just noticed it the other day in the PDK Dockerfile :)

genebean commented 4 years ago

This looks interesting to me... I may give it a try in my fork tomorrow.

ccaum commented 3 years ago

Did you end up trying this, @genebean? If we can remove the system ruby, we could shrink the size of the image considerably.

genebean commented 3 years ago

I did not but am happy to revisit

TJM commented 3 years ago

I haven't looked at this for over a year, but I would still like to reduce the size of this image, if possible.

EDIT ... if possible, without creating a complete nightmare to support ;)