Skip to content
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

feat(agent): implement Agent HTTP dynamic JFR start #1566

Conversation

andrewazores
Copy link
Member

@andrewazores andrewazores commented Jun 28, 2023

Welcome to Cryostat! 👋

Before contributing, make sure you have:

  • Read the contributing guidelines
  • Linked a relevant issue which this PR resolves
  • Linked any other relevant issues, PR's, or documentation, if any
  • Resolved all conflicts, if any
  • Rebased your branch PR on top of the latest upstream main branch
  • Attached at least one of the following labels to the PR: [chore, ci, docs, feat, fix, test]
  • Signed the last commit: git commit --amend --signoff

Related to cryostatio/cryostat-agent#162
Depends on cryostatio/cryostat-agent#165
Depends on cryostatio/cryostat-core#245
Fixes #1580
Related to #1579

Description of the change:

Refactor to extract some logic out to -core and use an additional abstraction on top of the JMC IFlightRecorderService. The new CryostastFlightRecorderService subinterface provides higher-level operation abstractions to support the AgentService/AgentConnection/AgentClient HTTP-based communications, so that existing code needs minimal changes to perform operations like dynamically starting recordings by providing arguments like event template name+type, or later the whole event template XML document (for custom event templates), rather than using the JMC IConstrainedMap model.

How to manually test:

  1. Locally build/install -core and -agent
  2. Rebuild quarkus-test to include two dependencies above and feat(api): enable dynamic JFR start cryostat-agent#165
  3. Run CRYOSTAT_IMAGE=quay.io... sh smoketest.sh... - note that quarkus-test-agent-2 has CRYOSTAT_AGENT_API_WRITES_ENABLED=true.
  4. Try to start a recording on a different Agent/HTTP target and verify that this fails (error screen appears in web-client)
  5. Try to start a recording on quarkus-test-agent-2 (http://localhost:9988) and verify that the recording creation succeeds

@andrewazores andrewazores added the chore Refactor, rename, cleanup, etc. label Jun 28, 2023
@mergify mergify bot added the safe-to-test label Jun 28, 2023
@andrewazores andrewazores changed the base branch from main to 1578-epic-two-way-agent-communications July 5, 2023 15:13
@andrewazores andrewazores changed the title chore(svc): extract EventOptionsBuilder to -core and use new CryostatFlightRecorderService feat(agent): implement Agent HTTP dynamic JFR start Jul 5, 2023
mergify[bot]
mergify bot previously requested changes Jul 25, 2023
Copy link

@mergify mergify bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request blocked. web-client submodule updates are performed automatically by CI when that repository is updated. Please revert or drop all changes to the web-client submodule from this PR and perform any required frontend work by opening and merging a PR against cryostat-web.

@andrewazores andrewazores force-pushed the agent-communication branch 3 times, most recently from 7a9555b to ebbe5ef Compare July 25, 2023 18:26
@andrewazores andrewazores marked this pull request as ready for review July 26, 2023 13:08
@github-actions
Copy link
Contributor

mergify[bot]
mergify bot previously requested changes Jul 27, 2023
Copy link

@mergify mergify bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request blocked. web-client submodule updates are performed automatically by CI when that repository is updated. Please revert or drop all changes to the web-client submodule from this PR and perform any required frontend work by opening and merging a PR against cryostat-web.

Copy link
Member

@maxcao13 maxcao13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code and functionality looks good to me.

@andrewazores andrewazores merged commit 18e46b6 into cryostatio:1578-epic-two-way-agent-communications Aug 1, 2023
8 checks passed
@andrewazores andrewazores deleted the agent-communication branch August 1, 2023 18:33
andrewazores added a commit that referenced this pull request Aug 14, 2023
* chore(svc): extract EventOptionsBuilder to -core and use new CryostatFlightRecorderService

* add unimplemented overrides

* test(smoketest): enable API writes on one agent-equipped sample app

* chore(serial): extract recording descriptor to -core

* chore(activerecordings): clean up an error handler

* feat(agent): implement dynamic start of JFR over HTTP

* bump -core version
andrewazores added a commit that referenced this pull request Aug 14, 2023
* chore(svc): extract EventOptionsBuilder to -core and use new CryostatFlightRecorderService

* add unimplemented overrides

* test(smoketest): enable API writes on one agent-equipped sample app

* chore(serial): extract recording descriptor to -core

* chore(activerecordings): clean up an error handler

* feat(agent): implement dynamic start of JFR over HTTP

* bump -core version
andrewazores added a commit that referenced this pull request Aug 14, 2023
* chore(svc): extract EventOptionsBuilder to -core and use new CryostatFlightRecorderService

* add unimplemented overrides

* test(smoketest): enable API writes on one agent-equipped sample app

* chore(serial): extract recording descriptor to -core

* chore(activerecordings): clean up an error handler

* feat(agent): implement dynamic start of JFR over HTTP

* bump -core version
aali309 pushed a commit to aali309/cryostat-legacy that referenced this pull request Aug 27, 2023
* chore(svc): extract EventOptionsBuilder to -core and use new CryostatFlightRecorderService

* add unimplemented overrides

* test(smoketest): enable API writes on one agent-equipped sample app

* chore(serial): extract recording descriptor to -core

* chore(activerecordings): clean up an error handler

* feat(agent): implement dynamic start of JFR over HTTP

* bump -core version
aali309 pushed a commit to aali309/cryostat-legacy that referenced this pull request Sep 7, 2023
* chore(svc): extract EventOptionsBuilder to -core and use new CryostatFlightRecorderService

* add unimplemented overrides

* test(smoketest): enable API writes on one agent-equipped sample app

* chore(serial): extract recording descriptor to -core

* chore(activerecordings): clean up an error handler

* feat(agent): implement dynamic start of JFR over HTTP

* bump -core version
andrewazores added a commit that referenced this pull request Sep 13, 2023
* chore(svc): extract EventOptionsBuilder to -core and use new CryostatFlightRecorderService

* add unimplemented overrides

* test(smoketest): enable API writes on one agent-equipped sample app

* chore(serial): extract recording descriptor to -core

* chore(activerecordings): clean up an error handler

* feat(agent): implement dynamic start of JFR over HTTP

* bump -core version
andrewazores added a commit that referenced this pull request Sep 15, 2023
* chore(svc): extract EventOptionsBuilder to -core and use new CryostatFlightRecorderService

* add unimplemented overrides

* test(smoketest): enable API writes on one agent-equipped sample app

* chore(serial): extract recording descriptor to -core

* chore(activerecordings): clean up an error handler

* feat(agent): implement dynamic start of JFR over HTTP

* bump -core version
andrewazores added a commit that referenced this pull request Sep 18, 2023
* chore(svc): extract EventOptionsBuilder to -core and use new CryostatFlightRecorderService

* add unimplemented overrides

* test(smoketest): enable API writes on one agent-equipped sample app

* chore(serial): extract recording descriptor to -core

* chore(activerecordings): clean up an error handler

* feat(agent): implement dynamic start of JFR over HTTP

* bump -core version
andrewazores added a commit that referenced this pull request Sep 18, 2023
* chore(svc): extract EventOptionsBuilder to -core and use new CryostatFlightRecorderService

* add unimplemented overrides

* test(smoketest): enable API writes on one agent-equipped sample app

* chore(serial): extract recording descriptor to -core

* chore(activerecordings): clean up an error handler

* feat(agent): implement dynamic start of JFR over HTTP

* bump -core version
andrewazores added a commit that referenced this pull request Sep 19, 2023
* chore(svc): extract EventOptionsBuilder to -core and use new CryostatFlightRecorderService

* add unimplemented overrides

* test(smoketest): enable API writes on one agent-equipped sample app

* chore(serial): extract recording descriptor to -core

* chore(activerecordings): clean up an error handler

* feat(agent): implement dynamic start of JFR over HTTP

* bump -core version
andrewazores added a commit that referenced this pull request Sep 19, 2023
* feat(agent): implement Agent HTTP dynamic JFR start (#1566)

* chore(svc): extract EventOptionsBuilder to -core and use new CryostatFlightRecorderService

* test(smoketest): enable API writes on one agent-equipped sample app

* chore(serial): extract recording descriptor to -core

* chore(activerecordings): clean up an error handler

* feat(agent): implement dynamic start of JFR over HTTP

* bump -core version

* feat(agent): implement Agent HTTP dynamic JFR stop/delete (#1604)

* feat(agent): implement Agent HTTP recording retrieval (#1607)

* feat(agent): implement HTTP JFR snapshot creation (#1627)

Co-authored-by: Atif Ali <56743004+aali309@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Refactor, rename, cleanup, etc. safe-to-test
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants