Skip to content

Update to latest fog-aws release and bump base64 version#6

Open
MatthewDarling wants to merge 2 commits into
geckoboard:masterfrom
MatthewDarling:patch-1
Open

Update to latest fog-aws release and bump base64 version#6
MatthewDarling wants to merge 2 commits into
geckoboard:masterfrom
MatthewDarling:patch-1

Conversation

@MatthewDarling

@MatthewDarling MatthewDarling commented Mar 10, 2025

Copy link
Copy Markdown

I think/hope this will fix #5.

I had used vagrant-gecko-aws successfully with Vagrant 2.4.2 with VAGRANT_DISABLE_STRICT_DEPENDENCY_ENFORCEMENT=1, but as of 2.4.3, we were getting dependency conflicts with something upgraded internal to Vagrant. So, it was time to learn enough about Ruby to bump the fog-aws dependency, haha.

I don't know how thorough the Rake tests are, but the tests pass on my branch when running bundle exec rake.

And two of my colleagues were able to provision a basic EC2 machine using my branch like so:

git clone https://github.com/MatthewDarling/vagrant-aws.git && \
cd vagrant-aws && \
git checkout patch-1 && \
bundle install && \
gem build vagrant-aws.gemspec && \
vagrant plugin install vagrant-gecko-aws-0.8.0.gem --entry-point vagrant-aws

We also use the aws-sdk-sts and aws-sdk-ec2 plugins, so I can confirm this is compatible with them.

Open to ideas for further testing 🙇‍♂️

Wait, what's bundler-resolutions?

The second commit has a detailed message that hopefully explains what's going on. There was a problem with a transitive dependency on base64, and asking for the newer version in the .gempsec file didn't fix it. So I added a plugin that's made for controlling transitive dependencies, and it seems to work 🤞 However, I'm certain that this isn't the best way to deal with transitive dependency problems. What would a true Rubyist do?

Warnings from upgrading fog-aws

When running vagrant reload, I got a warning that I think didn't happen before:

[fog][WARNING] stop_instances with FalseClass param is deprecated, use stop_instances('force' => boolean) instead (/Users/svk/.vagrant.d/gems/3.3.6/gems/fog-aws-3.30.0/lib/fog/aws/models/compute/server.rb:236:in `stop')

Although I think this is code internal to fog-aws, so maybe it will just be resolved by a future fog-aws update.

MatthewDarling and others added 2 commits March 7, 2025 17:19
Well, the Rake tests have passed. But I don't know how much to trust those. I've got someone to test things with on Monday, though :)
It seems like with aws-sdk-ec2 1.515.0, the version of base64 was
increased to 0.2.0. But one of the transitive dependencies of this gem
wants 0.1.1, so we couldn't install the plugin.

We tried specifying version 0.2.0 of `base64` in the `.gemspec` file,
but still got the same error. So I went to Google to understand how to
override transitive dependencies.

I found from a Github issue opened Sept 2024:
ruby/rubygems#8021

Where the author had created a Bundler plugin, bundler-resolutions:
https://github.com/hlascelles/bundler-resolutions

And this does indeed solve the problem! However, installing some brand
new experimental plugin is probably not how people normally solve
problems. There is almost certainly a much, much better way to do this
that would be totally clear to someone who understands the Ruby
ecosystem. Unfortunately, our team doesn't use Ruby, so I'm a bit
clueless on the subject.

Anyway, I'm pushing this in the hopes of getting help from experienced
Rubyists, while unblocking our team in the meantime :)
@MatthewDarling MatthewDarling changed the title Update to latest fog-aws release Update to latest fog-aws release and bump base64 version Apr 10, 2025
@takesson

Copy link
Copy Markdown

I have done some testing on Vagrant 2.4.3 on macOS Sonoma.

Guests:

  • Ubuntu
  • Windows, using SSH by activating OpenSSH with userdata script (the winrm file transfer was too flakey in Vagrant/ruby)

Commands:

  • vagrant up / halt / destroy
  • vagrant reload --provision
  • vagrant ssh / ssh-config

There was a slight challenge building the plugin since Sonoma ships with ruby 2.6. Installed more recent ruby with homebrew.

I suggest merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for vagrant 2.4.x

2 participants