From 5ac5c91bc162171df1326bab478d9dbfce32840c Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Thu, 9 May 2024 15:06:36 +0100 Subject: [PATCH] End tracing early in autobuild Action for improved performance and reliability This lets us achieve some performance and reliability improvements for workflows that run autobuild directly without specifying a build mode. --- lib/analyze.js | 11 ++++------- lib/analyze.js.map | 2 +- lib/autobuild-action.js | 4 ++++ lib/autobuild-action.js.map | 2 +- lib/tracer-config.js | 12 +++++++++++- lib/tracer-config.js.map | 2 +- src/analyze.ts | 11 ++++------- src/autobuild-action.ts | 5 +++++ src/tracer-config.ts | 15 +++++++++++++++ 9 files changed, 46 insertions(+), 18 deletions(-) diff --git a/lib/analyze.js b/lib/analyze.js index 3c3f5738ec..5c0812222c 100644 --- a/lib/analyze.js +++ b/lib/analyze.js @@ -225,13 +225,10 @@ async function runFinalize(outputDir, threadsFlag, memoryFlag, codeql, config, f } await fs.promises.mkdir(outputDir, { recursive: true }); const timings = await finalizeDatabaseCreation(codeql, config, threadsFlag, memoryFlag, logger); - // WARNING: This does not _really_ end tracing, as the tracer will restore its - // critical environment variables and it'll still be active for all processes - // launched from this build step. - // However, it will stop tracing for all steps past the codeql-action/analyze - // step. - // Delete variables as specified by the end-tracing script - await (0, tracer_config_1.endTracingForCluster)(codeql, config, features); + // If we didn't already end tracing in the autobuild Action, end it now. + if (process.env[environment_1.EnvVar.AUTOBUILD_DID_COMPLETE_SUCCESSFULLY] !== "true") { + await (0, tracer_config_1.endTracingForCluster)(codeql, config, logger, features); + } return timings; } exports.runFinalize = runFinalize; diff --git a/lib/analyze.js.map b/lib/analyze.js.map index e5c054c04f..ddd4468386 100644 --- a/lib/analyze.js.map +++ b/lib/analyze.js.map @@ -1 +1 @@ -{"version":3,"file":"analyze.js","sourceRoot":"","sources":["../src/analyze.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAC7B,2CAAyC;AAEzC,uDAAmD;AACnD,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EAAE,QAAQ,CAAC,CAAC;QAClE,MAAM,MAAM,CAAC,eAAe,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;IAC3D,CAAC;IACD,MAAM,CAAC,QAAQ,EAAE,CAAC;AACpB,CAAC;AAZD,gCAYC"} \ No newline at end of file diff --git a/lib/autobuild-action.js b/lib/autobuild-action.js index 96469f5603..f656cc2bfa 100644 --- a/lib/autobuild-action.js +++ b/lib/autobuild-action.js @@ -34,6 +34,7 @@ const feature_flags_1 = require("./feature-flags"); const logging_1 = require("./logging"); const repository_1 = require("./repository"); const status_report_1 = require("./status-report"); +const tracer_config_1 = require("./tracer-config"); const util_1 = require("./util"); async function sendCompletedStatusReport(config, logger, startedAt, allLanguages, failingLanguage, cause) { (0, util_1.initializeEnvironment)((0, actions_util_1.getActionVersion)()); @@ -81,6 +82,9 @@ async function run() { await (0, autobuild_1.runAutobuild)(config, language, features, logger); } } + // End tracing early to avoid tracing analyze. This improves the performance and reliability of + // the analyze step. + await (0, tracer_config_1.endTracingForCluster)(codeql, config, logger, features); } catch (unwrappedError) { const error = (0, util_1.wrapError)(unwrappedError); diff --git a/lib/autobuild-action.js.map b/lib/autobuild-action.js.map index c80a8c7121..c39bca3930 100644 --- a/lib/autobuild-action.js.map +++ b/lib/autobuild-action.js.map @@ -1 +1 @@ -{"version":3,"file":"autobuild-action.js","sourceRoot":"","sources":["../src/autobuild-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,iDAIwB;AACxB,6CAAgD;AAChD,2CAAwE;AACxE,qCAAqC;AACrC,iDAAmD;AACnD,+CAAuC;AACvC,mDAA2C;AAE3C,uCAAqD;AACrD,6CAAkD;AAClD,mDAMyB;AACzB,iCAOgB;AAShB,KAAK,UAAU,yBAAyB,CACtC,MAA0B,EAC1B,MAAc,EACd,SAAe,EACf,YAAsB,EACtB,eAAwB,EACxB,KAAa;IAEb,IAAA,4BAAqB,EAAC,IAAA,+BAAgB,GAA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AAM,yBAAyB,CAC7B,MAAM,EACN,MAAM,EACN,SAAS,EACT,SAAS,IAAI,EAAE,EACf,eAAe,EACf,KAAK,CACN,CAAC;QACF,OAAO;IACT,CAAC;IAED,IAAI,CAAC,cAAc,CAAC,oBAAM,CAAC,mCAAmC,EAAE,MAAM,CAAC,CAAC;IAExE,MAAM,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC;AAC9E,CAAC;AAED,KAAK,UAAU,UAAU;IACvB,IAAI,CAAC;QACH,MAAM,GAAG,EAAE,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,SAAS,CAAC,4BAA4B,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"} \ No newline at end of file +{"version":3,"file":"autobuild-action.js","sourceRoot":"","sources":["../src/autobuild-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,iDAIwB;AACxB,6CAAgD;AAChD,2CAAwE;AACxE,qCAAqC;AACrC,iDAAmD;AACnD,+CAAuC;AACvC,mDAA2C;AAE3C,uCAAqD;AACrD,6CAAkD;AAClD,mDAMyB;AACzB,mDAAuD;AACvD,iCAOgB;AAShB,KAAK,UAAU,yBAAyB,CACtC,MAA0B,EAC1B,MAAc,EACd,SAAe,EACf,YAAsB,EACtB,eAAwB,EACxB,KAAa;IAEb,IAAA,4BAAqB,EAAC,IAAA,+BAAgB,GAAE,CAAC,CAAC;IAE1C,MAAM,MAAM,GAAG,IAAA,gCAAgB,EAAC,KAAK,EAAE,eAAe,CAAC,CAAC;IACxD,MAAM,gBAAgB,GAAG,MAAM,IAAA,sCAAsB,EACnD,0BAAU,CAAC,SAAS,EACpB,MAAM,EACN,SAAS,EACT,MAAM,EACN,MAAM,IAAA,qBAAc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AC;QACF,OAAO;IACT,CAAC;IAED,IAAI,CAAC,cAAc,CAAC,oBAAM,CAAC,mCAAmC,EAAE,MAAM,CAAC,CAAC;IAExE,MAAM,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC;AAC9E,CAAC;AAED,KAAK,UAAU,UAAU;IACvB,IAAI,CAAC;QACH,MAAM,GAAG,EAAE,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,SAAS,CAAC,4BAA4B,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"} \ No newline at end of file diff --git a/lib/tracer-config.js b/lib/tracer-config.js index 489b5230be..c20a26784f 100644 --- a/lib/tracer-config.js +++ b/lib/tracer-config.js @@ -37,9 +37,19 @@ async function shouldEnableIndirectTracing(codeql, config, features) { config.languages.some((l) => (0, languages_1.isTracedLanguage)(l))); } exports.shouldEnableIndirectTracing = shouldEnableIndirectTracing; -async function endTracingForCluster(codeql, config, features) { +/** + * Delete variables as specified by the end-tracing script + * + * WARNING: This does not _really_ end tracing, as the tracer will restore its + * critical environment variables and it'll still be active for all processes + * launched from this build step. + * + * However, it will stop tracing for all steps past the current build step. + */ +async function endTracingForCluster(codeql, config, logger, features) { if (!(await shouldEnableIndirectTracing(codeql, config, features))) return; + logger.info("Unsetting build tracing environment variables. Subsequent steps of this job will not be traced."); const envVariablesFile = path.resolve(config.dbLocation, "temp/tracingEnvironment/end-tracing.json"); if (!fs.existsSync(envVariablesFile)) { throw new Error(`Environment file for ending tracing not found: ${envVariablesFile}`); diff --git a/lib/tracer-config.js.map b/lib/tracer-config.js.map index 7805430f51..1f3fffe891 100644 --- a/lib/tracer-config.js.map +++ b/lib/tracer-config.js.map @@ -1 +1 @@ -{"version":3,"file":"tracer-config.js","sourceRoot":"","sources":["../src/t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AG,CAAC,aAAa,CAAC,EACnC,OAAO,EACP,gBAAgB,CAAC,GAAG,CAAC,iBAAiB,CAAC,EACvC,aAAa,CACd,CAAC;IACJ,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AA7BD,0DA6BC"} \ No newline at end of file +{"version":3,"file":"tracer-config.js","sourceRoot":"","sources":["../src/tracer-config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAI7B,mDAA6D;AAC7D,2CAA+C;AAE/C,qDAAgD;AAChD,iCAAmC;AAM5B,KAAK,UAAU,2BAA2B,CAC/C,MAAc,EACd,MAAc,EACd,QAA2B;IAE3B,OAAO,CACL,CAAC,CAAC,MAAM,CAAC,SAAS;QAChB,MAAM,CAAC,SAAS,KAAK,gBAAS,CAAC,MAAM;QACrC,CAAC,CAAC,MAAM,QAAQ,CAAC,QAAQ,CACvB,uBAAO,CAAC,6BAA6B,EACrC,MAAM,CACP,CAAC,CAAC;QACL,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,4BAAgB,EAAC,CAAC,CAAC,CAAC,CAClD,CAAC;AACJ,CAAC;AAdD,kEAcC;AAED;;;;;;;;GAQG;AACI,KAAK,UAAU,oBAAoB,CACxC,MAAc,EACd,MAAc,EACd,MAAc,EACd,QAA2B;IAE3B,IAAI,CAAC,CAAC,MAAM,2BAA2B,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;QAAE,OAAO;IAE3E,MAAM,CAAC,IAAI,CACT,iGAAiG,CAClG,CAAC;IAEF,MAAM,gBAAgB,GAAG,IAAI,CAAC,OAAO,CACnC,MAAM,CAAC,UAAU,EACjB,0CAA0C,CAC3C,CAAC;IACF,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACrC,MAAM,IAAI,KAAK,CACb,kDAAkD,gBAAgB,EAA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,CAAC,CAAC,EAAE,CAAC;QACzE,iFAAiF;QACjF,kFAAkF;QAClF,sDAAsD;QACtD,iFAAiF;QACjF,gCAAgC;QAChC,MAAM,aAAa,GACjB,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC;QACzD,gBAAgB,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,IAAI,CAC/C,gBAAgB,CAAC,GAAG,CAAC,aAAa,CAAC,EACnC,OAAO,EACP,gBAAgB,CAAC,GAAG,CAAC,iBAAiB,CAAC,EACvC,aAAa,CACd,CAAC;IACJ,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AA7BD,0DA6BC"} \ No newline at end of file diff --git a/src/analyze.ts b/src/analyze.ts index e6b15fe16c..6bd9d87888 100644 --- a/src/analyze.ts +++ b/src/analyze.ts @@ -402,13 +402,10 @@ export async function runFinalize( logger, ); - // WARNING: This does not _really_ end tracing, as the tracer will restore its - // critical environment variables and it'll still be active for all processes - // launched from this build step. - // However, it will stop tracing for all steps past the codeql-action/analyze - // step. - // Delete variables as specified by the end-tracing script - await endTracingForCluster(codeql, config, features); + // If we didn't already end tracing in the autobuild Action, end it now. + if (process.env[EnvVar.AUTOBUILD_DID_COMPLETE_SUCCESSFULLY] !== "true") { + await endTracingForCluster(codeql, config, logger, features); + } return timings; } diff --git a/src/autobuild-action.ts b/src/autobuild-action.ts index 4d34d8a5c5..c08680c5a0 100644 --- a/src/autobuild-action.ts +++ b/src/autobuild-action.ts @@ -21,6 +21,7 @@ import { sendStatusReport, ActionName, } from "./status-report"; +import { endTracingForCluster } from "./tracer-config"; import { checkActionVersion, checkDiskUsage, @@ -125,6 +126,10 @@ async function run() { await runAutobuild(config, language, features, logger); } } + + // End tracing early to avoid tracing analyze. This improves the performance and reliability of + // the analyze step. + await endTracingForCluster(codeql, config, logger, features); } catch (unwrappedError) { const error = wrapError(unwrappedError); core.setFailed( diff --git a/src/tracer-config.ts b/src/tracer-config.ts index f51201fad3..e7c0d7a46d 100644 --- a/src/tracer-config.ts +++ b/src/tracer-config.ts @@ -5,6 +5,7 @@ import { type CodeQL } from "./codeql"; import { type Config } from "./config-utils"; import { Feature, FeatureEnablement } from "./feature-flags"; import { isTracedLanguage } from "./languages"; +import { Logger } from "./logging"; import { ToolsFeature } from "./tools-features"; import { BuildMode } from "./util"; @@ -28,13 +29,27 @@ export async function shouldEnableIndirectTracing( ); } +/** + * Delete variables as specified by the end-tracing script + * + * WARNING: This does not _really_ end tracing, as the tracer will restore its + * critical environment variables and it'll still be active for all processes + * launched from this build step. + * + * However, it will stop tracing for all steps past the current build step. + */ export async function endTracingForCluster( codeql: CodeQL, config: Config, + logger: Logger, features: FeatureEnablement, ): Promise { if (!(await shouldEnableIndirectTracing(codeql, config, features))) return; + logger.info( + "Unsetting build tracing environment variables. Subsequent steps of this job will not be traced.", + ); + const envVariablesFile = path.resolve( config.dbLocation, "temp/tracingEnvironment/end-tracing.json",