cloudfoundry / bosh-openstack-cpi-release

BOSH OpenStack CPI
Apache License 2.0
36 stars 59 forks source link

Fixes for running the cpi in an internetless environment #256

Closed jpalermo closed 2 years ago

jpalermo commented 2 years ago

We now specify BUNDLER_VERSION to prevent bundler from trying to install the version specified by BUNDLED WITH in the Gemfile.lock. Since we use the bundler from the ruby package, these versions are not likely to match.

This does not cause it to error in internetless environments, but it does hang for a long time before timing out and simply using the current bundler.


The Gemfile.lock was in a bad state causing this error: Could not find ipaddress-0.8.3 in locally installed gems which we are seeing in internetless environments.

jpalermo commented 2 years ago

Should fix #254

ragaskar commented 2 years ago

hmm can't find anything on the bundle install twice bit (would like to know more) ...

BUT .. it looks like they pulled ipaddress in 1.1.0 of fog-openstack: https://github.com/fog/fog-openstack/commit/dd03b266539619f92b2f424929f1f4c49a529762. I'm bewildered as to why it is still in our Gemfile.lock (maybe bad bundle update?) although to be fair I did not crack the gem open to see if something else wound up in the actual source.

ragaskar commented 2 years ago

Actually, I think I know how this might have happened. If I look at the commit where fog-openstack was bumped to 1.1.0, we see that there's only a single change to Gemfile.lock (which bumps the version number). This is odd, it should remove the ipaddress. If I bundle update fog-openstack on my local bosh-openstack-cpi-release, I get a diff that looks like this on my Gemfile.lock:

--- a/src/bosh_openstack_cpi/Gemfile.lock
+++ b/src/bosh_openstack_cpi/Gemfile.lock
@@ -19,10 +19,10 @@ GEM
       rexml
     diff-lcs (1.5.0)
     excon (0.71.1)
-    fog-core (2.2.4)
+    fog-core (2.3.0)
       builder
       excon (~> 0.71)
-      formatador (~> 0.2)
+      formatador (>= 0.2, < 2.0)
       mime-types
     fog-json (1.2.0)
       fog-core
@@ -30,11 +30,9 @@ GEM
     fog-openstack (1.1.0)
       fog-core (~> 2.1)
       fog-json (>= 1.0)
-      ipaddress (>= 0.8)
-    formatador (0.3.0)
+    formatador (1.1.0)
     hashdiff (1.0.1)
     httpclient (2.8.3)
-    ipaddress (0.8.3)
     little-plugger (1.1.4)
     logging (1.8.2)
       little-plugger (>= 1.1.3)

No diff at all on the Gemfile.

It's possible the person who made the PR didn't understand bundler well (who does?) and simply manually edited the Gemfile.lock to reflect the new fog openstack version.

I think for now we should see if this works better with a correct Gemfile.lock. I'll put together a PR.

jpalermo commented 2 years ago

Nice catch. I updated the commit with the Gemfile.lock change rather than the double bundle.