Code Monkey home page Code Monkey logo

Comments (17)

warroyo avatar warroyo commented on August 23, 2024 1

I see that there is an open feature for using HTTP_PROXY(#33). Is that going to take the place of this feature?

I am wondering because at my company we do not always have proxy access to the internet so this would not fix the problem. We use an internal gem repository so being able to change the source is necessary.

also is there any update on the progress of this?

from busser.

aespinosa avatar aespinosa commented on August 23, 2024

As a current workaround, I bake this gemrc after my omnibus chef installs.

cat > /opt/chef/embedded/etc/gemrc <<EOF
---
:sources:
  - http://my-internal-rubygems.hostname/
EOF

This also points "gem install busser" done by test-kitchen to use this internal gem repository.

from busser.

aespinosa avatar aespinosa commented on August 23, 2024

Did a bit more poking around and "busser plugin install " doesn't respect the gemrc. So plugin installation won't use the proxy repositories.

from busser.

pburkholder avatar pburkholder commented on August 23, 2024

@aespinosa I seem to be up against the same issue. Have you found a way to work around that?

--Peter

from busser.

irvingpop avatar irvingpop commented on August 23, 2024

How about writing that out to /root/.gemrc instead?

from busser.

tfitch avatar tfitch commented on August 23, 2024

I was just discussing this with a customer and they're hitting the same issue because they can't access rubygems.org so Busser can't install plugins.

@irvingpop in answer to your question, it looks like here that gemrc is being specifically unset and those any attempt to use a gemrc file is ignored. https://github.com/test-kitchen/busser/blob/master/lib/busser/command/setup.rb#L125

from busser.

irvingpop avatar irvingpop commented on August 23, 2024

but even with $GEMRC being unset, gem should still look at ~/.gemrc right?

from busser.

fnichol avatar fnichol commented on August 23, 2024

@irvingpop I think this is because of my artisinal RubyGems installation code--seems like the .gemrc loading is other code.

In short though, we need to make this work at a minimum. Ideally, I'd also like the busser command to honor http_proxy and https_proxy where appropriate.

from busser.

fnichol avatar fnichol commented on August 23, 2024

Note that I'm only tagging it "New Feature" as I expect it'll be a bit more work than a line or two, but necessary nonetheless.

from busser.

acqant avatar acqant commented on August 23, 2024

+1, darn proxies!

from busser.

warroyo avatar warroyo commented on August 23, 2024

is there any update on when this feature might be available?

from busser.

neillturner avatar neillturner commented on August 23, 2024

Also we need the ability to test busser plugins (and mods to existing plugins) without having to publish to rubygems. For the provisioner plugins that get installed on your workstation this is easy as you just install manually from a file. I suppose after running the verify you can then go onto the server and install a new from a gem file you copy, but all a bit manual....

from busser.

 avatar commented on August 23, 2024

We need this as well at my workplace because our Test Kitchen instances on EC2 cannot access RubyGems.org. Any update on workarounds or when this might be implemented?

from busser.

 avatar commented on August 23, 2024

This is an issue at my workplace also. The idea of busser honoring http_proxy and https_proxy would be fabulous. I too would appreciate any potential workarounds or status of when this change would be implemented.

from busser.

 avatar commented on August 23, 2024

@CraigAdams I fixed it for us by writing out /tmp/verifier/bin/busser and having it not use the busser script for installing gems. After some spelunking, it turns out that the busser gem explicitly unsets GEMRC and RUBYOPTS from the environment, purportedly to ensure that it's running in a clean gem environment. This was problematic for us because we needed it to use a custom gemrc for various reasons, as well as getting it all to work with a proxy.

Since we're using kitchen-ec2 exclusively, I took advantage of the driver.user_data setting in the .kitchen.yml file to do this. Here's the relevant parts:

driver:
  user_data: |
    mkdir -p /tmp/verifier
    cat <<EOF > /tmp/verifier/gemrc
    <CUSTOM GEMRC FOR BUSSER>
    EOF

    mkdir -p /tmp/verifier/bin
    cat <<EOF > /tmp/verifier/bin/busser
    #!/usr/bin/env sh
    export BUSSER_ROOT="/tmp/verifier"
    export GEMRC="/tmp/verifier/gemrc"
    export GEM_HOME="/tmp/verifier/gems"
    export GEM_PATH="/tmp/verifier/gems"
    export GEM_CACHE="/tmp/verifier/gems/cache"
    export HTTP_PROXY="<HTTP PROXY URL>"
    export HTTPS_PROXY="<HTTPS PROXY URL>"
    export NO_PROXY="<NO PROXY STRING>"
    export http_proxy=$HTTP_PROXY
    export https_proxy=$HTTPS_PROXY
    export no_proxy=$NO_PROXY
    <ANY OTHER SPECIAL ENVIRONMENT VARIABLES YOU NEED>

    # Use raw RubyGems to install busser plugins
    if [[ $1 == 'plugin' ]] && [[ $2 == 'install' ]]; then
      shift 2
      exec "/opt/chef/embedded/bin/gem" "install" "$@"
    else
      exec "/opt/chef/embedded/bin/ruby" "/tmp/verifier/gems/bin/busser" "$@"
    fi
    EOF

    chmod 0755 /tmp/verifier/bin/busser
    chown -R ec2-user:ec2-user /tmp/verifier

YMMV, but this has been working like a charm for us.

from busser.

steversmith avatar steversmith commented on August 23, 2024

@fnichol Any idea on when this will be released?

I have been working around this by pre-installing the busser (v0.7.1) and busser-serverspec gems in the /tmp/verifier directory on my box files.

But, the "busser plugin install busser-serverspec" command still attempts to go to rubygems.org (due to the latest_gem_version method in lib/busser/rubygems.rb), regardless of what is in the gemrc file.

Using v0.7.2-dev version of busser gets around the problem with detecting the busser-serverspec is already pre-installed on the box file.

from busser.

damacus avatar damacus commented on August 23, 2024

Closing due to inactivity.

If this is still an issue please reopen or open another issue.

Thanks,
Test-Kitchen Maintainers

from busser.

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.