Skip to content

artifacts: parent lineage, duck-typed declaration protocol, content-hash versions - #1527

Open
EngHabu wants to merge 3 commits into
mainfrom
haytham/volume-artifacts-core
Open

artifacts: parent lineage, duck-typed declaration protocol, content-hash versions#1527
EngHabu wants to merge 3 commits into
mainfrom
haytham/volume-artifacts-core

Conversation

@EngHabu

@EngHabu EngHabu commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Core plumbing so plugin-provided offloaded assets (Union Volumes first) can publish as artifacts, and so any artifact can carry git-style parent lineage. Pairs with unionai/flyteplugins-union (volume wiring) and rides flyteidl2 2.0.48's repeated parent_artifacts (flyteorg/flyte#7972).

What changed

  • Metadata.parents — ordered parent edges (ArtifactParent or a bare version string = same-name parent), serialized onto ProducedArtifact.parent_artifacts (declarative path) via to_produced_artifact. A bare entry stays keyless on the wire so the service inherits the child's name/scope; ArtifactParent carries a key only when overriding.
  • Metadata.version_from_content — opt-in: an empty version resolves to the literal's content hash (Literal.hash) at conversion/create time, so republishing identical content is idempotent. Opt-in on purpose: File/Dir defaults are unchanged.
  • Duck-typed declaration protocol — output conversion now recognizes any top-level output exposing get_flyte_metadata() -> Metadata | None, not just ArtifactWrapper. A new current_output_declares_artifact() contextvar (set only for the output actually being declared, never for nested values) lets the value's transformer stamp registry knowledge into the serialized value.
  • Artifact.create(parents=...) — imperative path parity: fills ArtifactSpec.parent_artifacts; duck metadata seeds name/version/description/attrs/card/parents exactly like the wrapper does; ensure_artifactable accepts protocol-carrying values.
  • flyteidl2 pinned to 2.0.48 (incl. rs_controller pyproject/Cargo pins + lock checksums).

Testing

  • tests/flyte/test_produces_artifacts.py: parent serialization shapes, ordered multi-parents, duck-typed declaration + contextvar behavior, content-hash version precedence (explicit > hash > empty).
  • tests/flyte/remote/test_artifact.py: create(parents=...) wire shapes, duck seeding, hash-defaulted versions.
  • Full artifact/convert suites green locally (205 passed).

🤖 Generated with Claude Code

https://claude.ai/code/session_01N415hnSCNmZ2e7WrwEPJo7

@EngHabu
EngHabu force-pushed the haytham/volume-artifacts-core branch 2 times, most recently from 37cae94 to bdf15eb Compare September 3, 2026 20:15
…ash versions

- Metadata gains parents (ordered ArtifactParent | bare-version entries,
  serialized to the new repeated parent_artifacts on both ProducedArtifact
  and ArtifactSpec) and version_from_content (opt-in: an empty version
  resolves to the literal's content hash at conversion/create time, making
  republish of identical content idempotent).
- Output conversion duck-types get_flyte_metadata() on top-level outputs so
  offloaded-asset types outside flyte.io (e.g. plugin volumes) can declare
  themselves; a new current_output_declares_artifact contextvar tells the
  value's transformer when a declaration is actually being emitted.
- ensure_artifactable and Artifact.create accept protocol-carrying values;
  create() gains parents= and seeds defaults from duck metadata like it does
  from the wrapper.
- flyteidl2 pinned to 2.0.48 (repeated parent_artifacts), incl. rs_controller.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N415hnSCNmZ2e7WrwEPJo7
Signed-off-by: Haytham Abuelfutuh <haytham@union.ai>
@EngHabu
EngHabu force-pushed the haytham/volume-artifacts-core branch from bdf15eb to 1a4ef4a Compare September 3, 2026 20:21
EngHabu and others added 2 commits September 3, 2026 20:25
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N415hnSCNmZ2e7WrwEPJo7
Signed-off-by: Haytham Abuelfutuh <haytham@union.ai>
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