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(harvester): harvester push to per-agent API endpoint and add maxFiles configuration #41

Merged
merged 3 commits into from
Jan 18, 2023

Conversation

maxcao13
Copy link
Member

Depends on https://github.com/cryostatio/cryostat/pull/1333
Fixes #25

  1. mvn clean install this PR.
  2. cd quarkus-test ; ./mvnw -U clean package && podman build -t quay.io/andrewazores/quarkus-test:latest -f src/main/docker/Dockerfile.jvm . ; podman image prune -f
  3. This PR requires https://github.com/cryostatio/cryostat/pull/1333
  4. cd cryostat, modify smoketest.sh as seen below
  5. Go to the PR linked above and checkout the latest github-actions image linked in the comment and run it
  6. e.g. $ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1333-4cb90b936aabdba6487f63bf2001ffcdb23df30f sh smoketest.sh
diff --git a/smoketest.sh b/smoketest.sh
index 48c0f88c..c2c6cf45 100755
--- a/smoketest.sh
+++ b/smoketest.sh
@@ -132,7 +132,10 @@ runDemoApps() {
         --env CRYOSTAT_AGENT_BASEURI="${protocol}://localhost:${webPort}/" \
         --env CRYOSTAT_AGENT_TRUST_ALL="true" \
         --env CRYOSTAT_AGENT_AUTHORIZATION="Basic $(echo user:pass | base64)" \
-        --rm -d quay.io/andrewazores/quarkus-test:0.0.10
- 
+        --env CRYOSTAT_AGENT_HARVESTER_MAX_FILES=3 \
+        --env CRYOSTAT_AGENT_HARVESTER_PERIOD_MS=30000 \
+        --env CRYOSTAT_AGENT_HARVESTER_EXIT_MAX_AGE_MS=60000 \
+        --env CRYOSTAT_AGENT_HARVESTER_EXIT_MAX_SIZE_B="$(echo 1024*1024*1 | bc)" \
+        --rm -d quay.io/andrewazores/quarkus-test:latest
 
     podman run \
         --name quarkus-test-agent-2 \

Notice the agent will keep the latest 3 files when pushing to its attached target.

One unusual thing I noticed, was that my quarkus-test application tests kept failing due to some error with quarkus.

Running org.acme.GreetingResourceTest
2023-01-16 18:26:28,628 INFO  [org.jbo.threads] (main) JBoss Threads version 3.4.2.Final
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.672 s <<< FAILURE! - in org.acme.GreetingResourceTest
[ERROR] org.acme.GreetingResourceTest.testHelloEndpoint  Time elapsed: 0.005 s  <<< ERROR!
java.lang.RuntimeException: java.lang.RuntimeException: Failed to start quarkus
Caused by: java.lang.RuntimeException: Failed to start quarkus
Caused by: java.lang.RuntimeException: Unable to start HTTP server
Caused by: java.util.concurrent.ExecutionException: io.quarkus.runtime.QuarkusBindException
Caused by: io.quarkus.runtime.QuarkusBindException

But running the normal steps and just skipping the tests with -DskipTests worked fine.

…specific upload handler, using runtime calculated jvmId

Signed-off-by: Max Cao <[email protected]>
@maxcao13 maxcao13 added the feat New feature or request label Jan 16, 2023
@maxcao13 maxcao13 requested a review from andrewazores January 16, 2023 23:56
README.md Outdated Show resolved Hide resolved
@andrewazores
Copy link
Member

Caused by: java.lang.RuntimeException: Failed to start quarkus
Caused by: java.lang.RuntimeException: Unable to start HTTP server
Caused by: java.util.concurrent.ExecutionException: io.quarkus.runtime.QuarkusBindException
Caused by: io.quarkus.runtime.QuarkusBindException

This looks like something else was already listening on the same HTTP port that the application wanted to connect to. I think the quarkus-test application's unit tests spin up an HTTP server and it tries to bind to the same local port as something in the smoketest.sh setup.

@maxcao13
Copy link
Member Author

Caused by: java.lang.RuntimeException: Failed to start quarkus
Caused by: java.lang.RuntimeException: Unable to start HTTP server
Caused by: java.util.concurrent.ExecutionException: io.quarkus.runtime.QuarkusBindException
Caused by: io.quarkus.runtime.QuarkusBindException

This looks like something else was already listening on the same HTTP port that the application wanted to connect to. I think the quarkus-test application's unit tests spin up an HTTP server and it tries to bind to the same local port as something in the smoketest.sh setup.

Ahh... I see. Then that makes sense.

@andrewazores
Copy link
Member

Looks great otherwise.

@andrewazores andrewazores merged commit 5593586 into cryostatio:main Jan 18, 2023
@maxcao13 maxcao13 deleted the push-per-agent-endpoint branch January 18, 2023 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Task] Push recordings to per-agent API endpoint
2 participants