Nuxeo Add-Ons

Nuxeo Lambda PictureView Conversion

Updated: October 22, 2018 Page Information Edit on GitHub

Watch the related courses on Nuxeo University

Functional Overview

The Nuxeo Lambda PictureView Conversion addon enables users to dramatically improve the Nuxeo picture conversions speed by offloading this heavy processing from Nuxeo/WorkManager to AWS Lambda. As a result, the Nuxeo instance performance are highest when uploading thousands of pictures. Behind the scene, AWS Lambda has access to ImageMagick and generate externally picture conversions from assets stored in S3.

Prerequisites

Installation

This addon requires no specific installation steps. It can be installed like any other package with nuxeoctl command line or from the Update Center.

Configuration

The configuration is made of two steps:

Lambda Configuration

Lambda Function Initialization

  • Connect to AWS and search for the Lambda service
  • Create a new function with the following properties
    • Name: A unique name (test_nuxeoPictureConversion for example)
    • Runtime: Node.js 6.10
    • Role: You can leave the default value
    • Existing role: service-role/lambda-role

Your Lambda function should be initialized:

Lambda Function Import

  • Open your command line editor
  • Clone the nuxeo-lambda-pictureview-conversion GitHub project by executing:
    git clone https://github.com/nuxeo/nuxeo-lambda-pictureview-conversion.git
    
  • Go to nuxeo-lambda-pictureview-conversion/aws_lambda_impl folder and generate the package using npm i
  • Go to the nuxeo_lambda_impl folder and create a .zip file containing all its content
  • In the AWS Lambda function screen, go to the Function code section. At this point you need to generate a .zip file which stores the lambda function
  • Upload the .zip file in the Section package field and update the handler name to lambda_function.handler

Lambda Function Tuning

  • Ensure you have enough memory and your timeout is big enough (in the Basic settings section)
  • Check also that the timeout duration is reasonable (set to 1 or 3 seconds by default, which doesn't let enough time for picture conversions)

Nuxeo Server Configuration

Nuxeo Server needs to identify which lambda function to call for the picture conversion. This is done by adding the parameter nuxeo.lambda.image.conversion in the Nuxeo server configuration file nuxeo.conf and giving it a value to your function (test_nuxeoPictureConversion in our example).

Monitor the Lambda Function Activity

In order to see how the lambda function is running, click on the Monitoring tab of your AWS Lambda function.

On your Nuxeo server, when you import or create any picture, Nuxeo should convert successfully the different renditions and you should observe a pick of activity on the Invocation count and the Invocation duration diagram:

2 months ago Loubna Benzaama Fix Showcase Content add-on doc
History: Created by Loubna Benzaama

We'd love to hear your thoughts!

All fields required