-
Notifications
You must be signed in to change notification settings - Fork 532
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
refactor(ci): Upload stage telemetry separately for each stage #22616
Changes from all commits
47226d6
58be33c
33bbcfd
49d2f8c
7632046
0c91003
b52fd3b
482d164
0073eb0
e3ad0ea
c8eb395
ecf6599
42a0a80
0ae2f66
5a22fea
5c93798
021b6a1
c3f7003
0da7458
4c1583e
2f0bf1d
93adfd4
12d2c9f
484ab85
6ea275f
68b584d
e3b7666
2677479
4eb347c
355f12d
24d0542
377c07e
39d7441
e576007
629020e
ca477d0
a28dc04
1bf8a0c
b2f48de
3b51a53
5cfb2de
4c49320
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -609,28 +609,25 @@ extends: | |
condition: succeededOrFailed() | ||
dependsOn: | ||
- build | ||
# NOTE: This is brittle; we need to only apply these stage dependencies when the corresponding stages actually | ||
# get created in the pipeline, in the include-publish-npm-package.yml file, so we want to match the compile-time | ||
# conditions *and exact stage names* that exist there. At some point it might be preferable to always create the | ||
# stages, control their execution with 'condition:', and update this stage to always depend on all previous | ||
# stages (while still running if some of the dependencies were skipped). | ||
- ${{ if eq(parameters.publish, true) }}: | ||
- ${{ if eq(variables['testBuild'], true) }}: | ||
- publish_npm_internal_test | ||
- ${{ if eq(variables['testBuild'], false) }}: | ||
- publish_npm_internal_build | ||
- ${{ if and(eq(variables['testBuild'], false), eq(parameters.isReleaseGroup, true)) }}: | ||
- publish_npm_internal_dev | ||
- ${{ if or(eq(variables['release'], 'release'), eq(variables['release'], 'prerelease')) }}: | ||
- publish_npm_public | ||
# Note: the publish stages are created in include-publish-npm-package.yml. We need to match the ids exactly. | ||
- publish_npm_internal_test | ||
- publish_npm_internal_build | ||
- publish_npm_public | ||
# NOTE: This is brittle; since the publish_npm_internal_dev stage is addded to the pipeline conditionally, | ||
# we create a dependency on it based on the same condition. | ||
# So this needs to be kept in sync with the logic that include-publish-npm-package.yml uses to create the stage. | ||
# At some point it might be preferable to always create the stage, control its execution solely with | ||
# 'condition:', and update this bit to always depend on publish_npm_internal_dev, since it will always exist. | ||
- ${{ if eq(parameters.isReleaseGroup, true) }}: | ||
- publish_npm_internal_dev | ||
jobs: | ||
- job: upload_run_telemetry | ||
displayName: Upload pipeline run telemetry to Kusto | ||
pool: Small-1ES | ||
variables: | ||
- group: ado-feeds | ||
- name: pipelineTelemetryWorkdir | ||
value: $(Pipeline.Workspace)/pipelineTelemetryWorkdir | ||
value: $(Pipeline.Workspace)/pipelineTelemetryWorkdir/timingOutput | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We always appended |
||
readonly: true | ||
- name: absolutePathToTelemetryGenerator | ||
value: $(Build.SourcesDirectory)/tools/telemetry-generator | ||
|
@@ -642,21 +639,30 @@ extends: | |
officeFeedUrl: $(ado-feeds-office) | ||
isCheckoutNeeded: true | ||
- task: Bash@3 | ||
displayName: Retrieve buildId results | ||
displayName: Get stage timing and result data from ADO | ||
env: | ||
BUILD_ID: $(Build.BuildId) | ||
ADO_API_TOKEN: $(System.AccessToken) | ||
WORK_FOLDER: $(pipelineTelemetryWorkdir) | ||
inputs: | ||
targetType: inline | ||
workingDirectory: $(absolutePathToTelemetryGenerator) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now that the task is split into two, "get data" and "send data to Kusto", the "get data" piece doesn't need to run in this directory. |
||
script: | | ||
echo "Creating output folder ..." | ||
mkdir -p $(pipelineTelemetryWorkdir)/timingOutput | ||
echo "Retrieving pipeline run timeline data ..." | ||
echo 'curl -u ":<REDACTED>" "https://dev.azure.com/fluidframework/internal/_apis/build/builds/$BUILD_ID/timeline"' | ||
curl -u ":$ADO_API_TOKEN" "https://dev.azure.com/fluidframework/internal/_apis/build/builds/$BUILD_ID/timeline\?api-version\=6.0-preview.1" > $(pipelineTelemetryWorkdir)/timingOutput/output.json | ||
pwd; | ||
ls -laR $(pipelineTelemetryWorkdir)/timingOutput/output.json; | ||
cat $(pipelineTelemetryWorkdir)/timingOutput/output.json; | ||
node --require @ff-internal/aria-logger bin/run --handlerModule $(absolutePathToTelemetryGenerator)/dist/handlers/stageTimingRetriever.js --dir '$(pipelineTelemetryWorkdir)/timingOutput/'; | ||
echo "Creating work folder '$WORK_FOLDER'"; | ||
mkdir -p $WORK_FOLDER; | ||
|
||
echo "Retrieving data from ADO API"; | ||
echo "curl -u \":<REDACTED>\" \"https://dev.azure.com/fluidframework/internal/_apis/build/builds/$BUILD_ID/timeline?api-version=7.1-preview.2\"" | ||
curl -u ":$ADO_API_TOKEN" "https://dev.azure.com/fluidframework/internal/_apis/build/builds/$BUILD_ID/timeline?api-version=7.1-preview.2" > $WORK_FOLDER/output.json | ||
- task: Bash@3 | ||
displayName: Submit telemetry for stage timing and result | ||
env: | ||
BUILD_ID: $(Build.BuildId) | ||
ADO_API_TOKEN: $(System.AccessToken) | ||
PIPELINE: BuildClient | ||
WORK_FOLDER: $(pipelineTelemetryWorkdir) | ||
inputs: | ||
targetType: inline | ||
workingDirectory: $(absolutePathToTelemetryGenerator) | ||
script: | | ||
echo "Listing files in '$WORK_FOLDER'" | ||
ls -laR $WORK_FOLDER; | ||
node --require @ff-internal/aria-logger bin/run --handlerModule "$(absolutePathToTelemetryGenerator)/dist/handlers/stageTimingRetriever.js" --dir "$WORK_FOLDER"; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,24 +61,24 @@ stages: | |
AFFECTED_PATHS: ${{ join(';', package.affectedPaths) }} | ||
|
||
- ${{ each package in parameters.packages }}: | ||
# The ids for these stages should be kept in sync with the dependency on them in tools/pipelines/test-dds-stress.yml | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment is obsolete now, since the |
||
- stage: ${{ replace(replace(package.name, '@fluidframework/', ''), '@fluid-experimental/', 'experimental_') }}_stress_tests | ||
dependsOn: CheckAffectedPaths | ||
displayName: Run ${{ package.name }} stress tests | ||
jobs: | ||
- template: include-test-real-service.yml | ||
parameters: | ||
# Ideally this would be a condition on the stage rather than the job, but it doesn't seem like that is supported (and ADO UI gives very little debug information | ||
# as to what might be going wrong). This only impacts the "stage" view of the pipeline, in that packages with skipped tests will show up as successful stages | ||
# rather than skipped stages. Clicking on a skipped stage still shows that the corresponding test job wasn't run. | ||
condition: eq(stageDependencies.CheckAffectedPaths.Job.outputs['Check${{ replace(package.testFileTarName, '-', '') }}.AffectedFilesModified'],'true') | ||
poolBuild: ${{ parameters.pool }} | ||
loggerPackage: '' | ||
artifactBuildId: ${{ parameters.artifactBuildId }} | ||
testPackage: ${{ package.name }} | ||
testWorkspace: ${{ parameters.testWorkspace }} | ||
timeoutInMinutes: 120 | ||
testFileTarName: ${{ package.testFileTarName }} | ||
testCommand: ${{ package.testCommand }} | ||
env: | ||
FUZZ_STRESS_RUN: true | ||
- template: /tools/pipelines/templates/include-test-real-service.yml@self | ||
parameters: | ||
stageId: ${{ replace(replace(package.name, '@fluidframework/', ''), '@fluid-experimental/', 'experimental_') }}_stress_tests | ||
stageDisplayName: Run ${{ package.name }} stress tests | ||
stageDependencies: | ||
- CheckAffectedPaths | ||
pipelineIdentifierForTelemetry: 'DdsStressService' | ||
# Ideally this would be a condition on the stage rather than the job, but it doesn't seem like that is supported (and ADO UI gives very little debug information | ||
# as to what might be going wrong). This only impacts the "stage" view of the pipeline, in that packages with skipped tests will show up as successful stages | ||
# rather than skipped stages. Clicking on a skipped stage still shows that the corresponding test job wasn't run. | ||
condition: eq(stageDependencies.CheckAffectedPaths.Job.outputs['Check${{ replace(package.testFileTarName, '-', '') }}.AffectedFilesModified'],'true') | ||
poolBuild: ${{ parameters.pool }} | ||
loggerPackage: '' | ||
artifactBuildId: ${{ parameters.artifactBuildId }} | ||
testPackage: ${{ package.name }} | ||
testWorkspace: ${{ parameters.testWorkspace }} | ||
timeoutInMinutes: 120 | ||
testFileTarName: ${{ package.testFileTarName }} | ||
testCommand: ${{ package.testCommand }} | ||
env: | ||
FUZZ_STRESS_RUN: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realized most of these stages always exist, so we can declare the dependencies without conditions.