Rendering Blender 3D scenes in the cloud

I created a simple app that renders a Blender 3D scene in the cloud: users can customize the displayed message by changing an URL parameter, and the app will return the 3D rendered image.  Give it a try here.

The code is a very simple Python function that invokes the Blender open source software. It uses the Blender API in order to dynamically change the value of a Text object. The function is then simply wrapped in a basic Flask application in order to respond to HTTP requests. Because Blender needs to be installed, I am using a Dockerfile that runs “apt-get install blender”.

Find the code on GitHub.

This app was created to showcase the upcoming “serverless containers” product of the Google Cloud Platform. It allows to run any container “in a serverless way”: developers are able to deploy and run any language or library they want, and only pay for actual resources used when it receives requests. I demoed the feature during the Cloud Next 2018 keynote and other sessions. sign up for early access at g.co/serverlesscontainers

Advertisements

Setting up Stackdriver Error Reporting on Play Framework 1.4

Here is how I setup Stackdriver Error Reporting for my application running Play Framework 1.4:

My goal was to capture any Java exception in my production application and report it to Stackdriver Error Reporting for automatic exception monitoring and alerting.

I use the very simple Stackdriver Error Reporting report API: just send error stack traces using an HTTP POST request and an API key.

After creating a project and getting an API key in the Google Cloud Console, I instrumented my Play Framework application to catch all exceptions, format them in the expected structure and POST them to Stackdriver.  (make sure you are using at least JDK v1.7)

Here is the code I added to my main application controller:

A short amount of time after deploying this code, I started receiving alerts that new errors were occurring in my production application:

screen-shot-2016-11-10-at-1-04-09-pm
Screenshot of Stackdriver Error Reporting: 2 different errors occurred in my Play Framework app in the last 6 hours. The first one happened 42 times.

I was not aware of these application errors, now I have better visibility into their impact and will be able to prioritize what to fix.

My website (Cadeaux entre nous, to organize Secret Santas), has been running on Heroku for years and has huge usage spikes around christmas. This will help me make it more stable.

Disclaimer: I am a Product Manager at Google, working on Stackdriver