Skip to content

Latest commit

 

History

History

readme.md

Comet Optimizer and Kubernetes

An example for using Comet Optimizer on a local Kubernetes instance.

For information about the Comet Optimizer see Docs.

Setup

Install Docker Desktop, information can be found on the Docker Website.

Install minikube

brew install minikube

Set your API key, Workspace, and Project Name in job-initialize-comet-optimizer.yaml and job-optimizer.yaml. You can do this by replacing the environment variables placeholders with your values, or by running the following commands in your terminal.

COMET_API_KEY="<YOUR API KEY>" COMET_WORKSPACE="<YOUR WORKSPACE NAME>" COMET_PROJECT_NAME="<YOUR PROJECT NAME>" sed -i '' -e "s/REPLACE_WITH_YOUR_API_KEY/$COMET_API_KEY/g" job-initialize-comet-optimizer.yaml && sed -i '' -e "s/REPLACE_WITH_YOUR_API_KEY/$COMET_API_KEY/g" job-optimizer.yaml sed -i '' -e "s/REPLACE_WITH_YOUR_WORKSPACE/$COMET_WORKSPACE/g" job-initialize-comet-optimizer.yaml && sed -i '' -e "s/REPLACE_WITH_YOUR_WORKSPACE/$COMET_WORKSPACE/g" job-optimizer.yaml sed -i '' -e "s/REPLACE_WITH_YOUR_PROJECT_NAME/$COMET_PROJECT_NAME/g" job-initialize-comet-optimizer.yaml && sed -i '' -e "s/REPLACE_WITH_YOUR_PROJECT_NAME/$COMET_PROJECT_NAME/g" job-optimizer.yaml

To Run

Start minikube

minikube start

Enable the local use of docker in minikube

eval $(minikube docker-env).

Build the docker image

docker build ./ -t comet-optimizer

Open a dashboard in your web browser to view job status and logs

minikube dashboard

Run shell script to:

  • Intialize Comet Optimizer
  • Run Optimization sweeps
sh run.sh

Customizing this template

  1. Add your model training functions in run_optimizer.py.
  2. Change the number of experiments running in parallel by updating "parallelism" value in job-optimizer.yaml (line 6)