Rhino Compute Deploy
Última actualización
¿Te fue útil?
Última actualización
¿Te fue útil?
Summary: So, to run Hops (1) using VM computation, I just need to set the parameter URL and KEY in preference>solver. To execute the vscode or other application request and get the json (2) I need to run the appserver locally (npm run start
). And finally, to use the js application (3), both appservers must be running (local and VM).
Run Hops: install compute in the VM, define URL and KEY in grasshopper (local) and works.
Request API: Define env variables RHINO_COMPUTE_URL/KEY in local machine. Start the appserver in both machines and return the resolved json. It works like a charm.
If both do not start, this error occurs:
Run js app: I need to run both appservers (local and vm) to interact with the gh definition, right? Call from http://localhost:3000/examples/spikyThing/
When i am running boths app servers at the same time (vm and local) it works perfectly (did you refer to that? 'A local appserver can only speak to a local Rhino.Compute instance and a remote appserver can only speak to a remote Rhino.Compute instance.')
If both do not start, this error occurs:
Rhino Compute es un servicio de computación en la nube que permite a los usuarios ejecutar scripts y análisis complejos en Rhino y Grasshopper de manera rápida y sencilla. Utilizando la plataforma de Rhino Compute, los usuarios pueden subir sus archivos de Rhino y Grasshopper a la nube y utilizar la potencia de cálculo de la nube para ejecutar análisis complejos y grandes conjuntos de datos en poco tiempo. Esto permite a los usuarios ahorrar tiempo y recursos en la ejecución de análisis y scripts complejos, y también les permite trabajar de manera colaborativa en proyectos comunes.
Rhino.Compute is a geometry server: provides and API for geometry calculation using Rhino's geometry library. This server can process incoming http request to perform geoemtric calculation and or slve gh definitions and return results as a http response.
geometry server: The server is running Rhino in a non-user interface mode and makes a portion of the RhinoCommon .NET SDK available in a well defined pattern that matches the functions available in RhinoCommon.
Client library: communicate any programming language.
Setting up a production enviroment: [[Deployment to production servers]]
It works with other http clients: c#, python, JavaScript.
Hops: client which can make calls to rhino.compute from grasshopper. These function can increase legibility by simplifying complex definition while reducing duplication. [[Hops]].
1a conferencia browser <> compute.rhino3d.appserver <> compute.rhino3d rhino3d.appserver: sources: bin>www: mira que hay en el files directory y cosas relacionadas con funciones de js routes: definitions, index, solve (get the request, handle different requests checking params, collecting inputs, checking cache and solving the definition or returning cache)
localhost:3000: /name_definition (description inputs and outputs), /inint.html (warm up, pasa todos los nested loop -sliders- para precalcularlos y guardarlos en el cache)
Automatizar la ejecución de rhino compute en service buscando el .exe. Mientrads tanto se puede ejecutar en local
2a conferencia server run his own instance of Rhinio Compute in Rhino 7 (tienes que tenerlo) e iniciar el servicio automáticamente Apps: compute.rhino3d: RhinoCommon en Grasshopper, private instance compute.rhino3d.appserver: running gh definitions with different inputs, node.js, cache to improve performance, serves browser and web pages. rhino3dm.js: web assembly, serialice geometry from definitions, create js meshes
example (favicon, app.js es el standard de express apps, index.html) compute.rhino3d.appserver>npm install (en el terminal de vscode)
browser <> compute.rhino3d.appserver <> compute.rhino3d compute.rhino3d (RhinoCommon, private instance, ) compute.rhino3d.appserver (run gh definintions, node.js express webapps [app.js], cache to improve performance, server browser and web pages) rhino3dm.js (web assembly of RhinoCompute <-> node.js, serialize geometry returned from web-grasshopper, create three.js meshes) example (favicon, apps.js with definition and inputs, index.html)
architecture: clients (web base) <> server propio (rhino compute -compute_geometry.exe, authentification, API, cache, Rhino7) <-> server mcneal (cloud zoo)
github: https://github.com/mcneel/compute.rhino3d docs: https://developer.rhino3d.com/guides/compute/ billing: 20 cent/core/hour = 1$/hour = 25$/day = 750$/month (todas las horas encendido) presentación: https://discourse.mcneel.com/t/rhino-grasshopper-web-application-framework-presentation/106635
introducción: https://www.youtube.com/watch?v=At4BaIuEE3c architecture: clientes (web base) <> appserver (API, files, cache) <> Rhino.Compute API: / (list of definitions), /definition.gh (display info about input-output), /solve (solve gh definition and return json data), /definition/definitionID (send gh definition file)
local setup and debuging: 1. Rhino.Compute (dl, start, play) build: https://ci.appveyor.com/project/mcneel/compute-rhino3d/build/artifacts problemas con el build: https://discourse.mcneel.com/t/problems-with-some-examples-for-rhino-compute-appserver/122311/9 unzip compute and execute compute.geometry.exe and check version 'localhost:8081/version' (run compute) 2. Rhino.Compute (clone, start, debug, play) github: mcneal/compute.rhino3d/docs/develop.md 3. AppServer (clone, start, debug, play) git: https://github.com/mcneel/compute.rhino3d.appserver open samples in vscode folder live server for vscode (with the samples folder open)
appserver folder squema (run in vscode debug mode): sources (bin, example, files (archivos gh), routes[definitions.js, index.js, solve.js, app.js]) /bin/www: principal puerta de entrada, busca lo que hay en el file directory /routes/solve: get the request, handle differetn reuqest (check paramas, collect inputs, check cache and solve definition or return cache) run in localhost:3000 (/*name_definition, /init.html) localhost:3000/example.gh: descripción de inputs y outputs /init.html: pasa por todas las convinaciones para precalcularlas
Rhino.Compute (deploy, test, play) docs: mcneal/compute.rhino3d/docs/deploy.md get a remote machine (windows) install rhino and compute (one line of code in docs, paste in powershell). This intall some service for autostart rhinocompute.geometry.exe automatically .url: dirección del remote desktop que quieres que ejecute las definiciones (dentro del código de examples)
AppServer (deploy, test, play)
Ho to setup a instance of rhino.compute on a virtual machine running IIS (internet information services). We can setup it to process incoming request and forward that request to the rhino.compute instance. The IIS is necessary to relaunch the compute server if it crash or malfunction (otherwise an API would be enough). ISS can launch an instance of compute when it is needed which in turn launch one or more child processes (perform the actual computation). When rhino.compute.exe does not receive request to solve the process will shut down and stop incurring core hour billing. When new request is received, ISS will make sure that rhino.compute.exe is running.
bootstrap script: EmailAddress, ApiKey, RhinoToken.
Setup a physical machine to act as a server or create a virtual machine.
Running the Bootstrap script: Windows PowerShell commands.
Testing the app: compute server URLs and API key. Add the hops component and indicate the path.
<! node: https://nodejs.org/dist/latest-v13.x/ > docs: https://github.com/mcneel/compute.rhino3d.appserver/blob/main/docs/installation.md posible host: docker image, kubernetes, heroku, windows vm billing & licensing: https://developer.rhino3d.com/guides/compute/core-hour-billing/ añadirlo en plotly: https://dash.plotly.com/external-resources RHINO 3DM github: https://github.com/mcneel/rhino3dm build: https://github.com/mcneel/rhino3dm/blob/main/docs/python/RHINO3DM-BUILD.PY.md utilizando python: https://github.com/mcneel/rhino3dm/blob/main/docs/python/RHINO3DM.PY.md utlizando javascript: https://github.com/mcneel/rhino3dm/blob/main/docs/javascript/RHINO3DM.JS.md ejemplos: https://github.com/mcneel/rhino-developer-samples/tree/7/rhino3dm#samples HOPS documentación: https://developer.rhino3d.com/guides/grasshopper/hops-component/ introducción: https://discourse.mcneel.com/t/create-cpython-components-using-hops-in-grasshopper/120517 JUPYTER USING RHINO.COMPUTE git: https://github.com/kpfdev/Rhino_Compute_Workshop <! - DESARROLLAR PLUGINS VisualStudio: https://github.com/mcneel/rhino3dm install npm in vm with vscode: compute.rhino3d.appserver > npm install > <!- https://designcommunicationfx.com/ ->
Running rhino compute locally uses your existing Rhino license and does not cost any additional money. In production environment you will need a server or virtual machine with windows server (10 cent per hour per core).
connect via RDP: log onto it via remote desktop protocol which connect two computers over a network.
[0001 Basics of Grasshopper Plugin Development