← Articles

Library license in Docker and Kubernetes and on machines without internet

The libscanner libraries — DataMatrix reading (dmr), universal code reading (unir) and DataMatrix generation (dmgen) — run under a license. A regular license is tied to the machine hardware. In a container that does not work: containers are recreated, move between hosts and run by the dozen. For that there is the instance license. Below: how both kinds work and how to run without internet access.

Two kinds of license

Machine licenseInstance license
What is countedMachines: the license is tied to the hardware (motherboard, CPU, system disk)How many processes with the library run at the same time — containers, pods, virtual machines
Where it worksA regular computer or serverAnywhere: Docker, Kubernetes, cloud instance groups, a regular server
ActivationWith the key over the network, or with a file without internetNot needed: pass the key to the container, the library does the rest
Without the license serverUp to 14 days; with a file activation “for the whole term” — until the paid term ends7 days since the last report

The kind is set by the plan, not by the environment: an instance key works on a regular server too, while a machine key does not activate in a container — the library says so: a container needs an instance license. A purchased machine license can be switched to instances through support.

Instance license: Docker and Kubernetes

Pass the key to the container as an environment variable or a secret. Nothing to activate or release: containers can be recreated, scaled and moved between hosts as often as you like.

LibraryEnvironment variableSecret (file)
unir 1.2UNIR_LICENSE_KEY/run/secrets/unir.key
dmr 1.1DMR_LICENSE_KEY/run/secrets/license.key
dmgen 1.1DMGEN_LICENSE_KEY/run/secrets/dmgen.key

Docker Compose:

services:
  reader:
    image: my-reader:latest
    environment:
      UNIR_LICENSE_KEY: ${UNIR_LICENSE_KEY}   # the key from your account

Kubernetes — the key in a Secret, passed to the container as a variable:

kubectl create secret generic unir-license --from-literal=key=UNIR-XXXXX-XXXXX-XXXXX-XXXXX

# in the pod spec
env:
  - name: UNIR_LICENSE_KEY
    valueFrom:
      secretKeyRef: { name: unir-license, key: key }

The variable is checked first, then the file in /run/secrets/, then — as before — the key file next to the library and the program.

How instances are counted

  • At start the process takes a seat on the license server. While it runs, the library marks the 5-minute slices in which it read or generated codes and sends the marks in a batch every 30 minutes in the background. At start the server learns the host or pod name, the library version and the OS — for the list in your account; frames, codes and program data are never sent.
  • What counts is how many instances run at the same time, not how many there were in a month. An instance that crashed without stopping frees its seat within an hour.
  • An instance is a process. Worker processes started with fork after the library is loaded (gunicorn with --preload, multiprocessing) are each an instance of their own: the seat is taken on the first code read or generated in that process. A master process that neither reads nor generates codes itself frees its seat within 30 minutes.
  • Peaks above the purchased number are allowed: up to 2 × N instances (N — the purchased number) can start at once, and the time above N is taken from a monthly allowance of 10 % of the purchased capacity. You get an email at 50, 80 and 100 % of the allowance.
  • Once the allowance is used up, new instances above N do not start until the end of the month (“all seats are taken”); running instances keep working. The allowance renews on the 1st.
  • Without a connection to the license server each instance keeps working for 7 days since its last report, then reports “a connection to the license server is required”.

In your account an instance license shows how many instances run now out of N, a chart for the last 24 hours, how much of the monthly allowance is used, and the running instances with their host or pod name and library version. Inside the container unir --license status shows the “instances” mode, the number of paid seats and until when the instance works without a connection.

Container trial key

The 30-day trial without a key does not apply in a container: every recreation would reset it. To try the library in Docker or Kubernetes, get a container trial key in your account: 2 instances for 30 days, one per account for each product; a confirmed email is required.

A machine without internet: for the whole term

If a machine never goes online — say, a computer on a production line — a machine license can be activated with a file so that it works until the end of the paid term without ever contacting the server:

  1. On the machine: unir --license request request.json — a request file with the machine fingerprint.
  2. On a computer with internet: open the license in your account, the “Offline activation” section, upload the request, tick “Machine without internet — work the whole term offline” and download license.lic.
  3. On the machine: unir --license import license.lic.

Renewal: pay for the renewal in your account, make a new request on the same machine and get a new license.lic — the machine keeps its seat. Moving to another machine: unir --license deactivate receipt.json on the old one, upload the receipt to your account, then a request from the new machine. If the old machine is lost — through support.

Note: after such an activation the license is not refundable — the server cannot verify that the machine has stopped using it. Your account says so next to the checkbox. For dmr and dmgen the commands are the same: dmr --license …, dmgen --license ….

Try it

Libraries and documentation are on the documentation page. The container trial key and activation without internet are in your account after registration.

Chestny ZNAK is a trademark of CRPT LLC (ООО «Оператор-ЦРПТ»); GS1 is a trademark of GS1 AISBL. The product is not affiliated with or certified by their owners.