Disabling or changing CPU, GPU and RStudio idle timeout

A cluster administrator can disable or change the default idle timeout of CPU, GPU or RStudio environment runtimes on the shared file system if this is desired.

A change to the idle shutdown setting will only apply for runtimes that are started after the file was changed. Whether a runtime has become idle is checked every 8 minutes, which means that a runtime might be stopped later than the defined idle timeout.

Note that the idle timeout value for RStudio and notebooks runtimes do not have to be the same. Also, you do not have to specify a timeout value for both.

Changing this idle timeout doesn't affect jobs. It only applies to interactive content.

To disable the idle timeout directly on the shared file system:
  1. Create a file named idleshutdown.config and add the following content. The value that you add for idleTimeBeforeShutdown either enables or disables the idle timeout functionality. The value -1 disables idle timeout. Any other value or an empty file enables it.
    {
        "jupyterNotebook": {
            "idleTimeBeforeShutdown": -1
        },
        "rStudio": {
            "idleTimeBeforeShutdown": -1
        }
    }
  2. To change the idle shutdown time, replace -1 with the idle timeout value in seconds that you want to use for runtimes. All CPU, GPU or RStudio runtimes started after this change will honor this setting.
  3. Copy idleshutdown.config to /mnt/user-home/_global_/config/.idleshutdown/. You can use the asset-files-api pod for this:
    oc cp idleshutdown.config $(oc get pods | grep asset-files-api | head -1 | awk '{print $1}'):/mnt/user-home/_global_/config/.idleshutdown/

Disabling or changing idle timeout of a pod

You can create a pod and change the timeout value in the configuration file on the pod.

  1. Dependent on your cluster policy, identify which image to use for this pod. You need to be able to edit files in this pod.
  2. Create a pod spec with the following volume and volume mounts:
        volumeMounts:
          - mountPath: /cc-home/_global_/config/.idleshutdown
            name: cc-home
            subPath: _global_/config/.idleshutdown
        
    volumeMounts requires the following volumes section:
    
        volumes:
          - name: cc-home
            persistentVolumeClaim:
            claimName: cc-home-pvc
  3. Start a pod with these volume settings and exec into the pod.
  4. Navigate to /cc-home/_global_/config/.idleshutdown.
  5. Edit or create the file idleshutdown.config and add the following content:
    {
        "jupyterNotebook": {
            "idleTimeBeforeShutdown": -1
        },
        "rStudio": {
            "idleTimeBeforeShutdown": -1
        }
    }
  6. Change -1 to the idle timeout value in seconds that you want to use for runtimes. All CPU, GPU or Rstudio runtimes started after this change will honor this setting.