Skip to content

[yaml] - Add PubSubToAlloyDBEmbeddings streaming ML blueprint and IT - #4683

Draft
derrickaw wants to merge 2 commits into
mainfrom
yaml-ml/pubsub-to-alloydb-embeddings
Draft

derrickaw wants to merge 2 commits into
mainfrom
yaml-ml/pubsub-to-alloydb-embeddings

Conversation

@derrickaw

Copy link
Copy Markdown
Contributor

Summary

Adds a streaming YAML Flex Template blueprint (PubSub_To_AlloyDB_Embeddings_Yaml) and end-to-end integration test (PubSubToAlloyDBEmbeddingsYamlIT) for generating real-time Vertex AI text embeddings from Pub/Sub JSON messages and writing them into an AlloyDB / PostgreSQL pgvector table:

  • yaml/src/main/yaml/PubSubToAlloyDBEmbeddings.yaml:
    • ReadFromPubSub (JSON with default message_id / text_content schema and dead-letter error output)
    • MLTransform (VertexAITextEmbeddings, default text-embedding-005)
    • WriteToAlloyDB with GoogleCloudSecretManager support and parameterized ?::vector insert query
    • Dead-letter MapToFields error flattening + WriteToAlloyDB error table sink
  • yaml/src/main/python/options/ml_options.yaml: Reusable ml_transform_common_options and vertex_ai_text_embeddings_options parameter groups.
  • yaml/src/main/java/com/google/cloud/teleport/templates/yaml/PubSubToAlloyDBEmbeddingsYaml.java: Generated via generate_yaml_java_templates.py.
  • yaml/README_PubSub_To_AlloyDB_Embeddings_Yaml.md: Generated via mvn prepare-package -DskipTests -PtemplatesSpec -pl yaml -am.
  • yaml/src/test/java/com/google/cloud/teleport/templates/yaml/PubSubToAlloyDBEmbeddingsYamlIT.java: Streaming IT using pgvector/pgvector:pg16, Google Cloud Secret Manager, and Pub/Sub (validating both 768-d pgvector embeddings and malformed-message error routing).

Verification

  • python yaml/src/main/python/generate_yaml_java_templates.py yaml/src/main/yaml (clean diff)
  • yaml_syntax_test.py and generate_yaml_java_templates_test.py passed
  • mvn spotless:check checkstyle:check test-compile test -pl yaml passed with 0 Checkstyle violations
  • Running YAML/Python PR integration tests on this Draft PR to verify live Dataflow execution

@codecov

codecov Bot commented Dec 6, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 38.04%. Comparing base (ebee63d) to head (28db632).

❗ There is a different number of reports uploaded between BASE (ebee63d) and HEAD (28db632). Click for more details.

HEAD has 15 uploads less than BASE
Flag BASE (ebee63d) HEAD (28db632)
16 1
Additional details and impacted files
@@              Coverage Diff              @@
##               main    #4683       +/-   ##
=============================================
- Coverage     60.36%   38.04%   -22.32%     
+ Complexity     8503      533     -7970     
=============================================
  Files          1126      197      -929     
  Lines         73006    12070    -60936     
  Branches       8880     1240     -7640     
=============================================
- Hits          44069     4592    -39477     
+ Misses        26007     7102    -18905     
+ Partials       2930      376     -2554     
Components Coverage Δ
spanner-templates ∅ <ø> (∅)
spanner-import-export ∅ <ø> (∅)
spanner-live-forward-migration ∅ <ø> (∅)
spanner-live-reverse-replication ∅ <ø> (∅)
spanner-bulk-migration ∅ <ø> (∅)
gcs-spanner-dv ∅ <ø> (∅)
see 951 files with indirect coverage changes
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant