celest-dev / celest

The Flutter cloud platform
https://celest.dev
Other
232 stars 13 forks source link

Understanding the Celest Cloud Limitations #99

Open starklord opened 3 months ago

starklord commented 3 months ago

Hi i want to understand what can we do inside the celest cloud. Are there specifications or any doc about that? Im new with the "Cloud Functions" concept, i come from the traditionals VPS virtual private servers where you can for example read write files. So, Wat can and can´t do inside the celest cloud or inside a celest function? For example if i use path_provider and run "celest deploy" this give me an error: Failed to deploy project. Please contact the Celest team and reference deployment ID: deployment_01htfvcf0eetahaf9qhwg93ttp

dnys1 commented 3 months ago

Hi @starklord, yes good point. Celest is going for more of a serverless model at the moment, which I definitely need to document better. Every function has a 500MB scratch space located at /tmp which can be used for processing files, but is not guaranteed to persist between executions.

Regarding your deployment, I'm not seeing an error for that deployment in my logs 🤔 It's showing as successful on my end, oddly. It might be because of path_provider depending on Flutter--I will try to replicate the error locally.

dnys1 commented 3 months ago

Does celest start work?

dnys1 commented 3 months ago

Okay, yeah I'm very certain it's because of path_provider. The transitive dependency on Flutter pulls in the dart:ui library, which is not available in server contexts. This issue has been on my radar for a while now. I'm happy to dig more into it and see what a fix could be.

dnys1 commented 3 months ago

In the meantime, unfortunately, it's required to use packages that do not depend on Flutter.

starklord commented 3 months ago

Does celest start work? celest start doesnt work if i import the path_provider library in my function file. PS D:\workspaces\flutter\celest_app2> celest start ⠦ Starting Celest... (6.9s)Project has errors. Please fix them and save the corresponding files.

Okay, yeah I'm very certain it's because of path_provider. The transitive dependency on Flutter pulls in the dart:ui library, which is not available in server contexts. This issue has been on my radar for a while now. I'm happy to dig more into it and see what a fix could be. Ah ok i see now, its reasonable.

In the meantime, unfortunately, it's required to use packages that do not depend on Flutter. What about the dart:io library ? i have this error reading/writing files(and i dont know if this is for any streaming) and this happens in local and production environment server dateTime: #0 _checkForErrorResponse (dart:io/common.dart:55:9) ... image

my code is just as simple as:

image

Future createFile(String fileName) async { try { var file = File("filenew.txt"); var text = await file.readAsString(); return text; } catch (e, s) { log(s.toString()); return s.toString(); } }

dnys1 commented 3 months ago

@starklord Could it be the file does not exist?

The method says createFile but if filenew.txt does not exist already, then reading it is expected to throw an error.

starklord commented 3 months ago

Ah ok it can be possible the file does not exist because you told me the files created are temporary isnt it? Oky doky ill keep making more testings :3 thank you so much for this product. Its getting better and better!

dnys1 commented 3 months ago

I appreciate it!

Yes, the filesystem support is something that needs some thought and care. I've created a new issue to track this! https://github.com/celest-dev/celest/issues/102