Giter VIP home page Giter VIP logo

Comments (6)

stephenashank avatar stephenashank commented on August 13, 2024

Hi @dkfitbit , I have been looking into this and I'd like to clarify what contexts you need these environment variables set for. I've attempted ways to set these variables through the startup script but have not had any luck so far.

from google-compute-engine-plugin.

dkfitbit avatar dkfitbit commented on August 13, 2024

Example:

export http_proxy="http://some.proxy:3128"
export https_proxy="http://some.proxy:3128"
export no_proxy="localhost,.internal,169.254.169.254"
# usual Jenkins start-up
java -jar slave.jar
# now all subprocesses started on this executor by Jenkins have $http_proxy set

There might be other adequate ways to make those variables propagate to (1) all jobs that run on the executor (2) but no other executors, but the most obvious way is to set them when launching the JNLP slave.jar, which is what the EC2 plugin does.

from google-compute-engine-plugin.

dkfitbit avatar dkfitbit commented on August 13, 2024

It might help to know that we have a mix of executor types: cloud VMs that Jenkins deploys, bare metal machines that Jenkins SSHes into, and Mac Minis that live in corp and that connect to Jenkins (because Jenkins cannot reach them through the firewall). Each of these different machine types needs different environment variables set. One Jenkins job might use multiple machine types, perhaps even in parallel, and the environment variable values for a given machine type are the same for hundreds of jobs.

TL;DR: this is a major pain point compared to the EC2 plugin, which simply lets us customize the slave jar command line.

from google-compute-engine-plugin.

stephenashank avatar stephenashank commented on August 13, 2024

Thanks, that's actually extremely helpful. I would need to consult with our team on completely opening up customization of the launch command in that way. I don't believe it was intended to be used in this way, but it is actually now possible with the javaExecPath field (once release 3.2.0 hits the update center).

While we work on a more robust solution, here is the workaround that was just enabled. Configure the javaExecPath field something like this:

export http_proxy="http://some.proxy:3128";export https_proxy="https://some.proxy:3128";export no_proxy="localhost,.internal,169.254.169.254";java

It will work as long as the last part of the string is java or whatever the appropriate java executable path is.

from google-compute-engine-plugin.

rachely3n avatar rachely3n commented on August 13, 2024

Any updates? @dkfitbit

from google-compute-engine-plugin.

dkfitbit avatar dkfitbit commented on August 13, 2024

We haven't had time to upgrade from 1.0.5 (we're several months behind on our patching for all plugins, not just GCE).

from google-compute-engine-plugin.

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.