@@ -291,6 +291,8 @@ ext {
291291 ' :metadata-jobs:mae-consumer-job' ,
292292 ' :datahub-actions' ,
293293 ' :docker:datahub-ingestion' ,
294+ ' :docker:datahub-gms-onnx' ,
295+ ' :docker:datahub-upgrade-onnx' ,
294296 ]
295297 ]
296298 ]
@@ -325,6 +327,16 @@ ext {
325327 return activeProfile
326328 }
327329
330+ // Helper function to read the captured quickstart task name from file.
331+ // Distinct from the profile: some debug stacks share a compose profile (quickstartDebug and
332+ // quickstartDebugBuiltinEmbedding both use 'debug'), so reload[Env] needs the exact task to
333+ // rebuild stack-specific artifacts like the onnx boot archives.
334+ readCapturedTaskName = {
335+ def composeFileName = new File (compose_base). getName()
336+ def taskFile = new File (rootProject. buildDir, composeFileName. replace(' .yml' , ' -task.txt' ))
337+ return taskFile. exists() ? taskFile. text. trim() : null
338+ }
339+
328340 // Helper function to find the taskName and config that uses a given profile (only searches debug tasks)
329341 // Returns a map with 'taskName' and 'config' keys
330342 findTaskNameByProfile = { profile ->
@@ -661,8 +673,13 @@ quickstart_configs.each { taskName, config ->
661673 }
662674}
663675
664- // quickstartDebugBuiltinEmbedding auto-downloads the ONNX model if not present
665- tasks. getByName(" quickstartDebugBuiltinEmbeddingComposeUp" ). dependsOn(tasks. getByName(" prepareOnnxModel" ))
676+ // quickstartDebugBuiltinEmbedding auto-downloads the ONNX model if not present, and builds the
677+ // onnx boot archives that docker-compose.onnx-override.yml mounts over the default war/jar so the
678+ // debug stack exercises the real ONNX-variant artifacts.
679+ tasks. getByName(" quickstartDebugBuiltinEmbeddingComposeUp" ). dependsOn(
680+ tasks. getByName(" prepareOnnxModel" ),
681+ ' :metadata-service:war:onnxBootJar' ,
682+ ' :datahub-upgrade:onnxBootJar' )
666683
667684
668685tasks. register(' minDockerCompose2.20' , Exec ) {
@@ -781,6 +798,12 @@ tasks.withType(ComposeUp).configureEach {
781798 profileFile. text = primaryProfile
782799
783800 logger. lifecycle(" Captured profile '${ primaryProfile} ' to ${ profileFile.absolutePath} " )
801+
802+ // Also record the exact quickstart task. Profiles are not unique across debug stacks
803+ // (quickstartDebug and quickstartDebugBuiltinEmbedding both use 'debug'), so reload[Env]
804+ // reads this to rebuild stack-specific artifacts like the onnx boot archives.
805+ def taskFile = new File (rootProject. buildDir, composeFileName. replace(' .yml' , ' -task.txt' ))
806+ taskFile. text = taskBaseName
784807 }
785808 }
786809}
@@ -807,6 +830,15 @@ tasks.register("reload", Exec) {
807830
808831 // Dynamically depend on the correct prepareAll task
809832 dependsOn tasks. named(" prepareAll${ matchingTaskName} " )
833+
834+ // The builtin-embedding stack mounts the onnx boot archives (war-onnx.war /
835+ // datahub-upgrade-onnx.jar) over the defaults, so reload must rebuild THOSE or the
836+ // containers keep running stale variant code after a source change. Key off the
837+ // captured task, not matchingTaskName: builtin-embedding shares the 'debug' profile
838+ // with quickstartDebug, so profile lookup resolves to quickstartDebug here.
839+ if (readCapturedTaskName. call() == ' quickstartDebugBuiltinEmbedding' ) {
840+ dependsOn ' :metadata-service:war:onnxBootJar' , ' :datahub-upgrade:onnxBootJar'
841+ }
810842 }
811843 }
812844
@@ -864,6 +896,15 @@ tasks.register("reloadEnv", Exec) {
864896 matchingConfig = matchingTask. config
865897 // Dynamically depend on the correct prepareAll task
866898 dependsOn tasks. named(" prepareAll${ matchingTaskName} " )
899+
900+ // The builtin-embedding stack mounts the onnx boot archives (war-onnx.war /
901+ // datahub-upgrade-onnx.jar) over the defaults, so reloadEnv must rebuild THOSE or the
902+ // recreated containers keep running stale variant code after a source change. Key off
903+ // the captured task, not matchingTaskName: builtin-embedding shares the 'debug'
904+ // profile with quickstartDebug, so profile lookup resolves to quickstartDebug here.
905+ if (readCapturedTaskName. call() == ' quickstartDebugBuiltinEmbedding' ) {
906+ dependsOn ' :metadata-service:war:onnxBootJar' , ' :datahub-upgrade:onnxBootJar'
907+ }
867908 }
868909 }
869910
0 commit comments