From 6129a8b6b46cc2a48472e3a6574e679b3f00e7ac Mon Sep 17 00:00:00 2001 From: Parthiba hazra Date: Wed, 23 Aug 2023 01:52:03 +0530 Subject: [PATCH] :sparkles: Added jaeger to images so it runs out of the box (#297) Fixes: #236 --------- Signed-off-by: Parthiba-Hazra --- Dockerfile | 8 +++++++- cmd/analyzer/main.go | 2 +- demo.Dockerfile | 4 ++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4f5baf7c..4bf82554 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,9 +16,13 @@ COPY Makefile /analyzer-lsp/Makefile RUN make build +FROM jaegertracing/all-in-one:latest AS jaeger-builder + # The unofficial base image w/ jdtls and gopls installed FROM quay.io/konveyor/jdtls-server-base +COPY --from=jaeger-builder /go/bin/all-in-one-linux /usr/bin/ + COPY --from=builder /analyzer-lsp/konveyor-analyzer /usr/bin/konveyor-analyzer COPY --from=builder /analyzer-lsp/konveyor-analyzer-dep /usr/bin/konveyor-analyzer-dep COPY --from=builder /analyzer-lsp/external-providers/generic-external-provider/generic-external-provider /usr/bin/generic-external-provider @@ -28,4 +32,6 @@ COPY provider_container_settings.json /analyzer-lsp/provider_settings.json WORKDIR /analyzer-lsp -ENTRYPOINT ["konveyor-analyzer"] +EXPOSE 16686 + +ENTRYPOINT ["sh", "-c", "all-in-one-linux & sleep 5 && konveyor-analyzer"] diff --git a/cmd/analyzer/main.go b/cmd/analyzer/main.go index 79212bf8..6c6273ae 100644 --- a/cmd/analyzer/main.go +++ b/cmd/analyzer/main.go @@ -54,7 +54,7 @@ func init() { rootCmd.Flags().StringVar(&labelSelector, "label-selector", "", "an expression to select rules based on labels") rootCmd.Flags().StringVar(&depLabelSelector, "dep-label-selector", "", "an expression to select dependencies based on labels. This will filter out the violations from these dependencies as well these dependencies when matching dependency conditions") rootCmd.Flags().IntVar(&logLevel, "verbose", 9, "level for logging output") - rootCmd.Flags().BoolVar(&enableJaeger, "enable-jaeger", false, "enable tracer exports to jaeger endpoint") + rootCmd.Flags().BoolVar(&enableJaeger, "enable-jaeger", true, "enable tracer exports to jaeger endpoint") rootCmd.Flags().StringVar(&jaegerEndpoint, "jaeger-endpoint", "http://localhost:14268/api/traces", "jaeger endpoint to collect tracing data") rootCmd.Flags().IntVar(&limitIncidents, "limit-incidents", 1500, "Set this to the limit incidents that a given rule can give, zero means no limit") rootCmd.Flags().IntVar(&limitCodeSnips, "limit-code-snips", 20, "limit the number code snippets that are retrieved for a file while evaluating a rule, 0 means no limit") diff --git a/demo.Dockerfile b/demo.Dockerfile index 1b25cb9a..3c2ec5e4 100644 --- a/demo.Dockerfile +++ b/demo.Dockerfile @@ -5,3 +5,7 @@ WORKDIR /analyzer-lsp COPY rule-example.yaml /analyzer-lsp/rule-example.yaml COPY examples /analyzer-lsp/examples COPY open-source-libs.txt /analyzer-lsp/open-source-libs.txt + +EXPOSE 16686 + +ENTRYPOINT ["sh", "-c", "all-in-one-linux & sleep 5 && konveyor-analyzer && curl -o traces.json http://localhost:16686/api/traces?service=analyzer-lsp"] \ No newline at end of file