Setting global config variables#

Data Science & AI Workbench provides a secondary config map (anaconda-enterprise-env-var-config) that you can use to configure the platform. Any environment variables added to this config map will be available to all sessions, deployments, and scheduled jobs. This is a convenient alternative to using the Workbench CLI, as you can add any variable supported by conda configuration.

To make global configuration changes to the platform:

  1. Create a backup of your current configmap file, then edit your configurations by running the following commands:

    Run the following commands from anywhere you have kubectl access to the cluster:

    # Replace <NAMESPACE> with your Workbench cluster namespace
    kubectl get cm -n <NAMESPACE> anaconda-enterprise-env-var-config -o=jsonpath={.data."container-env-vars\.yml"} > container-env-vars.yaml
    kubectl edit cm -n <NAMESPACE> anaconda-enterprise-env-var-config
    

    Run the following commands in an interactive shell on the master node:

    # Replace <NAMESPACE> with your Workbench cluster namespace
    sudo gravity enter
    kubectl get cm anaconda-enterprise-env-var-config -o yaml > anaconda-env-var-config.yaml
    kubectl edit cm -n <NAMESPACE> anaconda-enterprise-env-var-config
    
  2. Make your changes to the file, then save it.

  3. Restart all pods using the following command:

    # Replace <NAMESPACE> with your Workbench cluster namespace
    kubectl delete -n <NAMESPACE> --wait=false $(kubectl get pods -o name|grep ap-)
    

Tip

If something goes wrong with your configuration updates, you can restore your previous configurations by re-running the following commands:

# Replace <NAMESPACE> with your Workbench cluster namespace
kubectl delete cm -n <NAMESPACE> anaconda-enterprise-env-var-config
kubectl create cm -n <NAMESPACE> anaconda-enterprise-env-var-config --from-file anaconda-env-var-config.yml