Skip to content

Prepare snapshots and ingested training tables on Ray - #584

Draft
haoweiyu-kumo wants to merge 1 commit into
tt_ingestion_preparationfrom
artifact_store_refactor
Draft

haoweiyu-kumo wants to merge 1 commit into
tt_ingestion_preparationfrom
artifact_store_refactor

Conversation

@haoweiyu-kumo

@haoweiyu-kumo haoweiyu-kumo commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Add optional remote Ray preparation and validated native replication on top of #593's shared training-table preparation lifecycle.

This PR targets tt_ingestion_preparation (#593), which targets main. #593 owns moving ingestion out of fit; this PR adds remote execution and storage integration.

  • Run generation on one remote producer, stream completed uploads, and restore native files on each targeted node.
  • Preserve the existing snapshot export format and MLOps training-table row exports. Publish already-ingested extensions separately under native_training_tables/<id>/; workers restore them without ingesting again.
  • Add configuration, bounded replication, request coalescing, on-demand loading, actor recovery, and shutdown. Transport connector settings while opening fresh worker connections.

Redacted snapshots have separate identities. Pinned snapshot handles fail if their export generation is replaced. Earlier draft native caches without preparation completion metadata need rebuilding. Existing snapshot and row-export formats remain unchanged.

Change map

File-by-file change map

Testing Done

  • Restacked integration: artifact, connector serialization, native preparation/restoration, and cluster checks; existing snapshot export/cache checks; explicit multi-node Ray smoke including new nodes, actor recovery, and driver guards.
  • Scoped Ruff, five-source Mypy, and repository documentation checks passed. Standalone local export/fit and shared workflow validation is recorded on Prepare training-table ingestion before fit #593.
  • Live-cloud and separate-host integration remain unverified.

Checklist

  • Listed compatibility changes.
  • Updated usage and storage documentation.
  • Added and updated unit and integration tests.

@copy-pr-bot

copy-pr-bot Bot commented Dec 2, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@haoweiyu-kumo
haoweiyu-kumo temporarily deployed to gha-kumo-workflow-tests December 2, 2026 06:22 — with GitHub Actions Inactive
@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

Parsing warnings: 1

Validation error: Unrecognized key: "tone_instructions" at "reviews"
Configuration instructions

  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Pre-merge checks: Passed 2 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Change Map Design Review Warning The change map comment (NVIDIA/kumo-engine PR #584, comment 7336936473, author haoweiyu-kumo, base tt_ingestion_preparation, head artifact_store_refactor) was retrieved and reviewed against the fetche… Revise the change map and, where needed, the code: 1. Re-run the map against the current PR head (c29d4a2 or its successor). Replace the commit list and verification statements that cite 3120d73, e696098, and 572302a. 2. Add rows or notes f…
Passed Passed checks: 2 passed

Check name Status Explanation
Pr Size Passed The PR (NVIDIA/kumo-engine #584, head artifact_store_refactor, base tt_ingestion_preparation) changes 27 files. The local checkout is at c29d4a2, which is a single commit on top of f11dcdf ("Prepa…
Public Resource Access Passed The check applies only to external resource references added or modified by this PR. I diffed the PR head (c29d4a2) against its base (f11dcdf) and inspected the added lines in all 27 changed files. Ad…
Full details: Pr Size

Explanation

The PR (NVIDIA/kumo-engine #584, head artifact_store_refactor, base tt_ingestion_preparation) changes 27 files. The local checkout is at c29d4a2, which is a single commit on top of f11dcdf ("Prepare training-table ingestion before fit"). I used f11dcdf as the base because the base branch ref is not present locally, and f11dcdf matches the #593 work the PR description says it builds on. git diff f11dcdf HEAD lists 27 files: 7 added and 20 modified. Rename detection is disabled and gives the same count of 27. The count is 27, which does not exceed the threshold of 40, so the check passes. Line counts were ignored, as the check requires. Caveat: the diff against origin/main shows 181 files. That comparison does not match the PR's declared base, so I did not use it. The previous FAIL had no recoverable details. The current measured count is 27, which is under the limit. Prior failure refuted: The prior FAIL gave no details, so its specific claim cannot be checked. Current measurement against the declared base (f11dcdf, the parent of the PR head c29d4a2) shows 27 changed files (7 added, 20 modified, no renames), which is at or below the 40-file limit.

Full details: Public Resource Access

Explanation

The check applies only to external resource references added or modified by this PR. I diffed the PR head (c29d4a2) against its base (f11dcdf) and inspected the added lines in all 27 changed files. Added external references found: - uv.lock (about 231 added lines): package source and artifact URLs on https://pypi.org/simple and https://files.pythonhosted.org. These are public PyPI endpoints. Sampled URL checks returned HTTP 200 for pypi.org/simple/jsonschema/ and a files.pythonhosted.org jsonschema-4.26.0 sdist, both anonymous HEAD requests. The lock file has no git, editable, directory, or private-index sources. - pyproject.toml: adds only the optional dependency cluster=["ray>=2.40,<3"]. It adds no URL or index source. - README.md: kumo.MLOps("s3://my-bucket/kumo") is an illustrative example. - test/test_connector_serialization.py: s3://bucket/prefix and gs://bucket/prefix are test fixture values, not resources the code must reach. - docs/mlops.md: a repository-relative anchor link (../README.md#prepare-artifacts-on-ray). It is not an external reference. No added URL, repository location, or package source points to a non-public resource. The only externally reachable sources are public PyPI, and the sampled ones were confirmed accessible. The remaining s3:// and gs:// values are illustrative or test fixtures, which the check excludes.

Full details: Change Map Design Review

Explanation

The change map comment (NVIDIA/kumo-engine PR #584, comment 7336936473, author haoweiyu-kumo, base tt_ingestion_preparation, head artifact_store_refactor) was retrieved and reviewed against the fetched PR head. Stale map. The comment cites verification at HEAD 3120d73 and commits e696098, 572302a, and 3120d73. The fetched PR head is c29d4a2 ("Add remote artifact preparation on shared ingested tables"). The 3120d73 commit is not in the local clone or on the PR ref. The file list in the map does exist at c29d4a2, so the map describes a different commit set than the current branch. Omitted or misleading behavior, verified in code at c29d4a2: 1. Graph.snapshot (graph.py) raises ValueError when callbacks are passed while a compute cluster is configured. The map does not mention this user-facing API change. 2. preparation_cluster (_compute_cluster.py) raises ValueError when mlops= or a kumo.mlops context is active while a cluster is configured. The map does not mention this. 3. PredictiveQuery.generate_training_table (predictive_query.py) returns cluster.table(...) before the driver-side _require_matching_snapshot call and the path-override checks. The map says behavior is preserved. The checks may still run on the producer against the reloaded snapshot. This is an uncertain design question, not a proven defect. 4. The PR description says earlier draft native caches "need rebuilding." The code does not rebuild them. ArtifactRepository.lookup calls manifest(), which raises ValueError when inventory.json is missing (_read_json returns None for a missing file). cached_table and _publish do not catch this. The map omits this migration behavior, and no README or mlops.md text describes it. 5. Connector reduce pickles the identity object into each worker payload. The map's Why says only "Keep sessions and cached clients local." It does not state that identity objects, including Snowflake passwords used in the serialization test, are sent to workers. The _SecretSerializationMixin secret path applies only in a special serializer context. Whether SecretStr values are written in plain pickle was not verified. This is an uncertain design question. Design gaps. Coalescing, backpressure, on-demand loading, and actor recovery are listed as core scope. The map does not separate optional refinements from required behavior. It does not state the existing behavior it inspected for each row, or why the smallest sufficient change is enough. The prior FAIL had no retrievable details. This run does not rely on it. The check fails on the stale map and the omitted behavior above.

Resolution

Revise the change map and, where needed, the code: 1. Re-run the map against the current PR head (c29d4a2 or its successor). Replace the commit list and verification statements that cite 3120d73, e696098, and 572302a. 2. Add rows or notes for: callbacks rejected under a cluster (Graph.snapshot); mlops= or kumo.mlops rejected under a cluster (preparation_cluster); and the cluster branch bypassing driver-side snapshot and path-override validation in PredictiveQuery.generate_training_table. For each, state whether the behavior is intended. If it is not intended, add the driver-side checks before the cluster branch. 3. For draft native caches, either implement the rebuild the PR description promises (treat a missing or incompatible inventory.json as a cache miss) or change the PR description to state that users must delete the cache. Add a test for that path. 4. In the connector row, state what identity data is sent to workers. Verify SecretStr handling under plain pickle. If secrets are serialized, send identity by reference (resolve on the worker) or use the secret-aware serializer. Otherwise document the decision. 5. Separate required scope from optional refinements (coalescing, backpressure, on-demand loading, actor recovery). For each required row, state the observed failure or requirement, the existing behavior inspected, why this change is the smallest sufficient one, and the focused test that verifies it.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@haoweiyu-kumo

haoweiyu-kumo commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator Author

Requested behavior: prepare snapshots and sampling-ready tables on a remote Ray producer, preserve existing MLOps exports, and replicate native files to sampling nodes. This PR is stacked on #593, which supplies the shared local preparation and ingestion lifecycle.

Implementation scope: add cluster routing, connector transport, producer/replica actors, bounded file notifications, committed native extension publication, and exact-build restoration. Keep the existing snapshot publisher and MLOps training-table row exports. The publisher consumes already-ingested tables; fit's ingestion-free behavior is provided by #593.

Verification after restacking: artifact/connector/native/cluster tests, existing snapshot-format checks, and explicit local multi-node Ray smoke; scoped Ruff, five-source Mypy, and repository documentation checks. #593 separately validates standalone local exports, sampling, CPU fits, adapters, and core workflows against main. Live-cloud and separate-host integration remain unverified.

Stopping condition: every targeted node validates its native files before preparation returns; producer recovery reuses compatible publications; workers restore without ingesting; shutdown preserves Ray and artifacts. Pinned snapshot handles reject replaced generations. Provisioning and distributed training orchestration are outside scope.

Change map

File Function / scope What changed Why
packages/kumo-engine/kumo/engine/connector/base.py, packages/kumo-engine/kumo/engine/connector/adls.py, packages/kumo-engine/kumo/engine/connector/bigquery.py, packages/kumo-engine/kumo/engine/connector/databricks.py, packages/kumo-engine/kumo/engine/connector/file.py, packages/kumo-engine/kumo/engine/connector/gcs.py, packages/kumo-engine/kumo/engine/connector/s3.py, packages/kumo-engine/kumo/engine/connector/snowflake.py Connector reconstruction Pickle constructor settings, including staging options, and recreate backends. Keep sessions and cached clients local to each worker.
packages/kumo-engine/kumo/engine/_artifact_repository.py Storage and replicas Read existing snapshot manifests; publish cluster-only ingested extensions with checksummed inventories; reconcile file events into atomic local caches. Preserve snapshot storage while supporting validated native replication.
packages/kumo-engine/kumo/engine/_artifact_publishers.py, packages/kumo-engine/kumo/engine/_snapshot_io.py Publication and restoration Add file notifications to the existing snapshot exporter; publish prepared table extensions and restore node-local paths with exact-build validation. Preserve MLOps formats and reuse the prepared-table contract from #593.
packages/kumo-engine/kumo/engine/_compute_cluster.py Ray runtime Add producer/replica actors, singleton lifecycle, coalescing, backpressure, on-demand loading, and recovery. Generate off the driver and wait for every targeted replica to validate.
packages/kumo-engine/kumo/engine/config.py, packages/kumo-engine/kumo/engine/__init__.py Public configuration and exports Expose cluster configuration, artifact handles, runtime loaders, and shutdown. Enable automatic routing through existing preparation calls.
packages/kumo-engine/kumo/engine/graph.py Snapshot preparation and loading Probe source versions, route cluster work, preserve precision, isolate redaction, and restore source-recording metadata from existing provenance. Reuse committed snapshot exports without introducing another snapshot format.
packages/kumo-engine/kumo/engine/pquery/predictive_query.py, packages/kumo-engine/kumo/engine/pquery/training_table.py Cluster routing and transport Route preparation to the producer, reuse committed native extensions, and retain pinned handles and per-table provenance on restored objects. Add remote execution on top of #593 without changing local ingestion or row exports.
packages/kumo-engine/test/test_artifact_repository.py Extension storage regressions Cover streaming, immutable reuse, corruption, aborts, reconciliation, and path confinement. Verify native extension publication and replica recovery.
packages/kumo-engine/test/test_compute_cluster.py Configuration and Ray integration Cover routing, coalescing, backpressure, driver guards, new nodes, and actor failures. Verify remote preparation and validated replication through real Ray actors.
packages/kumo-engine/test/test_snapshot_export.py, packages/kumo-engine/test/test_snapshot_manifest.py Snapshot regressions Cover cache invalidation, preserved export layout, provenance isolation, and redaction identity. Verify reuse with the existing snapshot contract.
packages/kumo-engine/README.md, packages/kumo-engine/docs/mlops.md Usage documentation Document cluster configuration, native extension restoration, unchanged MLOps formats, pinned generations, worker requirements, and shutdown. Explain the separate row-export and sampling-extension contracts.
packages/kumo-engine/pyproject.toml, uv.lock Optional Ray dependency Declare the cluster extra and regenerate its dependency resolution. Keep Ray optional and lock its transitive dependencies reproducibly.
packages/kumo-engine/test/test_connector_serialization.py Connector reconstruction regressions Cover connector reconstruction, normalized principal preservation, staging options, and exclusion of cached clients and connection owners. Keep worker connector transport coverage in this PR while identity resolution tests move to #585.
packages/kumo-engine/test/test_ingested_table_replication.py Native restoration regressions Exercise real sampling, unchanged row exports, one-time ingest, cache reuse, path rebinding, build/generation rejection, missed events, and partial-file repair. Verify workers can sample restored extensions without generating or ingesting rows.

@haoweiyu-kumo
haoweiyu-kumo temporarily deployed to gha-kumo-workflow-tests December 2, 2026 07:00 — with GitHub Actions Inactive
@haoweiyu-kumo
haoweiyu-kumo changed the base branch from main to principal-store-removal December 2, 2026 07:01
@haoweiyu-kumo
haoweiyu-kumo temporarily deployed to gha-kumo-workflow-tests December 2, 2026 07:16 — with GitHub Actions Inactive
@haoweiyu-kumo
haoweiyu-kumo temporarily deployed to gha-kumo-workflow-tests December 2, 2026 07:34 — with GitHub Actions Inactive
@haoweiyu-kumo
haoweiyu-kumo force-pushed the artifact_store_refactor branch from 2c1621a to d269f12 Compare December 2, 2026 20:36
@haoweiyu-kumo
haoweiyu-kumo temporarily deployed to gha-kumo-workflow-tests December 2, 2026 20:36 — with GitHub Actions Inactive
haoweiyu-kumo added a commit that referenced this pull request Dec 2, 2026
…tion (#585)

## Summary

Remove the process-global principal store and authenticate provider
connections with explicit `Principal` values. Engine connectors
normalize convenience identities once and pass the same principal to
their backends.

- Give each Snowflake/BigQuery connector a lazy connection owner shared
by its source and sink. Serialize configuration only; close resources
explicitly with `close()` or best effort through `__del__`.
- Keep Snowflake stage filesystems' connection owner alive while they
are in use. Reconnect even when closing a stale session fails.
- Normalize omitted S3/GCS/ADLS/BigQuery identities into explicit
ambient identities. Add `ADLSIdentity()` for local Azure credential
discovery while preserving hosted workload identity requirements.
- Remove registry APIs, authentication lookup/fallback, session adapter
inheritance, and the unused `StageArtifactLocation`. Update consumers,
examples, and tests.

**Breaking changes:** direct Snowflake/BigQuery provider callers must
supply `connection=SnowflakeConnection(principal)` or
`connection=BigQueryConnection(principal)`. Object-store backend
constructors require `identity=principal`, including for ambient
authentication. Names, IDs, slugs, `IdentityRef`, and `DirectIdentity`
no longer supply authentication; use `identity.principal` or construct a
`Principal`. The BigQuery/Snowflake provider-global `close(name)` APIs
and `StageArtifactLocation` export are removed; use the owning connector
and its stage filesystem. Public engine convenience identity
constructors, supported ambient authentication, and remote SDK
identity-management APIs remain available.

This is the prerequisite for #584. Ray execution and connector
serialization remain in that stacked PR.

## Change map

[File-by-file change
map](#585 (comment))

## Testing Done

Non-live provider suites passed: BigQuery 187, Snowflake 242, ADLS 335,
S3 49, GCS 62. API identity tests: 181; core principal tests: 8.
Repository Flake8/isort, focused Ruff, scoped mypy (imports skipped),
and repository documentation checks passed. Engine test collection is
blocked by the available native environment lacking
diskgraph.sampling_plan. Live-cloud tests were not run.

## Checklist

- [x] Documented breaking changes for direct provider callers and
removed registry APIs.
- [x] Updated current-behavior authentication and lifecycle
documentation.
- [x] Added ambient-authentication, cleanup, recovery, serialization,
and isolation regressions.
Base automatically changed from principal-store-removal to main December 2, 2026 22:14
@haoweiyu-kumo
haoweiyu-kumo force-pushed the artifact_store_refactor branch from d269f12 to 572302a Compare December 2, 2026 22:19
@haoweiyu-kumo
haoweiyu-kumo temporarily deployed to gha-kumo-workflow-tests December 2, 2026 22:19 — with GitHub Actions Inactive
@haoweiyu-kumo
haoweiyu-kumo temporarily deployed to gha-kumo-workflow-tests December 2, 2026 23:39 — with GitHub Actions Inactive
@haoweiyu-kumo haoweiyu-kumo changed the title Share native artifact storage and stream Ray preparation to node replicas Prepare snapshots and ingested training tables on Ray Dec 2, 2026
@haoweiyu-kumo
haoweiyu-kumo force-pushed the artifact_store_refactor branch from 3120d73 to c29d4a2 Compare December 3, 2026 06:58
@haoweiyu-kumo
haoweiyu-kumo temporarily deployed to gha-kumo-workflow-tests December 3, 2026 06:58 — with GitHub Actions Inactive
@haoweiyu-kumo
haoweiyu-kumo changed the base branch from main to tt_ingestion_preparation December 3, 2026 06:59

This branch was previously deployed

1 inactive deployment
gha-kumo-workflow-tests — c29d4a25 Deployed Dec 3, 2026 by haoweiyu-kumo via import #3597
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant