-
Notifications
You must be signed in to change notification settings - Fork 3
Adding a Flask backend #235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…lp me identify what routes to replace with the Flask alternative
…ven't implemented nay backend changes), also added backendpref store and structure
…eyboard shortcuts, currently working on modifying handleRun and handleContinue
… out what other data structures (like nodeRegistry and some of the python generation code) I need to convert
…out how to replicate the validateGraphBridge() functionality
…imply redirect pyodide execution requests to the web server!
…ons with localStorage
… -> Pyodide backend -> workers in order to avoid accessing localStorage from the level of the workers in the Pyodide backend
…he store, instead of the value being passed down! Also identified where the rror is thrown about a owrker not being initialized
… seem to have finished eval and exec. Trying to figure out how to run streaming with flask now
…nch 'origin' into flask-backend'
|
TODOS
|
|
@KDW1 good start, basic exec/eval works and the toggle UI is there. But there are some architectural issues preventing this from working properly. Worker imports stores: Flask inside PyodideBackend: Streaming broken: Minor: Suggestion: |
|
Thank you for the help Milan. I appreciate the direction. I'll be sure to work on a separate Flask Backend class in |
|
TODOS (After Review)
|
…-backend Updating flask-backend branch of my fork with the most recent changes to main in the original repository
…tion. Still need to implement basic streaming option and also work on removing the flask snippets that remain in worker.ts
… a separate Flask Backend class, now I just need to begin working on Flask streaming and removing the Flask code from worker.ts
…ng logic within a single api request and then stream the resulting data!
…is working out but I need to work on fetching those results
… single API request!
Added an alternative setting for the PathView application so that you can either use Pyodide web assembly or send client-side fetch requests to a Flask web server that has execution, evaluation, and traceback routes (the initialization code of the server borrows from the
init()function found inworker.ts.Major Changes:
backendPreferenceStorewhich is nearly identical in form tothemeStoresince it switches between two binary values. It is binded to 'Q' (arbitrarily so), and toggling it callsswitchBackend(preference : BackendPreference)frombackend.tsbackendPreferenceStoreis accessed frombackend.tsand passed in as an event parameter sent along with the "init" message posted to the worker. This sets the backendPreference for said workerworker.tsthat previously calledawait pyodide.runPythonAsync(...)now has a fetch request counterpart, such that the Flask backend route is shallow copy of what pyodide was doingCurrent issues:
Scope: 'NoneType' object is not iterablewhich comes from thegenerateStreamingStartCode()function inpythonHelpers.ts, specifically thefind_scopes()funciton