openblocks icon indicating copy to clipboard operation
openblocks copied to clipboard

Support for stateless container

Open bgwastu opened this issue 2 years ago • 14 comments

Does openblocks run on stateless container and works without database when the app deployed?

As always, thank you for building this great tool!

bgwastu avatar Dec 28 '22 07:12 bgwastu

Hey @bagaswastu ,

Thanks for the post, Openblocks is a platform for those built apps to run on, and Openblocks uses a MongoDB for fetching workspace/user/app/... data and a Redis for maintaining user sessions. So I would say Openblocks is stateful in nature. But it does not require your extra data storages if you're just using a single self-hosted instance with container built-in MongoDB and Redis.

neon-balcony avatar Dec 28 '22 07:12 neon-balcony

Thank you for your response.

I see that Openblocks uses supervisord to run multiple services in a single container. If I'm using my own Redis and Mongo services, do I still need to specify a volume in the Docker container? I'm planning to deploy Openblocks on Google Cloud Run, but since the container is stateless on Cloud Run, I'm worried that I won't be able to deploy without specifying a volume.

bgwastu avatar Dec 28 '22 08:12 bgwastu

I see, I think it should be OK without specifying volume in docker setup if you're using your own Redis and MongoDB. And you just need to specify environment variables for your MongoDB and Redis URI then.

neon-balcony avatar Dec 28 '22 09:12 neon-balcony

But MongoDB and Redis are still being started by suervisord if the environment variables are set, which can cause issues if you mount volumes in k8s (Specially in Azure Files that you need to set mount specific options to avoid having a crashed mongodb due to file permission issues for WiredTiger).

rhuanbarreto avatar Jan 20 '23 16:01 rhuanbarreto

@rhuanbarreto Got it, it seems that we can provide a pure version Openblocks without built-in MongoDB and Redis. We've added it to our backlog and thanks for the info 😄

neon-balcony avatar Jan 25 '23 15:01 neon-balcony

We would love this feature as wel!

dizzy-duality avatar Feb 03 '23 14:02 dizzy-duality

Hi everyone, separate images of follwing services are available now:

  • api-service: Backend service.
  • node-service: Backend service.
  • frontend: Frontend service.
  • MongoDB: Used for persisting data of users, apps, data sources, etc.
  • Redis: Used for maintaining user sessions, rate limiter, etc.

The detailed info about self-hosting with separate images is provided in this doc: https://docs.openblocks.dev/self-hosting#multi

Hope you find this helpful for stateless containers in cluster environment! 😃

YoJayz avatar Feb 08 '23 11:02 YoJayz

hello @YoJayz,

I'm trying to use the multi-container and i face a strange issue in api-service : image

Tried with environment variable REDIS_URI or REDIS_URL, same.

Any idea to solde please ?

Thanks for help.

Regards

tboulogne avatar Mar 20 '23 09:03 tboulogne

hello @YoJayz,

I'm trying to use the multi-container and i face a strange issue in api-service : image

Tried with environment variable REDIS_URI or REDIS_URL, same.

Any idea to solde please ?

Thanks for help.

Regards

Hi @tboulogne For better understanding of this issue, would you please provide your masked REDIS_URI to us?

YoJayz avatar Mar 20 '23 10:03 YoJayz

yes,

tried both :

REDIS_URL=redis://<user>:<password>@<service>:6379
REDIS_URI=redis://<user>:<password>@<service>:6379

tboulogne avatar Mar 20 '23 11:03 tboulogne

REDIS_URL=redis://:@:6379 looks fine, can you connect to it successfully with other Redis clients?

jerry-goodman avatar Mar 20 '23 12:03 jerry-goodman

@jerry-goodman yes i tried with redis-cli from app container and the connection to redis container is ok.

tboulogne avatar Mar 20 '23 17:03 tboulogne

@jerry-goodman yes i tried with redis-cli from app container and the connection to redis container is ok.

Sorry for the late reply @tboulogne Would you like to join our official Discord server so that our engineer can have a private chat in detail with you?

YoJayz avatar Mar 21 '23 03:03 YoJayz

hello @YoJayz just joined :-). Let me know.

tboulogne avatar Mar 21 '23 06:03 tboulogne