Comet Onprem User Instructions

For those users that are running from an onprem version of www.comet.ml, you will need to set a couple of additional configuration variables.

First, you should make sure that you can import comet_ml. If comet_ml is not installed, you can install it (and upgrade it) using pip or conda. For more information, please see Installation Instructions.

For the following examples, please replace comet.your-company.com with your company's onprem installation URL or IP address.

You can set these variables and values using one of the following three methods:

1. Shell Environment Variable

You could put these variables and their values in a shell script which could be executed each time a user creates a new shell:

export COMET_URL_OVERRIDE=http://comet.your-company.com/clientlib/
export COMET_OPTIMIZER_URL=http://comet.your-company.com/optimizer/

You can also set your personal COMET_API_KEY in this manner, but we suggest using the Comet Configuration option below.

2. Script Environment Variable

You could put these variables and their values in the script itself. Note that the import comet_ml comes after their setting:

import os

os.environ["COMET_URL_OVERRIDE"]="http://comet.your-company.com/clientlib/"
os.environ["COMET_OPTIMIZER_URL"]="http://comet.your-company.com/optimizer/"

import comet_ml

You can also set your personal COMET_API_KEY in this manner, but we suggest using the Comet Configuration option below.

3. Comet Configuration File

You could put these variables and their values in a file named ./comet.config in you home directory. Note that this is also a good place for your personal Comet API key.

[comet]

URL_OVERRIDE = http://comet.your-company.com/clientlib/
OPTIMIZER_URL = http://comet.your-company.com/optimizer/
API_KEY = ...

Testing

Once you have the above configuration parameters set through one of the three methods, you are now ready to test your setup.

# Script: test_comet.py
from comet_ml import Experiment
from time import sleep
import random

experiment = Experiment(project_name="test-comet")

print("Setting and logging some items...")
experiment.set_name("testing comet")
experiment.add_tag("working!")
experiment.log_other("finished", False)

print("Logging parameters...")
experiment.log_parameter("param_A", 1.1)
experiment.log_parameter("param_B", 2.2)
experiment.log_parameter("param_D", "high")
experiment.log_parameter("param_E", "low")
experiment.log_parameter("param_F", True)

print("Logging metrics", end="")
for y in range(60):
   experiment.log_metric("a", random.random() * y, step=y)
   experiment.log_metric("b", random.random(), step=y)
   experiment.log_metric("c", y, step=y)
   experiment.log_metric("d", y/60, step=y)
   print(".", end="")
   sleep(1.0)

print("Done!")
experiment.log_other("finished", True)
experiment.end()

You should get an experiment URL initially. You can go to that page and see the experiment update live. The entire script will take 60 seconds to run.

If you have any issues running this script, please see your onprem adminstrator.

Additional Resources

If you have additional questions, please see the documentation on Comet Configuration Variables or contact us on your Comet Support Slack channel.