Plugins Shared Code in containerized environment

Solved!
AsishM
Level 2
Plugins Shared Code in containerized environment

I have a custom plugin with some shared code in the "python-lib" directory that I'd like to import and use in other places.

Following this link - https://dss.grc-mlops.com/admin/code-envs/design/python/plugin_scaler-engine_managed/

The following code works in a regular notebook running on DSS. However, if I change the kernel to one that runs in a container - it results in an ImportError

Code;

import dataiku
plugin_id = "my_custom_plugin"
package_name = "foo"
dataiku.use_plugin_libs(plugin_id)
module = dataiku.import_from_plugin(plugin_id, package_name)

 

Error when running in a container:

ImportError: No module named 'foo' 

 

0 Kudos
1 Solution
matthieu
Level 3

Hi @AsishM 

Answer can be found in https://doc.dataiku.com/dss/latest/containers/concepts.html#limitations,

"In code recipes and notebooks, using libraries from plugins is not supported in containers. For example, dataiku.use_plugin_libs and dataiku.import_from_plugin will not work."

Cheers,

Matthieu

View solution in original post

0 Kudos
2 Replies
matthieu
Level 3

Hi @AsishM 

Answer can be found in https://doc.dataiku.com/dss/latest/containers/concepts.html#limitations,

"In code recipes and notebooks, using libraries from plugins is not supported in containers. For example, dataiku.use_plugin_libs and dataiku.import_from_plugin will not work."

Cheers,

Matthieu

0 Kudos
AsishM
Level 2
Author

Thank you! I didn't check the containers documentation. I imagine adding a note in the code recipe page also wouldn't be a bad idea

0 Kudos