Programmatically generate processors

so i was recently enlightened to the existence of processors which will be very useful for a couple of things i want to build with speckle. A possible feature i would love is to be able to generate processors via the api

also this restriction of all processors are saved locally in your browser’s local storage is problematic for workflows I’m interested in creating. As these processors would need to be used multiple people on a project and not necessarily be triggered by individuals manually.

First thought is this would be a little bit like terraform or cloudformation, where you’d write some sort of config instructions and supply them to server and have it generate require logic to execute a process. The requirements for my specific workflow would need to be able to generate a project, a number of streams and set ‘processors’ that would trigger based on configurable events on the speckleserver.

2 Likes

That’s definitely the direction that it hopefully (and should) go in! Processor right now is just really bare bones and is mostly a proof of concept. The script being embedded inside of local storage was a quick way to get things up and running without adding another table inside of the SpeckleServer. This obviously has its limits in terms of sharing and also lacks the ability to extend for event triggers.

Another issue here is that processor blocks (the functions) are written and tied to the admin web app and not the server. This is because it is based on lambdas deployed in AWS (through Netlify) from the web app. Since you can use different web apps with different servers, this will cause a mismatch between the functions available and those specified. A remedy to this may be to have the web app address associated with each processor script. However, it may be a better solution to move the computation to the SpeckleServer to solve this, but there are advantages to using lambdas too!

Just summarizing some stuff/plans for getting this to be more proper in terms of priority:

  1. Move instruction/processor to server
  2. Create processor API endpoints (i.e., create new processor, modify, trigger processor, etc.)
  3. Implement event-based triggers. For example, trigger based on new streams in project, new streams with tag, etc.

I’m currently writing my exams at school, but hopefully I’ll be able to tackle down some stuff on this list over the winter break! No promises on how much gets done though :upside_down_face:.

2 Likes

Processors are definitely something we need in the Speckle ecosystem, and Speckle Server should expose the relevant events and API’s to enable that, but I’m not sure it something we should pile into the core of Speckle. (i.e. Do one thing and do it well :slight_smile: )

2 Likes

For sure! Processor should definitely not impact the main aspects. The only thing that will impact the server will be an added table and perhaps the event triggers if it can be done in an efficient manner.