Hi folks! Question about the Artifact annotation ...
# contribute
g
Hi folks! Question about the Artifact annotation support inside of Flytekit --I see that there is an ArtifactTag supported in the protobuf, but it's not actually plumbed into flytekit. Was this by design? This is how things are modeled in Proto -- https://github.com/flyteorg/flyte/blob/a058fd15c5bf7a4f027295d2f7bb4d9851ccf094/flyteidl/protos/flyteidl/core/artifact_id.proto#L78-L112 Variables can have both an artifact partial id and artifact tag per https://github.com/flyteorg/flytekit/blob/a9c9c46934e57207d4b4fd03ad3ed986e4b2b6c9/flytekit/models/interface.py#L29-L30 But there's no tagging convention defined in https://github.com/flyteorg/flytekit/blob/master/flytekit/core/artifact.py
I've hacked together something locally that will propagate a tag along with the artifact metadata -- but the structure of the API response for a workflow execution is a little odd given the tag gets written to the property "value" and is returned like this:
Copy code
"outputs": {
  "variables": {
    "o0": {
      "type": {
        "blob": {
          "format": "",
          "dimensionality": "SINGLE"
        },
        "metadata": null,
        "annotation": null,
        "structure": null
      },
      "description": "o0",
      "artifactPartialId": {
        "artifactKey": {
          "project": "",
          "domain": "",
          "name": "default",
          "org": ""
        },
        "version": "",
        "partitions": {
          "value": {
            "file": {
              "staticValue": "test.file"
            },
            "group": {
              "staticValue": "task_output"
            },
            "type": {
              "staticValue": "data"
            }
          }
        },
        "timePartition": null
      },
      "artifactTag": {
        "artifactKey": {
          "project": "foo",
          "domain": "",
          "name": "test",
          "org": ""
        },
        "value": {
          "staticValue": "tagvalue"
        }
      }
    }
  }
}
},
It makes me think it may have been intentional to not support tags?
The other funny thing is that it's technically possible to write different artifact keys for the same artifact (as demonstrated in the above response) -- which doesn't seem good 😉
There is a
version
field for the artifact at https://github.com/flyteorg/flytekit/blob/master/flytekit/core/artifact.py#L403-L404 The docs advise against setting version, but I assume this must apply only to Union? Inline docs state that
project
and
domain
should also not be provided as they'll be set automatically. That's clearly not happening in open source Flyte given the above response -- so I'm wonder if it's "safe" to put a user specified value in
version
or not?
d
Artifact question, cc @thankful-minister-83577