How to mount components folder when deploying through Helm charts?

Hi,

I have a custom component folder that contains (of course) custom components for in my NLU pipeline. I am using the Helm chart deployment but there is no documentation available on how to implement these custom components (or I am missing it). I get the following error when I try to train a model using the Rasa X UI:

ModuleNotFoundError: No module named 'components'

Can somebody help me with this? Thank you :slight_smile:

1 Like

In order to add your custom components, you need to add a volume mount for those. For a custom component you’ll want to mount to rasaProduction and rasaWorker. The working directory of these containers is /app, so if you reference your component like module.Class, you’ll want to mount it to /app/module.py.

Make sure there is also an __init__.py in whatever directory your component code lives! :slight_smile:

Thank you @erohmensing,

Under which of these do I implement it?

resources: {}
      # additional volumeMounts to the main container

extraVolumeMounts: []
      # - name: tmpdir
      #   mountPath: /var/lib/mypath

  # additional volumes to the pod
  extraVolumes: []
  # - name: tmpdir
  #   emptyDir: {}

Also, how do I add these external files (they are available in my Github repo)?

Sorry for these simplistic questions, Docker/Kubernetes/Helm is relatively new to me!

@tczekajlo can you help with this also? :stuck_out_tongue: After that my questions will be done (hopefully) haha.

@fabrice-toussaint just had an idea :slight_smile: If you aren’t comfortable with helm and ConfigMaps etc. Maybe it is easier to build a custom image? it would look pretty simple, something like

FROM rasa/rasa:<version>

COPY ./custom_component.py /app/custom_component.py

RUN pip install <any libraries you need for your component>

You’ll need a custom image if your component uses libraries not in the rasa image anyway, so it’s possible that volume mounts aren’t even the right solution in the first place :slight_smile:

Then you can reference your image as the name used for the rasa: deployments.

1 Like

That seems for a good fix for now! Do you have a tutorial for me regarding the Helm chart way, I will build the custom image now :slight_smile:!

Thank you :smiley:

@erohmensing I created a github action for building the Rasa server with custom components with possibilities to automatically update the deployment through Helm based on the action-server-gha by tczekajlo. I can share the link to the Github repo if this is relevant for the Rasa team.

@tczekajlo

@erohmensing when I try to do it this way I get an error in my app pod:

Failed to write global config. Error: [Errno 13] Permission denied: '/.config'. Skipping.

Together with the following output:

Any idea why this is happening?

I moved it to a new post: Rasa X - Permission Denied in App Pod