ServerKit ¶
The IDLive Doc Server is built on the top of the Ubuntu 20.04 base image. If you wish to use your own base image, you need the Server Kit. It is a bundle that contains IDLive Doc Server's files and a Dockerfile to produce the final image.
The Server kit requires:
- Docker 18.09+
- Prepared base image
- IDLive Doc SDK bundle
- IDLive Doc license
Prepare base image¶
The base image should use Linux distribution that satisfy these requirements:
- Built for x86-64 architecture.
- Based on glibc 2.31+ and Bash. You can't use Alpine Linux.
- Uses deb or rpm based Package Manager.
You need to setup the image as required by the IDLive Doc Server:
- Install Java 17+.
- Create a user and a group named server.
If you use the GPU build you should also install the CUDA runtime.
This is an example of the Dockerfile for the image based on Ubuntu:
FROM ubuntu:20.04
RUN apt-get update \
&& apt-get install -y openjdk-17-jre-headless \
&& rm -rf /var/lib/apt/lists/*
RUN useradd --create-home server
Red Hat Universal Base Image 9
On Red Hat UBI 9 you need to additionally install chkconfig package:
yum install chkconfig -y
Without it you can get Unsupported Linux distribution error.
Build server image¶
First, unpack the Server Kit bundle:
mkdir -p serverkit && tar zxf docsdk-serverkit.tar.gz -C serverkit --strip-components=1
Once you've unpacked the Server Kit's archive, there will be a docsdk directory there. You need to unpack the IDLive Doc SDK bundle into this directory. Make sure there is no intermediary directories:
tar zxf docsdk-linux.tar.gz -C serverkit/docsdk --strip-components=1
Next, unzip the license files into the docsdk/license directory:
unzip -j idld-license-hasp.zip -d serverkit/docsdk/license
Finally build the server image with Docker in the BuildKit mode. Use the build argument FROM to specify the base image:
export DOCKER_BUILDKIT=1
docker build . --tag idlivedoc-server --build-arg FROM=base-image
If you can't use BuildKit, there is a Dockerfile that works without it:
docker build . --file Dockerfile.nobuildkit --tag idlivedoc-server --build-arg FROM=base-image
Note that in this case the resulting image will be bigger in size.
GPU engine cache generation¶
For GPU-enabled servers, you can significantly improve startup time by pre-generating GPU engine cache files. The ServerKit includes scripts in the build_gpu_cache directory that automate this process and provide two deployment options:
Cache Generation Options¶
Embedded Cache: Creates a single Docker image with the IDLive Doc Server and pre-built GPU cache included. This provides the simplest deployment model as the cache is bundled directly into the server image.
Cache-Only Image: Creates a separate "data-only" Docker image containing only the GPU cache files. This image can be mounted as a volume alongside the main server image, allowing for more flexible deployments and cache sharing across multiple server instances.
Performance Benefits¶
Pre-built GPU cache provides:
- Faster Startup: Eliminates TensorRT engine compilation during server initialization
- Predictable Performance: Consistent initialization times across deployments
- Reduced Resource Usage: Lower CPU, GPU and memory usage during startup
Note
GPU cache files are specific to the GPU device and compute capability. Cache generated on one GPU model cannot be used on different hardware and must be regenerated for each unique GPU configuration.