Server-side rendering construction example

Preface

Some developers may have some questions when starting to build their own rendering services. This article uses the architecture of our cloud rendering products as an example to facilitate customers to understand what needs to be done for cloud rendering deployment.

Server environment and SDK deployment

First download the SDK and integrate it into the development environment http://www.seeshiontech.com/docs/page_8.html .

Installation dependencies

First, you need to disable the default graphics driver

​sudo vim /etc/modprobe.d/blacklist-nouveau.conf​

  • Add the following:

​blacklist nouveauoptions nouveau modeset=0​

  • After saving and exiting, execute the following command to update the kernel initramfs

​sudo update-initramfs -u​

  • After restarting, run the following command to check if nouveau is running:

​lsmod | grep nouveau ​

  • No output means disable

Secondly, you need to install related dependencies

apt-get -y install dirmngr​

apt-get -y install software-properties-common​

​sudo apt-key adv --keyserver​​keyserver.ubuntu.com​​--recv-keys 8CF63AD3F06FC659​

​add-apt-repository ppa:jonathonf/ffmpeg-4​

apt-get update

​apt-get -y --allow-unauthenticated install ffmpeg​

​apt-get -y install libfreeimage3​

Install the corresponding graphics driver

Template management section

The backend will maintain a resource list, save the compressed package of the template and the config.json file. When the user accesses the front-end page, the config.json file of the template will be returned to the front-end according to the template id selected by the user, and the front-end will use this file to generate the editing interface.

Task generation part

The back end needs to expose a web interface, which will receive the rendering and user-related data submitted from the front end. The front end uploads the relevant materials, and submits the download connection, text content, and template id of the material to the web interface.

After receiving the template id, material download address, and text content on the back-end interface, it can perform some business processing by itself, and then push the combined task data into a queue.

Task processing part

The business code responsible for processing the rendering task needs to be separated from the business logic generated by the task, and the compiled rendering platform code can be run on multiple GPU servers.

The rendering platform needs to do the following in order.

  1. Monitor the rendering task queue and get the rendering tasks preemptively.

  2. Prepare to render data:

    a. Download the template address, picture material, video material, audio material in the task data
    b. Mix the local path of the downloaded material and the text information in the rendering task, and generate the rendering task data according to the replaceJson format required in the official website

  3. Start rendering and wait for the rendering result.

  4. After the rendering is completed, the rendering result notification data is passed to the rendering result queue.

Service monitoring part

The service monitoring platform will be responsible for the following tasks

  1. Continuously monitor the rendering result queue, and when a message is received, it will process it according to the task result.
  2. Query the failure of tasks in the most recent time period at regular intervals

Guess you like

Origin blog.csdn.net/weixin_41191739/article/details/111175652