Skip to content

Deployment

Single container

  • Make sure you have Docker installed:
    apt-get install docker.io
    
  • Make sure to add your user to docker group if you are not using root (more info):
    sudo usermod -aG docker $USER
    sudo reboot
    
  • Load IDLive Doc server image:
    docker load -i idlivedoc-latest.tar
    
  • Launch image:
    docker run -d --name das --publish 8080:8080 -e IDLIVEDOC_SERVER_AVAILABLE_PIPELINES="default-sr,default-pc,default-ps" idlivedoc-latest:latest
    

Note

If you are using a GPU-enabled IDLD Docker image, make sure to enable the GPU runtime.

Once the container is started, it exposes the OpenAPI specification at http://<host>:8080/v3/api-docs. It can be imported in tools like Swagger Editor or Postman. Also the container exposes the Swagger UI at http://<host>:8080/swagger-ui/index.html.

Docker Swarm

The configuration is located in "swarm" sub folder of the package. First, increase max virtual memory areas. It is necessary for the correct operation of Elasticsearch. For more information on ELK setup please refer to this documentation section.

sudo -i
echo "vm.max_map_count = 262144" > /etc/sysctl.d/20-elk-stack-reqs.conf
sysctl -p

Then you can launch the cluster using Swarm mode.

docker swarm init
docker stack deploy -c idlivedoc-server-cluster.yml das-cluster

It includes two services: document anti-spoofing itself scaled to three instances and one dedicated ELK logging instance that collects logs from them.

You may tweak sample values to add more replicas and change environment variables such as LOGSTASH_* as you like. If LOGSTASH_HOST or LOGSTASH_PORT variables are not present, logging will only be performed to the local docker console. For more information on logging configuration please refer to this documentation section. After cluster is started you'll have two ports exposed:

  • Port 8080 - REST service load-balanced between replicas with Ingress
  • Port 5601 - Kibana frontend for log indexer

Example of configuration files: idlivedoc-idlivedoc-cluster.yml, idlivedoc-server-logstash.conf

Kubernetes

This part assumes you have a Kubernetes cluster already set up, otherwise you may try it with minikube on your own machine, GKE or Amazon EKS. Steps to set up a sample ad-hoc cluster for Kubernetes, create pods and ReplicaSet, are below:

kubectl run das --image=idlivedoc-server --port 8080 --replicas=$YOUR_NODE_COUNT

Check pods are running.

kubectl get pods

Expose the service on same port on all the nodes. You can use LoadBalancer instead of NodePort type here if you have GKE or Amazon EKS.

kubectl expose deployment das --type=NodePort
kubectl get services