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(api): enable dynamic JFR start #165

Conversation

andrewazores
Copy link
Member

@andrewazores andrewazores commented Jul 5, 2023

Fixes #163
Fixes #164
Depends on cryostatio/cryostat-core#245

Not yet implemented: restarting already existing recordings, manual stop of running recordings, opening stream (download) recordings. This only enables the ability to remotely start a recording over HTTP.

@andrewazores andrewazores added the feat New feature or request label Jul 5, 2023
@mergify mergify bot added the safe-to-test label Jul 5, 2023
@andrewazores andrewazores changed the base branch from main to 124-epic-two-way-communications-protocol July 5, 2023 15:21
@andrewazores andrewazores marked this pull request as ready for review July 26, 2023 13:08
@maxcao13
Copy link
Member

maxcao13 commented Jul 27, 2023

I see an error when I run with 2.22.0 core, built agent quarkus test, and the dependent cryostat pr, does anyone else have this or is it my problem again?

image

    podman run \
        --name quarkus-test-agent-2 \
        --pod cryostat-pod \
        --env JAVA_OPTS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager -javaagent:/deployments/app/cryostat-agent.jar" \
        --env QUARKUS_HTTP_PORT=10011 \
        --env ORG_ACME_CRYOSTATSERVICE_ENABLED="false" \
        --env CRYOSTAT_AGENT_APP_NAME="quarkus-test-agent" \
        --env CRYOSTAT_AGENT_WEBCLIENT_SSL_TRUST_ALL="true" \
        --env CRYOSTAT_AGENT_WEBCLIENT_SSL_VERIFY_HOSTNAME="false" \
        --env CRYOSTAT_AGENT_WEBSERVER_HOST="localhost" \
        --env CRYOSTAT_AGENT_WEBSERVER_PORT="9988" \
        --env CRYOSTAT_AGENT_CALLBACK="http://localhost:9988/" \
        --env CRYOSTAT_AGENT_BASEURI="${protocol}://localhost:${webPort}/" \
        --env CRYOSTAT_AGENT_TRUST_ALL="true" \
        --env CRYOSTAT_AGENT_AUTHORIZATION="Basic $(echo user:pass | base64)" \
        --env CRYOSTAT_AGENT_REGISTRATION_PREFER_JMX="true" \
        --env CRYOSTAT_AGENT_API_WRITES_ENABLED="true" \
        --rm -d quay.io/andrewazores/quarkus-test:latest

@andrewazores
Copy link
Member Author

I see an error when I run with 2.22.0 core, built agent quarkus test, and the dependent cryostat pr, does anyone else have this or is it my problem again?

image

    podman run \
        --name quarkus-test-agent-2 \
        --pod cryostat-pod \
        --env JAVA_OPTS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager -javaagent:/deployments/app/cryostat-agent.jar" \
        --env QUARKUS_HTTP_PORT=10011 \
        --env ORG_ACME_CRYOSTATSERVICE_ENABLED="false" \
        --env CRYOSTAT_AGENT_APP_NAME="quarkus-test-agent" \
        --env CRYOSTAT_AGENT_WEBCLIENT_SSL_TRUST_ALL="true" \
        --env CRYOSTAT_AGENT_WEBCLIENT_SSL_VERIFY_HOSTNAME="false" \
        --env CRYOSTAT_AGENT_WEBSERVER_HOST="localhost" \
        --env CRYOSTAT_AGENT_WEBSERVER_PORT="9988" \
        --env CRYOSTAT_AGENT_CALLBACK="http://localhost:9988/" \
        --env CRYOSTAT_AGENT_BASEURI="${protocol}://localhost:${webPort}/" \
        --env CRYOSTAT_AGENT_TRUST_ALL="true" \
        --env CRYOSTAT_AGENT_AUTHORIZATION="Basic $(echo user:pass | base64)" \
        --env CRYOSTAT_AGENT_REGISTRATION_PREFER_JMX="true" \
        --env CRYOSTAT_AGENT_API_WRITES_ENABLED="true" \
        --rm -d quay.io/andrewazores/quarkus-test:latest

I just tried it again and it worked fine. The exception you see is the same as what I see when I try to create a recording on ex. vertx-fib-demo-1 over HTTP - the message isn't very helpful right now, but I suspect either the agent version picked up by the quarkus-test build is old, or the quarkus-test being run in the smoketest is old.

@maxcao13
Copy link
Member

I figured it out, I just forgot to sync quarkus-test to with origin/main and my pom.xml was using the wrong agent version :/
image

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.

Looks good to me!

@andrewazores andrewazores merged commit 0a60a1f into cryostatio:124-epic-two-way-communications-protocol Jul 27, 2023
6 checks passed
@andrewazores andrewazores deleted the readwrite-api branch July 27, 2023 20:11
andrewazores added a commit to andrewazores/cryostat-agent that referenced this pull request Aug 4, 2023
andrewazores added a commit that referenced this pull request Aug 4, 2023
andrewazores added a commit that referenced this pull request Aug 14, 2023
mwangggg pushed a commit to mwangggg/cryostat-agent that referenced this pull request Aug 16, 2023
mwangggg pushed a commit to mwangggg/cryostat-agent that referenced this pull request Aug 24, 2023
mwangggg pushed a commit to mwangggg/cryostat-agent that referenced this pull request Aug 31, 2023
andrewazores added a commit that referenced this pull request Sep 13, 2023
andrewazores added a commit that referenced this pull request Sep 19, 2023
* end paths with / so as to not match by prefix

* only allow GET requests if write-operations are not enabled

* feat(api): implement GET /recordings/:id for streaming files

* feat(api): enable dynamic JFR start (#165)

* feat(api): enable dynamic JFR stop, delete (#176)

Co-authored-by: Ming Wang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request safe-to-test
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Task] Accept requests for starting Flight Recordings [Task] Env var toggle for API write operations
2 participants