ClearML Python Package
This is a step-by-step guide for installing the clearml Python package and connecting it to the ClearML Server. Once done,
you can integrate clearml into your code.
Install ClearML
First, sign up for free.
Install the clearml Python package:
pip install clearml
Connect ClearML SDK to the Server
If your ClearML Server makes use of a private or internal CA certificate, you must configure the ClearML SDK to accept
that certificate by setting the REQUESTS_CA_BUNDLE environment variable to your CA bundle before running your code:
export REQUESTS_CA_BUNDLE="/path/to/your/custom_ca_bundle.pem"
python my_clearml_script.py
If you only have the internal certificate (crt file), create the required CA bundle by combining it with your system certificates to prevent other connections from failing:
cat /etc/ssl/certs/ca-certificates.crt /path/to/private-ca.crt > /path/to/your/custom_ca_bundle.pem
Local Python
-
Execute the following command to run the ClearML setup wizard:
clearml-initnoteThe wizard does not edit or overwrite existing configuration files, so the above command will not work if a
clearml.conffile already exists.Learn about creating multiple ClearML configuration files
Additional ClearML configuration files can be created, for example, to use inside Docker containers when executing a Task.
Use the
--fileoption forclearml-init.clearml-init --file MyOtherClearML.confand then specify it using the
CLEARML_CONFIG_FILEenvironment variable inside the container:CLEARML_CONFIG_FILE = MyOtherClearML.confFor more information about running tasks inside Docker containers, see ClearML Agent Deployment and ClearML Agent Reference.
-
The setup wizard prompts for ClearML credentials.
Please create new clearml credentials through the settings page in your `clearml-server` web app (e.g. http://localhost:8080//settings/workspace-configuration),or create a free account at https://app.clear.ml/settings/workspace-configurationIn the settings page, press "Create new credentials", then press "Copy to clipboard".Paste copied configuration here: -
Get ClearML credentials. Open the ClearML Web UI in a browser. On the SETTINGS > WORKSPACE page, click Create new credentials.
The LOCAL PYTHON tab shows the data required by the setup wizard (a copy to clipboard action is available on hover).
-
At the command prompt
Paste copied configuration here:, paste the ClearML credentials. The setup wizard verifies the credentials.Detected credentials key="********************" secret="*******"CLEARML Hosts configuration:Web App: https://app.<your-domain>API: https://api.<your-domain>File Store: https://files.<your-domain>Verifying credentials ...Credentials verified!New configuration stored in /home/<username>/clearml.confCLEARML setup completed successfully.
Now you can integrate ClearML into your code! Continue here.
Jupyter Notebook
To use ClearML with Jupyter Notebook, you need to configure ClearML Server access credentials for your notebook:
- Get ClearML credentials. Open the ClearML Web UI in a browser. On the SETTINGS > WORKSPACE page, click Create new credentials. The JUPYTER NOTEBOOK tab shows the commands required to configure your notebook (a copy to clipboard action is available on hover)
- Add these commands to your notebook
Now you can use ClearML in your notebook! Continue here.