Build and package datadog-profiling in CI#1663
Conversation
142e56b to
eb82471
Compare
This is because my Internet connection sucks at the moment and I need to minimize total size _and_ individual layer size. As a bonus, the extra time spent here means that more layers get shared than before. Also temporarily allow `-Wno-error=return-local-addr`; these started showing up after the Alpine 3.16 upgrade. It needs a tracer engineer to look at it, so for now I'm just allowing it so I can work in parallel.
1c95b20 to
af061e3
Compare
af061e3 to
2903a62
Compare
This is simpler to implement in Rust because it avoid global mutable state in favor of lazy initialization. It does have the unfortunate side-effect that if the profiler is installed but disabled and the user clicks on the Code Hotspots tab, then the app will try to find associated profiles even though there won't be any.
4454302 to
e02c8a1
Compare
d75d9ed to
286923f
Compare
d2de1c8 to
09ff06b
Compare
09ff06b to
3de065c
Compare
2965a0e to
320c831
Compare
9224be5 to
bb53bcc
Compare
bb53bcc to
3f7f355
Compare
This shaves off about 40s of link time. I haven't profiled performance yet _at all_ so this is fine.
This saves some time in the CI, as this is on the slowest path to the "package extension" job.
Overall this will cost more CI resources but cuts off around 90s of build time.
| - restore_cache: | ||
| name: Restore Cargo Package Cache | ||
| keys: | ||
| - profiling-cargo-cache-<< parameters.triplet >>-{{ checksum "profiling/Cargo.toml" }} |
There was a problem hiding this comment.
This key looks nice to me
| curl -L -o $tmp_folder_profiling_archive $profiling_url | ||
|
|
||
| # Profiling: C version | ||
| #curl -L -o $tmp_folder_profiling_archive $profiling_url |
There was a problem hiding this comment.
This does make it easy to revert back. Just flagging it so I remember.
r1viollet
left a comment
There was a problem hiding this comment.
Some nice optimisations to get the Rust build times down.
I think we could have even more caching. To be discussed for next PR, this is already big !
Congrats on putting all of this together. It must have been some amount of iterations.
bwoebi
left a comment
There was a problem hiding this comment.
Thanks, this looks great to me. I'm not sure whether we need that extra package_profiling step, but it does no harm, so, let's move on :-)
|
I took at look at "package profiling" and I think it does about 1 minute of harm! It spends about 1 minute downloading the container, attaching the workspace, re-uploading the workspace, etc for just 10ish seconds of work. We can just do those things in "package extension". Good eye! |
bwoebi
left a comment
There was a problem hiding this comment.
That seems to shave off a couple seconds. Guess there's nothing left to optimize now.
r1viollet
left a comment
There was a problem hiding this comment.
Good thinking on these last optims !
LGTM
Description
This adds jobs to the
build_packagesworkflow in CircleCI that buildthe datadog-profiling extension on x86_64-unknown-linux-gnu and
x86_64-alpine-linux-musl. It adjusts the
datadog-setup.phpinstallscript to use
extension = datadog-profiling.soinstead ofzend_extension = datadog-profiling.soand checks for profilingdependencies that weren't there before, which depending on your OS
includes
libgcc_s,libdl,libpthread, andlibrt.This also updated the Alpine images to v3.16, which caused a few things
to break in CI. I fixed one of them already, but there's still an issue
with the warning
return-local-addr. This was beyond my skill to justdrop in and fix quickly, so I dropped in a
-Wno-error=return-local-addrthat should be removed once the fix isin place. In the testing I did, the tracer built from this workflow can
run on Alpine 3.11 and earlier for x86-64, but I suspect for arm it
will not be possible to due to the libmusl v1.2 upgrade that happens
on Alpine 3.13.
Readiness checklist
Reviewer checklist