Docker support

Thanks to the folks at Packhunt.io/White Lioness, we now have a Dockerfile for the Compute project! :whale:

To try it out, follow these steps…

  1. Make sure you’re up to date with the latest code from the master branche and you have the latest Rhino WIP installed (used to generate license/settings files)
  2. Follow these steps to disable encryption of your CloudZoo credentials (this is important because the encryption is machine-specific and won’t work inside the container)
  3. Copy the following files into the project’s root directory, alongside the Dockerfile
    • “C:\ProgramData\McNeel\Rhinoceros\6.0\License Manager\Licenses\55500d41-3a41-4474-99b3-684032a4f4df.lic”
    • “%AppData%\McNeel\Rhinoceros\6.0\License Manager\Licenses\cloudzoo.json”
    • “%AppData%\McNeel\Rhinoceros\7.0\settings\settings-Scheme__Default.xml”
  4. Open PowerShell/cmd.exe, navigate to the project’s root directory, and run these two commands to build the image and then spin up a container
> docker build --isolation process -t rhino-compute .
> docker run -p 8080:80 rhino-compute

Compute is now accessible on localhost:8080!


Note: this Dockerfile requires “process” isolation, or it won’t build. This means that the windows:1903 base image will only work with Windows 10 (build 1903) and Windows Server 1903. To use Windows Server 2019, change the builder image to mcr.microsoft.com/dotnet/framework/sdk:4.7.2 and the main image to windows:1809.

8 Likes

Is there another way to accomplish your goals?

Hi @will,
Thank you for this, it’ll be a huge time saver if I can get it to work for me.
I’m having an issue at the last step of the build. Seems like nuget restore is the culprit.
Nothing to do. None of the projects in this solution specify any packages for NuGet to restore
Do you have any ideas?

Sorry if this sounds like a stupid question, i know what docker does but i fail to see how the perf of a vm deployment could help in using Rhino for design or productivity.

Surely it’s not computationally efficient. Installing Rhino takes minutes - i fail to see how this will economically interesting for any IT admin (how big can a studio be? (i guess this is what i dont know…).

Thanks for enlightening my ignorance. Im a sysadmin (win) in a large mixed IT environment.

Hello,

I guess one use case could be automatic production chains where CAD or 3D geometry is important and can be fully or predominantly automated, maybe with a simple checklist user interface, for instance automatic production drawings for standard windows with bespoke dimensions.

The Rhino geometry part of this work could be one part of a larger ordering, manufacturing and delivery pipeline all running on Docker. The computational overhead for running in a docker be worth paying for integration in the wider pipeline, scalability, reproduceability of the system…

This is all hypothetical - I have no insider knowledge. :slight_smile:

Graham

1 Like

@xavier.bury, this is specifically intended for deploying Compute or other server-side workflows that use the Rhino.Inside® technology (non-GUI implementations only).

Thanks for the answers. I didn’t know there was a non-gui version of Rhino. Learning everyday…

Hi @mkarimi, it looks like we broke the docker build a while back when we switched from packages.config to PackageReference for this project. Good news is that we now have a new Dockerfile. Please give it a try and let me know if you have any problems!

2 Likes

Thank you @will
This is what we were finding ourselves too, that one base image can build compute.sln and another one can install Rhino.
Great work! Thanks for sharing.

I also think you don’t really need to install or use nuget to restore the packages. You can just use /restore with msbuild.

RUN msbuild ./src/compute.sln /t:build /restore /p:Configuration=Release

Another question @will if you don’t mind.
Is there a version of this link that gets you the latest version of Rhino WIP available?
http://files.mcneel.com/dujour/exe/20200114/rhino_en-us_7.0.20014.11185.exe

If not, what’s your suggestion for updating Rhino in the Docker image? I believe Rhino compute will stop working once the WIP version is outdated right?

Hey @mkarimi, thanks for the /restore tip!

We don’t have a permalink to the latest Rhino WIP installer, unfortunately. This “bug” will be fixed by releasing Rhino 7! We’re working hard to get it ready. :slight_smile:

I don’t use Docker for https://compute.rhino3d.com but my process using Amazon EC2 is to launch a new instance using the current image, update Rhino, check it’s working correctly and then create a new image and deploy it to the cluster. I do this once per month which, at worst, gives us a couple of weeks to fix any bugs before the build expires. I’d like for it to be more streamlined (something that I’m sure Docker can help with!), but our server is just a proof-of-concept and I’m not a cloud expert. :wink:

1 Like

Just to be clear, the “update Rhino” part is done manually right?

Yes. I’m using regular Windows VMs so this means logging in remotely, stopping the compute service, downloading and installing the new Rhino WIP and finally restarting the service.

1 Like