Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 5 additions & 21 deletions flyteidl2/artifact/artifact.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package flyteidl2.artifact;
import "buf/validate/validate.proto";
import "flyteidl2/common/identifier.proto";
import "flyteidl2/common/identity.proto";
import "flyteidl2/core/artifact_id.proto";
import "flyteidl2/core/literals.proto";
import "flyteidl2/core/types.proto";
import "google/protobuf/timestamp.proto";
Expand Down Expand Up @@ -47,19 +48,6 @@ message ArtifactIdentifier {
];
}

// Reference to a previously uploaded card (model/data card) describing the
// artifact.
message Card {
// URI of the uploaded card content.
string uri = 1 [(buf.validate.field).string.max_len = 1024];

// Format of the card, e.g. html, md, json, yaml, csv, tsv, png, jpg, jpeg.
string format = 2 [(buf.validate.field).string.max_len = 16];

// Type of the card, e.g. model, data, generic.
string type = 3 [(buf.validate.field).string.max_len = 16];
}

// The task action attempt that produced an artifact. A dedicated message
// (rather than common.ActionAttemptIdentifier) because producing attempts are
// 0-based while that identifier validates attempt > 0.
Expand Down Expand Up @@ -96,14 +84,10 @@ message ArtifactSpec {
// The Flyte type of the value.
core.LiteralType type = 2 [(buf.validate.field).required = true];

// Optional human readable description.
string description = 3 [(buf.validate.field).string.max_len = 255];

// Free-form, user-supplied key/value metadata.
map<string, string> user_metadata = 4;

// Optional card describing this artifact.
Card card = 5;
// Descriptive payload (description, user metadata, card). Shared with the
// production declaration (task.ProducedArtifact.info), so task-produced
// artifacts carry it verbatim.
core.ArtifactInfo info = 3;

// Optional provenance: what produced this artifact. Clients (including the
// SDK, which stamps this automatically when publishing from inside a
Expand Down
37 changes: 37 additions & 0 deletions flyteidl2/core/artifact_id.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ syntax = "proto3";

package flyteidl2.core;

import "buf/validate/validate.proto";
import "google/protobuf/timestamp.proto";

option go_package = "github.com/flyteorg/flyte/v2/gen/go/flyteidl2/core";
Expand All @@ -14,6 +15,42 @@ message ArtifactKey {
string org = 4;
}

// Identity of one artifact version. Unlike the legacy ArtifactID below, this
// carries no partition machinery — it is the minimal identity stamped onto
// values (core.Literal.artifact_id) and referenced by v2 artifact APIs.
message ArtifactVersionId {
ArtifactKey key = 1;
string version = 2;
}

// Reference to a previously uploaded card (model/data card) describing an
// artifact.
message ArtifactCard {
// URI of the uploaded card content.
string uri = 1 [(buf.validate.field).string.max_len = 1024];

// Format of the card, e.g. html, md, json, yaml, csv, tsv, png, jpg, jpeg.
string format = 2 [(buf.validate.field).string.max_len = 16];

// Type of the card, e.g. model, data, generic.
string type = 3 [(buf.validate.field).string.max_len = 16];
}

// Descriptive payload of an artifact — shared by the production declaration
// (task.ProducedArtifact) and the stored spec (artifact.ArtifactSpec).
// Deliberately excludes identity (name/version): identity lives in
// ArtifactIdentifier / the declaration, so it can never drift against this.
message ArtifactInfo {
// Optional human readable description.
string description = 1 [(buf.validate.field).string.max_len = 255];

// Free-form, user-supplied key/value metadata.
map<string, string> user_metadata = 2;

// Optional card describing this artifact.
ArtifactCard card = 3;
}

// Only valid for triggers
message ArtifactBindingData {
reserved 1 to 4;
Expand Down
8 changes: 8 additions & 0 deletions flyteidl2/core/literals.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ syntax = "proto3";
package flyteidl2.core;

import "buf/validate/validate.proto";
import "flyteidl2/core/artifact_id.proto";
import "flyteidl2/core/types.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/struct.proto";
Expand Down Expand Up @@ -116,6 +117,13 @@ message Literal {

// Additional metadata for literals.
map<string, string> metadata = 5;

// Identity of the artifact this value is / came from. Set once at artifact
// registration (and by clients when binding a fetched artifact as an input);
// it travels with the value through every copy. Participates in cache-key
// hashing by design: two versions of an artifact are distinct inputs even
// when their bytes coincide.
ArtifactVersionId artifact_id = 9;
}

// A message that contains the metadata of the offloaded data.
Expand Down
49 changes: 48 additions & 1 deletion flyteidl2/task/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ syntax = "proto3";
package flyteidl2.task;

import "buf/validate/validate.proto";
import "flyteidl2/core/artifact_id.proto";
import "flyteidl2/core/interface.proto";
import "flyteidl2/core/literals.proto";
import "flyteidl2/core/types.proto";
import "google/protobuf/timestamp.proto";

option go_package = "github.com/flyteorg/flyte/v2/gen/go/flyteidl2/task";
Expand Down Expand Up @@ -63,6 +65,21 @@ enum TriggerAutomationSpecType {
TYPE_UNSPECIFIED = 0;
TYPE_NONE = 1;
TYPE_SCHEDULE = 2;
TYPE_ARTIFACT = 3;
}

// Fires a run when a new version of the named artifact is created.
message ArtifactTrigger {
// Name of the artifact to watch, scoped to the trigger's org/project/domain.
string artifact_name = 1 [(buf.validate.field).string.min_len = 1];

// Optional: fire only when exactly this version is created. Empty means any new version.
string version = 2;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it this really needed?


// Name of the task input variable that the triggering artifact's value will be supplied to
// when the run is kicked off. Mirrors Schedule.kickoff_time_input_arg. Optional; empty means
// the artifact is not bound to any input.
string input_arg = 3;
}

message TriggerAutomationSpec {
Expand All @@ -74,7 +91,9 @@ message TriggerAutomationSpec {
oneof automation {
Schedule schedule = 2;

// In future will be extended with other automation types: webhook, artifacts, etc.
ArtifactTrigger artifact = 3;

// In future will be extended with other automation types: webhook, etc.
}
}

Expand Down Expand Up @@ -110,8 +129,36 @@ message Inputs {
repeated flyteidl2.core.KeyValuePair context = 2;
}

// Declares that a named output of the producing action is a new artifact
// version. The output's literal (in Outputs.literals) is the artifact's value;
// org/project/domain come from the producing action's scope at registration.
message ProducedArtifact {
// Name of the NamedLiteral in Outputs.literals this declaration refers to.
string output = 1 [(buf.validate.field).string.min_len = 1];

// Artifact name to register under.
string name = 2 [(buf.validate.field).string.min_len = 1];

// Optional explicit version. Empty means the backend derives one
// (<run>-<action>-<attempt>).
string version = 3;

// Descriptive payload, copied verbatim into ArtifactSpec.info.
flyteidl2.core.ArtifactInfo info = 4;

// The declared Flyte type of the output, copied into ArtifactSpec.type.
// The producing SDK is authoritative for this.
flyteidl2.core.LiteralType type = 5;
}

// Output payload for an action.
message Outputs {
// Ordered outputs. THIS FIELD MUST REMAIN FIRST as this would break Run service assumptions if it were to move.
repeated NamedLiteral literals = 1;

// Artifact registration declarations for outputs wrapped as artifacts by the
// producing task. Field 3 (not 2) on purpose: outputs.pb blobs are sometimes
// cross-decoded as task.Inputs, where field 2 is `context`; field 3 is unused
// there, so this never aliases.
repeated ProducedArtifact produced_artifacts = 3;
}
2 changes: 2 additions & 0 deletions flyteidl2/workflow/run_definition.proto
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,8 @@ enum RunSource {
// The run is orchestrated outside the platform (e.g. on a user's machine) and its state is
// reported via LocalRunService.
RUN_SOURCE_LOCAL = 4;

RUN_SOURCE_ARTIFACT_TRIGGER = 5;
}

// TaskGroup represents a group of runs for a specific task.
Expand Down
Loading
Loading