AY-7839_AYON Off-line mode (allow workfiles to be usable when no connection to AYON)
Please describe the feature you have in mind and explain what the current shortcomings are?
In certain production environments the production may be much more dynamic then working, over cable to an internet or studio connection - which may introduce connection issues to AYON.
- You can not work on your laptop in the train in an existing workfile if you have the relevant files on your drives.
A potential possibility would be to add a middle "Cached" layer in ayon_apithat allows it to run all queries against instead (for when user has not internet access). This could be an automatic cached layer on the machine that always get populated (which can be optionally enabled if you know your setup may have connection drops). Then when ayon_api makes a query, fails to connect - it'll instead try to fallback to "return from local (persistent!) cache". Or a dedicated "Prepare for offline" button could trigger the creation of a full cache of relevant data to you to allow future queries to be able to do similar queries without hard failing.
Houdini-specific issue:
For example, it's non-trivial to launch a DCC inside an AYON environment (e.g. launcher can't run) just because it can't connect.
The issue also spreads further in Houdini (more problematic than in other DCCs) to the generic loader HDAs which essentially use expressions to define the loaded filepaths of loaded products (which always re-evaluate in the workfile on open.) Meaning, that if you are offline, opening your workfile just to see the loaded content would already file. A proposal there would be to add some mechanism inside the HDA that 'stores' the last resulting output of the expression on the machine, to return that if an AYON connection fails in that expression. So, essentially use some scene-caching mechanism for HDA loaders (e.g. hou.Node.setUserData to store last responses; with the scenefile) and then fallback to that return value if no AYON API connection could be made)
How would you imagine the implementation of the feature?
No response
Describe alternatives you've considered:
No response
Additional context:
link to discussion on Discord (might be a private channel)
This issue was automatically created from Clickup ticket AY-7839
After a discussion with @iLLiCiTiT, we agreed on the following plan:
- Implement a mechanism to detect when server connectivity is not available anymore (internet shortage, server restart, etc).
- This will require server-side work from @martastain too.
- We want a non-blocking call that returns ASAP (web sockets ?).
- Make that monitoring state available to addons so they may decide what is the appropriate response (use cached data, raise an error, etc)
- Evaluate which operations would be able to proceed in offline mode and at what cost.
I will create relevant sub-taks for this.
From the server perspective, it shouldn't require any changes - once client is connected to /ws endpoint and authenticated, server send heardbeat every few seconds. But you should know immediately if the server is inreachable, because you get on_close event from the ws client.