ntg
ntg

Reputation: 14075

voila: preheated kernels only for specific notebook

I want to enable the preheated kernels in voila. E.g. I am doing:

voila --preheat_kernel=True --pool_size=14

However, I only want to have preheated kernels for a very specific notebook, and not the (many) others that I have in the same directory.

Is there a way to tell voila for which notebook to enable the kernels (or failing that, to have 0 pool_size for the rest of the notebooks)?

I am currently using voila version 0.4.0

Upvotes: 0

Views: 146

Answers (1)

ntg
ntg

Reputation: 14075

RTFM...

The folder where voila is executed from can contain a voila.json config file... I have arrived at currently using this one :

{
   "VoilaConfiguration": {
      "preheat_kernel": true
   },
   "VoilaKernelManager": {
      "preheat_blacklist": [
         "*-No-Preheat.ipynb"
      ],
      "kernel_pools_config": {
         "demo1.ipynb": {
            "pool_size": 4
         },
         "demo2.ipynb": {
            "pool_size": 12
         },         
         "default": {
            "pool_size": 0
         }
      },
      "fill_delay": 0
   }
}

Here, I have found no behavioral difference between nodes with pool_size 0 and those black listed, I guess that would be significant for a non-zero default pool size.

These params could possibly be also supplied from command line, e.g.

voila --preheat_kernel=True --VoilaKernelManager.default_env_variables='{"FOO": "BAR"}'

Upvotes: 1

Related Questions