Picovoice / picovoice

On-device voice assistant platform powered by deep learning
Apache License 2.0
585 stars 109 forks source link

How to stop Kubernetes pod from exhausting user limit? #552

Closed chevcast closed 1 year ago

chevcast commented 1 year ago

I understand that there are a maximum of 3 active users per month for a free Picovoice account. Locally this has been great. I can completely nuke node_modules and reinstall and it correctly detects it's the same machine/user so there's no issues. Now we are at the stage in our development where we are trying to deploy our app to Kubernetes. Each pod in the cluster counts as its own user and that's fine. If we ever need more than 3 pods then we'll look into upgrading to an enterprise account for that.

However, since pods are ephemeral Porcupine sees it as a new machine/user every time the pod is restarted. We moved to a stateful set so that the pods maintain consistent hostnames and that didn't seem to help. We even tried to install Porcupine onto a persistent storage volume and mount that volume into /app/node_modules/@picovoice/porcupine. We set this all up successfully but alas, it still counts as a new user on every pod redeploy.

Do we have any other options here? We're really hoping to deploy to Kubernetes for proper scaling if our application suddenly gets more attention than we expected. Starting to wonder if Porcupine is fundamentally incompatible with that idea, but maybe we're just missing something obvious. Testing this has been difficult as well since we really only get three tries before we have to wait 30 days again.

Any help is greatly appreciated.

ErisMik commented 1 year ago

I am sorry, but I was unable to find a reasonable solution for you. As you've gathered, Porcupine must treat each ephemeral pod as a new device, and unfortunately I cannot provide you with any other options to try at this time.

If you are willing to engage with us commercially we may be able to work something out.

chevcast commented 1 year ago

Okay no problem. Looks like we might be able to leverage Azure Speech Services by writing node bindings for their C++ SDK so we may have an alternate solution we can use with distributed architecture. I appreciate the effort.

tatanpoker09 commented 1 year ago

I know this is closed and there is no solution for the time being, but I ran into the same problem (as a personal project) and I'm blocked on development as I can't rerun it. Is there a way I can delete my active users without having to wait an entire month?

chevcast commented 1 year ago

I have a planned task to work with Bun's FFI feature to utliize the Microsoft Speech Services C++ SDK. We haven't prioritized it yet so we don't know what unknowns we might encounter, but a cursory glance looks promising.