-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Changes needed for agent-ng #42
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,7 +31,7 @@ class SpringInsight < JavaBuildpack::Component::BaseComponent | |
| # @param [Hash] context a collection of utilities used the component | ||
| def initialize(context) | ||
| super(context) | ||
| @version, @uri = supports? ? find_insight_agent : [nil, nil] | ||
| @version, @uri, @agent_id, @agent_pass = supports? ? find_insight_agent : [nil, nil, nil, nil] | ||
| end | ||
|
|
||
| # @macro base_component_detect | ||
|
|
@@ -79,8 +79,8 @@ def add_agent_configuration | |
| .add_system_property('agent.http.host', URI(@uri).host) | ||
| .add_system_property('agent.http.port', 80) | ||
| .add_system_property('agent.http.context.path', 'insight') | ||
| .add_system_property('agent.http.username', 'spring') | ||
| .add_system_property('agent.http.password', 'insight') | ||
| .add_system_property('agent.http.username', @agent_id) | ||
| .add_system_property('agent.http.password', @agent_pass) | ||
| .add_system_property('agent.http.send.json', false) | ||
| .add_system_property('agent.http.use.proxy', false) | ||
| end | ||
|
|
@@ -111,21 +111,16 @@ def install_insight(agent_dir) | |
|
|
||
| init_container_libs root | ||
| init_insight_cloudfoundry_agent_plugin root | ||
| init_extra_applications root | ||
| init_insight root | ||
| init_insight_analyzer root | ||
| init_insight_agent_plugins root | ||
| init_weaver root | ||
| end | ||
|
|
||
| def init_container_libs(root) | ||
| move container_libs_directory, | ||
| root + 'agents/common/insight-bootstrap-generic-*.jar', | ||
| root + 'agents/tomcat/7/lib/insight-bootstrap-tomcat-common-*.jar' | ||
| end | ||
|
|
||
| def init_extra_applications(root) | ||
| move extra_applications_directory, | ||
| root + 'insight-agent' | ||
| root + 'agents/tomcat/7/lib/insight-bootstrap-tomcat-common-*.jar', | ||
| root + 'agents/tomcat/7/lib/insight-agent-*.jar' | ||
| end | ||
|
|
||
| def init_insight(root) | ||
|
|
@@ -134,8 +129,8 @@ def init_insight(root) | |
| root + 'insight/conf' | ||
| end | ||
|
|
||
| def init_insight_analyzer(root) | ||
| move insight_analyzer_directory + 'WEB-INF/lib', | ||
| def init_insight_agent_plugins(root) | ||
| move insight_directory + 'agent-plugins', | ||
| root + 'transport/http/insight-agent-http-*.jar', | ||
| root + 'cloudfoundry/insight-agent-cloudfoundry-*.jar' | ||
| end | ||
|
|
@@ -147,27 +142,21 @@ def init_insight_cloudfoundry_agent_plugin(root) | |
|
|
||
| def init_weaver(root) | ||
| move weaver_directory, | ||
| root + 'agents/common/insight-weaver-*.jar' | ||
| root + 'cloudfoundry/insight-weaver-*.jar' | ||
| end | ||
|
|
||
| def container_libs_directory | ||
| @droplet.root + '.spring-insight/container-libs' | ||
| end | ||
|
|
||
| def extra_applications_directory | ||
| @droplet.root + '.spring-insight/extra-applications' | ||
| end | ||
|
|
||
| def find_insight_agent | ||
| service = @application.services.find_service FILTER | ||
| version = service['label'].match(/(.*)-(.*)/)[2] | ||
| uri = service['credentials']['dashboard_url'] | ||
|
|
||
| return version, uri # rubocop:disable RedundantReturn | ||
| end | ||
|
|
||
| def insight_analyzer_directory | ||
| extra_applications_directory + 'insight-agent' | ||
| service = @application.services.find_service FILTER | ||
| version = service['label'].match(/(.*)-(.*)/)[2] | ||
| credentials = service['credentials'] | ||
| uri = credentials['dashboard_url'] | ||
| id = credentials['agent_username'] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The matching functionality in the Tomcat container needs to be removed.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now taken care of. |
||
| pass = credentials['agent_password'] | ||
| return version, uri, id, pass # rubocop:disable RedundantReturn | ||
| end | ||
|
|
||
| def insight_directory | ||
|
|
@@ -187,7 +176,7 @@ def move(destination, *globs) | |
| end | ||
|
|
||
| def supports? | ||
| @application.services.one_service? FILTER, 'dashboard_url' | ||
| @application.services.one_service? FILTER, 'dashboard_url', 'agent_username', 'agent_password' | ||
| end | ||
|
|
||
| def uber_agent_zip(location) | ||
|
|
||
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that this only takes into account the possibility of Tomcat 7. We support Tomcat 6 (although it's fading into the past, so I'm OK not supporting it here), but we also are starting to support Tomcat 8. Will the binaries in Tomcat 7 work in Tomcat 8?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't consider this something that necessarily needs to change (it's roughly the same code as before), just want to get an idea of where our limitations are.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brendanbenson can you please comment on this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Speaking on behalf of @brendanbenson , we only support Tomcat 7.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jcpivotallabs Any idea what happens if the JARs end up in Tomcat 8? Is it innocuous or does it cause a failure (in which case we should probably ensure that the JARs aren't copied for Tomcat 8)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Insight agent doesn't support Tomcat 8. We can do some testing to see if deploying the Insight agent for Tomcat 7 to Tomcat 8 crashes the Java app.
Is there a way in the buildpack code to find out what version of Tomcat we're deploying to? If so, we could conditionally check that when copying the JAR file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial test results:
$ java -jar insight-agent.jar --install --server_type tomcat --server_version 8.0.3
Error: Operation failed: No tomcat version 8.0.3 support
I think we'll need to exclude this JAR from Tomcat 8.