A REST api exposing Rhino's geometry core. This project has two web services: compute.geometry
which provides the REST API, and compute.frontend
that provides authentication, request stashing (saving POST data for diagnostics), logging, and configuration of request and response headers. compute.frontend
creates the compute.geometry
process, monitors its health, and restarts compute.geometry
as necessary.
- Get the latest build from the
master
branch (or build from source). - Create a Windows Server 2016 computer.
- Remote desktop onto server.
- Copy
src/bin/Release
to the server. - Install Rhino using PowerShell* (as administrator):
- In PowerShell:
cd _C:\Users\[USERNAME]\Desktop\Release\deployment\_
. - Run the admin script using:
.\headless_admin.ps1 -updaterhino
. This will download the Rhino installer and place it in the deployment directory. - Once downloaded, double-click on rhinoinstaller.exe and install like you typically would.
- In PowerShell:
- Run and license Rhino. Be sure to validate your license.
- Open cmd.exe,
cd
to theRelease
directory and runcompute.frontend.exe
. - For next steps, see Configuration and Running Compute as a service.
* We include a PowerShell script to make easy to download Rhino on Windows Server with it's strict default internet security settings.
Release builds of Compute listen on all available IP addreses by default. For this to work, you must:
- Start PowerShell as Administrator.
- For HTTP,
netsh http add urlacl url="http://+:80/" user="Everyone"
. - For HTTPS,
netsh http add urlacl url="https://+:443/" user="Everyone"
.
All configuration of Compute is done via environment variables.
Environment variable | Type | Default | Description |
---|---|---|---|
COMPUTE_HTTP_PORT |
integer |
80 (Release), 8888 (Debug) |
Port to run HTTP server |
COMPUTE_HTTPS_PORT |
integer |
0 |
Port to run HTTPS server |
COMPUTE_SPAWN_GEOMETRY_SERVER |
bool |
true (Release), false (Debug) |
When True, compute.frontend will spawn compute.geometry at http://localhost on port COMPUTE_BACKEND_PORT . Defaults to false in Debug so that you can run both compute.geometry and compute.frontend in the debugger. Configure this in Solution > Properties > Startup Project . |
COMPUTE_BACKEND_PORT |
integer |
8081 |
Sets the TCP port where compute.geometry runs. |
COMPUTE_AUTH_METHOD |
string |
RHINO_ACCOUNT : Enables authentication via Rhino Accounts OAuth2 Token. Get your token at https://www.rhino3d.com/compute/login and pass it using a Bearer Authentication header in your HTTP request: Authorization: Bearer <YOUR TOKEN> .API_KEY : Enables athentication via simple API key that looks like an email address. |
|
COMPUTE_LOG_RETAIN_DAYS |
integer |
10 |
Delete log files after 10 days. |
COMPUTE_LOG_CLOUDWATCH |
bool |
false |
Stream logs to Amazon CloudWatch. |
COMPUTE_STASH_METHOD |
string |
TEMPFILE |
TEMPFILE : Enables stashing POST input data to a temp file.AMAZONS3 : Enables stashing POST input data to an Amazon S3 bucket. |
COMPUTE_STASH_S3_BUCKET |
string |
Name of the Amazon S3 bucket where POST input data should be stashed. Requires COMPUTE_STASH_METHOD=AMAZONS3 |
|
AWS_ACCESS_KEY |
string |
Amazon Web Services Access Key for your account. If compute is running on EC2, consider using EC2 Instance Profiles; Compute will find and use your credentials so they don't need to be on your instance. | |
AWS_SECRET_ACCESS_KEY |
string |
Amazon Web Services Secrete Access Key for your account. If compute is running on EC2, consider using EC2 Instance Profiles; Compute will find and use your credentials so they don't need to be on your instance. | |
AWS_REGION_ENDPOINT |
string |
"us-east-1" |
Amazon Web Services Region Endpoint |
Add LetsEncrypt SSL Certificate for HTTPS support:
- Download from https://github.com/PKISharp/win-acme/releases/tag/v1.9.8.4
- Unzip download on the server.
- Start PowerShell as Administrator.
- cd to unzipped directory.
.\letsencrypt.exe
N
create new certificate.4
manually input host names.compute.rhino3d.com
(or similar)1
for default web site.[email protected]
for the user to receive issues.yes
to accept the license agreement.Q
to Quit.
Compute uses TopShelf to make it easy to configure and run it as a service on Windows.
- Start cmd.exe as Administrator.
- In cmd:
cd C:\Users\[USERNAME]\Desktop\Release\
- Run
compute.frontend install
to install as a service. - In the interactive menu, enter your username in the format
.\\[USERNAME]
(for example:.\steve
) and use the administrator password for this account.
- Install Rhino WIP.
- Start Rhino WIP to configure its license.
- Load compute.sln and compile as
Debug
. - In
Solution Explorer
, right-clickSolution 'compute'
, then clickProperties
- In the
Startup Project
tab, selectMultiple Startup Projects
, then set bothcompute.frontend
andcompute.geometry
toStart
. - Start the application in the debugger.
- Browse to http://localhost:8888/version or http://localhost:8888/sdk
- There is a health check URL (
/healthcheck
) in case you want to set up a load balancer