ci: build tfjs-node native addon for firestore-semantic-search and storage-reverse-image-search#1073
Open
cabljac wants to merge 2 commits into
Open
ci: build tfjs-node native addon for firestore-semantic-search and storage-reverse-image-search#1073cabljac wants to merge 2 commits into
cabljac wants to merge 2 commits into
Conversation
`npm ci --ignore-scripts` and `lerna bootstrap --ignore-scripts` skip the @tensorflow/tfjs-node postinstall that fetches its native addon (tfjs_binding.node). Without it every firestore-semantic-search suite that requires '@tensorflow/tfjs-node' fails to load, reddening the whole test workflow on every PR. Add a retried step to rebuild the addon from source after bootstrap.
storage-reverse-image-search/functions has the same @tensorflow/tfjs-node dependency and fails to load its test suites in CI for the same --ignore-scripts reason. Generalise the rebuild step to loop over both affected extensions.
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.
Problem
The Testing workflow is red on every PR (e.g. observed on #1059).
firestore-semantic-search:testfails to even load 5 suites:Root cause
.github/workflows/test.yamlinstalls dependencies withnpm ci --ignore-scriptsandlerna bootstrap --ignore-scripts.--ignore-scriptsskips the@tensorflow/tfjs-nodepostinstall, which is what fetches/builds its native addon (tfjs_binding.node) and libtensorflow. Everyfirestore-semantic-searchsuite thatrequire('@tensorflow/tfjs-node')then throws at module load, failinglerna run testand the whole workflow. (Earlier green runs were riding a warmnode_modulescache that still held the addon.)This is unrelated to the historically
xtest-disabled flaky tests in that extension and unrelated to the genai-chatbot flake fix.Fix
Add a retried CI step after bootstrap that rebuilds the addon from source for
firestore-semantic-search/functions:npm rebuild @tensorflow/tfjs-node --build-addon-from-sourceBuilding from source (rather than relying on prebuilt binaries that may not cover the CI Node version) is the robust option and is retried 3× to tolerate transient libtensorflow download failures.