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¶
LoggedArtifact$new()LoggedArtifact$get_artifact_name()LoggedArtifact$get_artifact_type()LoggedArtifact$get_artifact_version()LoggedArtifact$get_artifact_id()LoggedArtifact$get_artifact_tags()LoggedArtifact$get_aliases()LoggedArtifact$get_metadata()LoggedArtifact$get_version_tags()LoggedArtifact$get_workspace()LoggedArtifact$get_artifact_version_id()LoggedArtifact$get_source_experiment_key()LoggedArtifact$get_experiment_key()LoggedArtifact$size()LoggedArtifact$get_assets()LoggedArtifact$get_remote_assets()LoggedArtifact$update_artifact_tags()LoggedArtifact$update_version_tags()LoggedArtifact$update_aliases()LoggedArtifact$download()
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.metadataThe meta-data of Artifact Version.source_experiment_keyThe 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:
sizeThe new size for the Artifact orNULLif 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_tagsThe new tags for the artifact
Method update_version_tags()¶
Update the logged artifact version tags
Usage
LoggedArtifact$update_version_tags(version_tags)
Arguments:
version_tagsThe new tags for the artifact version
Method update_aliases()¶
Update the logged artifact version aliases
Usage
LoggedArtifact$update_aliases(aliases)
Arguments:
aliasesThe 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:
pathWhere to download artifact version assets. If not provided, a temporary path will be used.overwrite_strategyOne 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 isFALSEor "FAIL". Overwrite strategy allowed values: \itemize{ \itemFALSEor "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. \itemTRUEor "OVERWRITE": If a file already exists and its content is different, replace it by the asset version asset. }
Returns:
Artifact object.