How to find Databricks runtime version of the cluster in an init script

brickster_2018
Databricks Employee
Databricks Employee
 

Mooune_DBU
Databricks Employee
Databricks Employee

It's set as an environment variable called `DATABRICKS_RUNTIME_VERSION`

In your init scripts, you just need to add a line to display or save the info (see python example below):

import os
print("DATABRICKS_RUNTIME_VERSION:",os.environ.get('DATABRICKS_RUNTIME_VERSION',None))

I used it databricks cluster with custom docker image. it gives that "DATABRICKS_RUNTIME_VERSION: None"

Hugh_Ku
New Contributor II

I've also run into the same issue, customised docker image does not give DATABRICKS_RUNTIME_VERSION as env. I believe there are still many issues in how customised docker image is used in databricks cluster.

Can anyone from databricks help answer it?