-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support (or document how to bundle/use) custom Java Agents #555
Comments
There's nothing built into the buildpack that treats this as a first-class concept. On the other hand, doing a It's an interesting idea to direct support for this, but what did you have in mind for identifying agents and configuration that isn't setting an environment variable of some kind? |
In order to use custom java agent, you can maintain your own internal agent repo and point to that custom java agent. env:
JBP_CONFIG_APP_DYNAMICS_AGENT: '{version: "4.2.15_6", repository_root: "http://youdomain:8082/AppDAgentRepo"}' |
@vijayantony But that's only for agents we already support. This question is more about support for any, non-public, agent without forking and adding a new component to support it. |
@nebhale yes it's exactly as @vijayantony says |
@CAFxX I'm afraid I'm not following. You just want alternate versions of agents we already support, or you want a generic "agent" mechanism? |
@nebhale the latter. Some of our users have non-public java agents they wish to use with the java buildpack, but without resorting to forking (and the maintaining the fork of) the buildpack. Just to clarify, in my previous comment I was referring to this part of @vijayantony's comment:
|
I wrote that 😄, not @vijayantony. Good to see that we're on the same page. |
That's what I get for commenting first things after waking up. 🤦♂️ Sorry. |
@nebhale any thoughts on this? Was my explanation of the use case enough? |
Sorry, this had fallen off my radar. I think the outstanding question I have is
Your suggestion of
can already be achieved with Thoughts on the pros and cons of what's available today versus what you'd rather do? |
Great, if so then we're good. In this case we're in case 2 of my original post:
A couple of questions:
|
I’d consider this officially supported as I regularly recommend it. It’s actually a more generalized case that includes things like “how do I include a private Do you have any recommendation of where in the documentation you’d expect to find this? |
I would add it to the standard framework section of the README (it already contains a section about java options and about all the builtin agents) and ideally somewhere in https://docs.cloudfoundry.org/buildpacks/java/java-tips.html (e.g. the example in https://docs.cloudfoundry.org/buildpacks/java/java-tips.html#extension seem to imply that "the way" to use an agent is by forking/extending) |
I have a confusion in spring native. |
The CF Java buildpack does not directly support compiling Java native images. Although there is support for using GraalVM as a JVM. For native image on CF, you want to build outside of CF then use the binary-buildpack. See https://docs.cloudfoundry.org/buildpacks/java/java-native-image.html. |
We have received internal enquiries about how to bundle and use custom java agents with applications pushed using the Java buildpack.
I went through the docs but could not find anything significant. The only related thing I found is the support in the buildpack for extensions to add their java agents:
java-buildpack/lib/java_buildpack/component/java_opts.rb
Lines 37 to 63 in 233ffe2
Ideally, as a user, I would like to be able to say: I have bundled
path/to/my_agent.jar
in myapplication.jar
, add it to the JVM when starting and (optionally) also set something like the following related JAVA_OPTS:-Dmyagent.config_file=path/to/my_agent.conf
, wherepath/to/myagent.conf
contains the configuration that will be used by the agent.If I missed it and this is already supported, then I think it would be helpful if the buildpack docs or the java tips included an example of how to do this.
edit: Just to clarify, we are not considering the forking mechanism because these agents can't be upstreamed under any circumstance. That means users would need to keep maintaining the fork of the buildpack, and that would basically undermine the value proposition of buildpacks.
The text was updated successfully, but these errors were encountered: