Repository navigation
ci: add tracing support to integration tests. - #2440
Merged
Merged
Conversation
sipsma
requested review from
a team,
aluzzardi,
samalba and
shykes
as code owners
May 12, 2022 18:20
Before this, when trying to use opentelemetry libs it was possible to get an error "cannot merge resource due to conflicting Schema URL". The error indicates that different versions of opentelemetry are being used at the same time. This seems to have ultimately resulted from the fact that we setup tracers and also provide those to some Buildkit libs, but buildkit is still on v1.4.1 while we recently upgraded to v1.7.0. This, for reasons that are not yet clear to me, only happened in the integration tests where the dagger client is running inside dagger. It may have something to do with a difference in how we build dagger inside dagger compared to when it is built directly in GHA, but not sure. Either way, this downgrade unblocks us for the moment until we have a better way of solving this. Signed-off-by: Erik Sipsma <[email protected]>
This sets up Jaeger to run inside GHA during integration tests, instruments dagger and buildkit to write to it and exports the resulting data as an artifact of the run. This enables us to get insight into what actually happened during our CI runs, which is helpful for debugging and getting insight into the performance of caching. Jaeger seems to be mostly designed for "live" use, but it has an experimental mode for persisting its data to disk, which I use here to enable exporting it. This is not a completely ideal solution. It requires setting up Buildkit and Jaeger in docker separate from our actual test run. The much better solution will be to use async \#Start and \#Stop tasks to run at least Jaeger (and probably Buildkit itself too). This will allows use to dogfood our own features and also open the interesting possibility of making it easier for other users to setup Jaeger or other opentelemetry-related daemons too (they can just re-use their Buildkit infra instead of setting up something else). \#Start will need a few more features first though, the main one being support for sending SIGTERM before SIGKILL (right now it is just instantly SIGKILL'd). Without that, the Jaeger data is corrupted. Once that support is merged, we will be able to switch over to \#Start. Signed-off-by: Erik Sipsma <[email protected]>
This makes exported traces easier to identify by test. Signed-off-by: Erik Sipsma <[email protected]>
This allows you to run a single dagger do command that pulls down jaeger data from the artifacts of a GHA run, start a local Jaeger daemon with it and then view it in your web browser. The dagger do command for this is printed at the end of GHA runs with all the --with parameters filled out, for convenience. It uses GH credentials, which it assumes you have previously setup on your local machine via "gh auth login" (gh is the github cli). This would be a great use-case for client-side proxying, but that doesn't exist yet, so the Jaeger daemon will just end up listening on the localhost of the machine running Buildkit. This is better than nothing for now and use of SSH port forwarding can help cases where its otherwise convenient. It is also a bit weird in that this is a plan that is expected to just keep running indefinitely until you cancel it (e.g. with ctrl-C). However, I have not experienced any issues with the previously, other than a weirdly flashing tty output while its running (which is a separate issue). Signed-off-by: Erik Sipsma <[email protected]>
samalba
approved these changes
May 13, 2022
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This sets up Jaeger to run inside GHA during integration tests,
instruments dagger and buildkit to write to it and exports the resulting
data as an artifact of the run.
This enables us to get insight into what actually happened during our CI
runs, which is helpful for debugging and getting insight into the
performance of caching.
Jaeger seems to be mostly designed for "live" use, but it has an
experimental mode for persisting its data to disk, which I use here to
enable exporting it.
This is not a completely ideal solution. It requires setting up Buildkit
and Jaeger in docker separate from our actual test run. The much better
solution will be to use async #Start and #Stop tasks to run at least
Jaeger (and probably Buildkit itself too). This will allows us to
dogfood our own features and also open the interesting possibility of
making it easier for other users to setup Jaeger or other
opentelemetry-related daemons too (they can just re-use their Buildkit
infra instead of setting up something else).
#Start will need a few more features first though, the main one being
support for sending SIGTERM before SIGKILL (right now it is just
instantly SIGKILL'd). Without that, the Jaeger data is corrupted. Once
that support is merged, we will be able to switch over to #Start.
Signed-off-by: Erik Sipsma [email protected]
Separate important commit:
ci: add plan for viewing Jaeger CI traces locallyThis allows you to run a single dagger do command that pulls down jaeger
data from the artifacts of a GHA run, start a local Jaeger daemon with
it and then view it in your web browser.
The dagger do command for this is printed at the end of GHA runs with
all the --with parameters filled out, for convenience.
It uses GH credentials, which it assumes you have previously setup on
your local machine via "gh auth login" (gh is the github cli).
This would be a great use-case for client-side proxying, but that
doesn't exist yet, so the Jaeger daemon will just end up listening on
the localhost of the machine running Buildkit. This is better than
nothing for now and use of SSH port forwarding can help cases where its
otherwise convenient.
It is also a bit weird in that this is a plan that is expected to just
keep running indefinitely until you cancel it (e.g. with ctrl-C).
However, I have not experienced any issues with the previously, other
than a weirdly flashing tty output while its running (which is a
separate issue).
Signed-off-by: Erik Sipsma [email protected]
Extra notes:
buildctl/buildxoutput rather than truly general observability, tracing was the better route.core.#Start. I'll be sending out the updates need to#Startto enable that soon too.