Skip to content

LoggedArtifact

Description¶

Comet Artifacts allow keeping track of assets beyond any particular experiment. The LoggedArtifact is a Comet Artifact that already logged to the Comet servers and can be used to access the artifact version assets and download them locally.

Examples¶

library(cometr)
# Assuming you have COMET_API_KEY, COMET_WORKSPACE, COMET_PROJECT_NAME variables define
exp <- create_experiment()

# Get a Comet Artifact
artifact <- exp$get_artifact(artifact_name = "workspace/artifact-name:versionOrAlias")

exp$stop()

Methods¶

Public Methods¶

Method new()¶

Creates new LoggedArtifact object with provided parameters. Do not use this method directly. Use Experiment$get_artifact() to retrieve LoggedArtifact.

Usage

LoggedArtifact$new(
  artifact_name,
  artifact_type,
  artifact_id,
  artifact_version_id,
  workspace,
  experiment_key,
  artifact_version,
  aliases,
  artifact_tags,
  version_tags,
  size,
  metadata = NULL,
  source_experiment_key = NULL
)

Arguments:

  • artifact_name (Required) Artifact name.
  • artifact_type (Required) The artifact type.
  • artifact_id (Required) The ID of artifact.
  • artifact_version_id (Required) The ID of Artifact Version.
  • workspace (Required) The workspace where artifact saved.
  • experiment_key (Required) The ID of the associated experiment.
  • artifact_version (Required) The latest artifact version.
  • aliases (Required) List of Artifact Version aliases.
  • artifact_tags (Required) The list of artifact tags.
  • version_tags (Required) List of Artifact Version tags.
  • size (Required) The total size of logged artifact version. It is the sum of all the artifact version assets.
  • metadata The meta-data of Artifact Version.
  • source_experiment_key The ID of the experiment that created this artifact version.

Method get_artifact_name()¶

Get the name of the artifact.

Usage

LoggedArtifact$get_artifact_name()

Method get_artifact_type()¶

Get the type of the artifact.

Usage

LoggedArtifact$get_artifact_type()

Method get_artifact_version()¶

Get the version of the artifact.

Usage

LoggedArtifact$get_artifact_version()

Method get_artifact_id()¶

Get the ID of the artifact.

Usage

LoggedArtifact$get_artifact_id()

Method get_artifact_tags()¶

Get the tags of the artifact.

Usage

LoggedArtifact$get_artifact_tags()

Method get_aliases()¶

Get the version of the artifact.

Usage

LoggedArtifact$get_aliases()

Method get_metadata()¶

Get the metadata of the artifact.

Usage

LoggedArtifact$get_metadata()

Method get_version_tags()¶

Get the list of tags of the artifact version.

Usage

LoggedArtifact$get_version_tags()

Method get_workspace()¶

Get the workspace of the Artifact.

Usage

LoggedArtifact$get_workspace()

Method get_artifact_version_id()¶

The ID of current Artifact Version

Usage

LoggedArtifact$get_artifact_version_id()

Method get_source_experiment_key()¶

The ID of the experiment that created this artifact version.

Usage

LoggedArtifact$get_source_experiment_key()

Method get_experiment_key()¶

The ID of the associated experiment.

Usage

LoggedArtifact$get_experiment_key()

Method size()¶

Get/set artifact size.

Usage

LoggedArtifact$size(size = NULL)

Arguments:

  • size The new size for the Artifact or NULL if retrieving existing size of the Artifact.

Method get_assets()¶

Get the list of all LoggedArtifactAsset that have been logged with this LoggedArtifact from Comet server.

Usage

LoggedArtifact$get_assets()

Method get_remote_assets()¶

Get the list of remote LoggedArtifactAsset that have been logged with this LoggedArtifact from Comet server.

Usage

LoggedArtifact$get_remote_assets()

Method update_artifact_tags()¶

Update the logged artifact tags

Usage

LoggedArtifact$update_artifact_tags(artifact_tags)

Arguments:

  • artifact_tags The new tags for the artifact

Method update_version_tags()¶

Update the logged artifact version tags

Usage

LoggedArtifact$update_version_tags(version_tags)

Arguments:

  • version_tags The new tags for the artifact version

Method update_aliases()¶

Update the logged artifact version aliases

Usage

LoggedArtifact$update_aliases(aliases)

Arguments:

  • aliases The new aliases for the artifact version

Method download()¶

Download the current Artifact Version assets to a given directory (or the local directory by default). This downloads only non-remote assets.

Usage

LoggedArtifact$download(path = NULL, overwrite_strategy = FALSE)

Arguments:

  • path Where to download artifact version assets. If not provided, a temporary path will be used.
  • overwrite_strategy One of the three possible strategies to handle conflict when trying to download an artifact version asset to a path with an existing file. See below for allowed values. Default is FALSE or "FAIL". Overwrite strategy allowed values: \itemize{ \item FALSE or "FAIL": If a file already exists and its content is different, raise the error. \item "PRESERVE": If a file already exists and its content is different, show a WARNING but preserve the existing content. \item TRUE or "OVERWRITE": If a file already exists and its content is different, replace it by the asset version asset. }

Returns:

Artifact object.

Nov. 18, 2024