-
Notifications
You must be signed in to change notification settings - Fork 39
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
Distributed Multi-Printer Support #35
Comments
This. |
Progress update: I've pushed a few commits to a separate branch - nothing is usable yet, but I currently have working solutions to a number of problems, including:
It's been a really fun traipse through UDP broadcasting, linear optimization, dynamic programming, RAFT consensus, and a bunch of other stuff I hardly ever get to work with! I'm now in the stages of making a basic "plugin-free" command line implementation so that I can prototype and load test without having to install octoprint many times. Also writing unit and integration tests to make sure there's no obvious mistakes. When I have a serviceable version, I plan to release it as an "alpha" feature (read: can break at any time, for any reason). Also need to buy a couple more printers for real testing, as I've only got one printer at the moment. A friend also shared Prusa Pro AFS with me - really awesome execution of networked printing (especially using drawer slides for back-panel access to swap out printers). But it appears once again that companies just can't help but create cloud services with attached subscription models 🙄 |
Another minor update - I've split the code out into a separate repository I've been calling peerprint. In addition to keeping the continuous print repo clean, it's now possible to integrate with other 3D print services & tools - such as MatterControl, Repetier, AstroPrint etc. - while still sharing the same queue(s). Not that any of that is likely in the near or even mid term - I need to finish hooking this into the CP plugin first. But it's fun to dream. Next step is to attempt integration back into the continuous print plugin. Some features (e.g. material selection) may just be placeholder-ed so we can reach parity with current queue behaviors before continuing onward. |
Status update: haven't touched the ntework printing code for a bit, but color/material selection is available in the latest RC, so we should be good to proceed with that in network printing as well. I'm now switching the CPQ storage setup to sqlite (from serialized JSON) which should make all this integration a lot more sane by the end of it all. CPQ's sqlite database will be separate from the data managed by peerprint, so that future integrations with peerprint won't have to bolt on a whole separate / redundant queuing system in order to use the library. |
Storage implementation is almost ready for the RC branch - I aim to have it ready by the end of this week. Also purchased and octopi'd a MP Mini Delta V2 as a second network printer for initial shared queue testing: |
Another status update: architecture is starting to settle and the sqlite3 conversion is complete and unit tested. However, I'm still working on UX refinements and shaking out remaining bugs. This will take some time before it's RC-worthy. It's actually not too much additional work to add basic support for #54 - including basic restrictions on sets to only print on certain printers, which allows for LAN queues with heterogeneous printers as long as you include a |
Update time! And this time with a screenshot: This marks the first successful (albeit virtual) print of a job that was issued by a remote peer elsewhere on the network. This confirms that:
I'm past the hardest parts... probably. Still more UX and unit testing work to be done, but the work should be quite a bit more straightforward now. |
I finished two usability tests with some printing friends and worked through the feedback - everything's running quite smoothly now. Next steps:
After another 2 weeks of soaking, will finalize and publish (Edit: after a couple small hotfixes, successfully started a print on my delta printer from another instance of OctoPrint! 🎉 ) |
Candidate release created: https://github.com/smartin015/continuousprint/releases/tag/2.0.0rc1 This contains a lot of new features and changes, so I've posted a release video which is also available from the docs main page. |
I've moved the broader WAN/crypto aspirations in this issue to smartin015/peerprint#2. The remaining features discussed here are implemented in |
Is your feature request related to a problem? Please describe.
It's not so unreasonable for people to have multiple 3D printers at home, or in the prototyping industry. Even more extreme are 3D printing services (e.g. Shapeways) managing hundreds/thousands of printers.
The continuous print queue is a plugin for a single instance of octoprint, and guides like this one suggest the easiest way to manage multiple printers is with multiple instances of octoprint. This means also multiple instances of the plugin, with independent queues.
But why have many queues, when you could have a single entry point for 3D printing?
Describe the solution you'd like
Imagine the power of a single continuous print queue driving multiple printers:
Distributed coordination can be done in a heavy-weight fashion with kazoo, or perhaps more nimbly with a custom election implementation.
Once a leader plugin instance is established, it should synchronize its queue state with the others so they all have the same prints queued. The individual printer statuses should appear in the plugin tab (connection state, sync state, print state). Presence or absence of print files will also be synchronized, so the leader knows which printer has which files.
When the queue is started, the leader will determine which printer will best accommodate the print. Considerations for "best for the job" may vary in the future, but it can start simply by rejecting busy printers and ensuring all printers are operational.
Printer event synchronization will be required as well - when prints finish, the printers should tell the leader about it. Failures and other events should be echoed to the leader as well for tracking - so it's probably easiest to just forward all printing events and filter them on the leader side. Similarly, health checking should be attempted periodically to ensure the print network is OK.
Failure handling across printers can also become tricky. If a print fails multiple times on one printer, we can attempt it on another printer. If it starts failing there, the issue is probably the print itself. This is something the leader will need to handle.
If the leader goes offline, another plugin instance takes over leadership - using the bully algorithm makes next-leader determination really quick and convenient.
Describe alternatives you've considered
Additional context
Implementing #32 will complicate queue item distribution, as different printers may have different materials. However, this doesn't block initial implementation. Followup will be needed when synchronizing printer state, and in selection considerations (assume changing filament is costly, so try to match colors to printers).
Hand-wavy visioneering
Multi-printer setups don't need to be limited to local-network... imagine a worldwide network of home printers where users can "earn" printing time on others' printers by performing work using their own printers. Printer selection could prioritize geographical closeness for "rapid" prototyping, or perhaps some shipping process for "volume" printing.
This might actually, unironically be a use case for creating a cryptocurrency. Proof of work is running and delivering others' prints - which can be used to generate coins for you to use to run your own jobs on the print network. https://3d-token.com/ is one example of something similar... but it seems to be more about using crypto to pay for a proprietary printing service. this article equates "supply chain" and "blockchain", but without any details. What I have in mind is more "p2p sharing, but for 3d printing".
The text was updated successfully, but these errors were encountered: