Package: cometx
cometx_________  ____ ___  ___  / /__  __
  / ___/ __ \/ __ `__ \/ _ \/ __/ |/_/
 / /__/ /_/ / / / / / /  __/ /__>  <
 \___/\____/_/ /_/ /_/\___/\__/_/|_|Open source extensions for theCometSDK.These extensions are created and supported by the community and are
not an official project of Comet ML. We welcome contributions!Installationpip install cometxTo use these command-line functions, you'll need to have your Comet
API key set in one of the following two ways.Environment variablesComet config fileEither this way:export COMET_API_KEY="YOUR-COMET-API-KEY"or this way:[comet]
api_key = YOUR-COMET-API-KEYIf you are an Comet on-prem user, you'll also need to set theCOMET_URL_OVERRIDEenvironment variable, or add it to your~/.comet.configfile as below:Either this way:export COMET_API_KEY="YOUR-COMET-API-KEY"
export COMET_URL_OVERRIDE="https://your-companys-comet.com/clientlib/"or this way:[comet]
api_key = YOUR-COMET-API-KEY
url_override = https://your-companys-comet.com/clientlib/Usagecometxis composed of a series of subcommands that are useful
independently, and can be used together to create sophisticated tools
for ML management.This section will examine some common uses, followed by a more
detailed exploration of each subcommand.Use CasesIn this section we'll explore some common scenarios.Copy a specific project from one Comet installation to anotherCopy all projects in workspace to a new workspaceCopy specific experiments in a project to new experiments1. Copy a specific project from one comet installation to anotherA useful idiom is to set your Comet environment variables on the line
of a subcommand. In this manner, you can set theCOMET_URL_OVERRIDEandCOMET_API_KEYfor different installations.Of course, you don't have to set the environment variables if you are
copying experiments on the same Comet installation.Here is how you one could download the experiments in
WORKSPACE/PROJECT fromhttp://comet.a.com:COMET_URL_OVERRIDE=http://comet.a.com/clientlib\COMET_API_KEY=A-KEY\cometxdownloadWORKSPACE/PROJECTThecometx downloadsubcommand downloads all of the Comet experiment
data into local files. Note that WORKSPACE/PROJECT refers to a
workspace and project onhttp://comet.a.com.One could then copy the downloaded experiment data with a similar command:COMET_URL_OVERRIDE=http://comet.b.com/clientlib\COMET_API_KEY=B-KEY\cometxcopyWORKSPACE/PROJECTNEW-WORKSPACE/NEW-PROJECTNote that WORKSPACE/PROJECT now refers to a directory, and
NEW-WORKSPACE/NEW-PROJECT refers to a workspace and project onhttp://comet.b.com.2. Copy all projects in workspace to a new workspaceSimilarly, one can copy all of the projects by first downloading them:COMET_URL_OVERRIDE=http://comet.a.com/clientlib\COMET_API_KEY=A-KEY\cometxdownloadWORKSPACEand then copying them:COMET_URL_OVERRIDE=http://comet.b.com/clientlib\COMET_API_KEY=B-KEY\cometxcopyWORKSPACENEW-WORKSPACE3. Copy specific experiments in a project to new experimentsSimilarly, one can copy a single experiment first downloading it:COMET_URL_OVERRIDE=http://comet.a.com/clientlib\COMET_API_KEY=A-KEY\cometxdownloadWORKSPACE/PROJECT/EXPERIMENT-NAME-OR-IDand then copying it:COMET_URL_OVERRIDE=http://comet.b.com/clientlib\COMET_API_KEY=B-KEY\cometxcopyWORKSPACE/PROJECT/EXPERIMENT-NAME-OR-IDNEW-WORKSPACE/NEW-PROJECTSubcommandscometx listcometx downloadcometx copycometx logcometx reproducecometx delete-assetsFor all subcommands, use the--helpflag to get additional information.cometx listThis command is used to:get a list of all workspaces that you are a member ofget a list of all projects in a workspaceget a list of all experiments (by name or key) in a projectcometx list examples:cometx list WORKSPACE/PROJECT/EXPERIMENT-KEY-OR-NAME
cometx list WORKSPACE/PROJECT
cometx list WORKSPACE
cometx listFlags--query- use to limit the experiments to download (seeexperiment.api.query()for more information)-u,--use-name- use experiment names for experiment folders and listingsFor more information,cometx list --helpcometx copyThis command is used to:copy downloaded data to a new experimentcreate a symlink from one project to existing experimentscometx copy examples:cometx SOURCE DESTINATION
cometx --symlink SOURCE DESTINATIONwhere SOURCE is:if not--symlink, "WORKSPACE/PROJECT/EXPERIMENT", "WORKSPACE/PROJECT/", or "WORKSPACE//*" folder (use quotes)if--symlink, then it is a Comet path to workspace or workspace/projectwhere DESTINATION is:WORKSPACEWORKSPACE/PROJECTNot all combinations are possible:Destination →Source ↓WORKSPACEWORKSPACE/PROJECTWORKSPACE/*/*Copies all projectsN/AWORKSPACE/PROJ/*N/ACopies all experimentsWORKSPACE/PROJ/EXPN/ACopies experimentFor more information,cometx copy --helpcometx downloadThis command is used to:download all workspaces, projects, and experiments of workspaces that you are a member ofdownload all projects, and experiments of a given workspacedownload all experiments of a given workspace/projectcometx dowload examples:cometx download WORKSPACE/PROJECT/EXPERIMENT-KEY-OR-NAME [RESOURCE ...] [FLAGS ...]
cometx download WORKSPACE/PROJECT [RESOURCE ...] [FLAGS ...]
cometx download WORKSPACE [RESOURCE ...] [FLAGS ...]
cometx download [RESOURCE ...] [FLAGS ...]Where [RESOURCE ...] is zero or more of the following names:assetshtmlmetadatametricsothersparametersproject - alias for: project_notes, project_metadatarun - alias for: code, git, output, graph, and requirementssystemIf no RESOURCE is given it will download all of them.Flags--query- use to limit the experiments to download (seeexperiment.api.query()for more information)--list- use to list available workspaces, projects, experiments,
artifacts, or models (same ascometx list)--output- download resources to folder other than current one--flat- don't use the normal hiearchy for downloaded items--use-name- use experiment names for folders and listings--ignore- don't download the following resources (use one or more
RESOURCE names from above)--asset-type- asset type to match, or leave off to match all--filename- filename to match, or leave off to match all--overwrite- overwrite any existing files--force- don't ask to download, just do it--help- this messageTo download artifacts:cometx download WORKSPACE/artifacts/NAME [FLAGS ...]
cometx download WORKSPACE/artifacts/NAME/VERSION-OR-ALIAS [FLAGS ...]To download models from the model registry:cometx download WORKSPACE/model-registry/NAME [FLAGS ...]
cometx download WORKSPACE/model-registry/NAME/VERSION-OR-STAGE [FLAGS ...]For more information,cometx download --helpcometx logThis command is used to log a resource (metrics, parameters, asset,
etc) file to a specific experiment or experiments.cometx log example:cometx log WORKSPACE/PROJECT/EXPERIMENT-KEY-OR-NAME [--type TYPE] FILENAME.EXTwhere TYPE is the asset type of the filename. TYPE is not needed if the
filename extension (FILENAME.EXT) is known.Known extensions:pngjpggiftxtwebmmp4oggipynbwavmp3Known types:assetimagetext-samplevideoipynbaudioExample to set an other key:value:cometx log WORKSPACE/PROJECT --type other --set "key:value"
cometx log WORKSPACE/PROJECT/EXPERIMENT-KEY-OR-NAME --type other --set "key:value"The first version will set the other key:value in all experiments in a project, and the second will set the other key:value in the experiment.Example to log all items:cometx log WORKSPACE/PROJECT PATH-TO-DOWNLOAD --type all
cometx log WORKSPACE/PROJECT/EXPERIMENT-KEY-OR-NAME PATH-TO-DOWNLOAD --type allThe first version will create an experiment, and the second will log everything to an existing experiment.Flags--query- use to limit the experiments to download (seeexperiment.api.query()for more information)--type- the type of item to log--set- the "key:value" to logFor more information,cometx log --helpcometx delete-assetsTo delete experiments assets:cometx delete-assets WORKSPACE/PROJECT --type=image
cometx delete-assets WORKSPACE/PROJECT/EXPERIMENT --type=allType can be valid asset tupe, including:allassetaudiocodeimagenotebooktext-samplevideoFor more information,cometx delete-assets --helpcometx reproducecometx reproduce [-h] [--run] [--executable EXECUTABLE] COMET_PATH OUTPUT_DIRFor more information,cometx reproduce --helpRunning TestsWARNING: Running the tests will create experiments, models, assets, etc.
in your default workspace if not set otherwise.To run the tests, you can either export all of these items in the
environment:$exportCOMET_USER="<USERNAME>"$exportCOMET_WORKSPACE="<WORKSPACE>"$exportCOMET_API_KEY="<API-KEY>"$pytesttestsOr, defineworkspaceandapi_keyin your ~/.comet.config file:$exportCOMET_USER="<USERNAME>"$pytesttests