Installation Guide

Docker

For installations on Linux and as an alternative to the installer on Windows, you can use the Docker images of the Deep Learning DS Server. The images are available on Docker Hub. It is recommended to use Docker Compose to set up the Deep Learning DS Server.

Setup using Docker Compose

An exemplary docker-compose.yml file can be found below. The Deep Learning DS Server requires a PostgreSQL database as well as a Redis message broker and comprises the dlds-server and the dlds-frontend. The dlds-frontend is based on Caddy which not only serves the user interface but also acts as a reverse proxy to the backend.

In total, four Docker volumes are created:

  • dlds_db: Contains data of the PostgreSQL database (annotations, network model configurations, etc.)

  • dlds_data: Uploaded data of the backend (images, network checkpoints, etc.)

  • dlds_caddy_data: Corresponds to the Caddy data directory (e.g., TLS certificates)

  • dlds_caddy_config: Corresponds to the Caddy configuration directory (e.g., last active configuration)

You need to specify the following environment variables (either as environment variables in your system or - preferably - via a .env file; visit https://docs.docker.com/compose/environment-variables/ for details):

  • DLDS_POSTGRES_PASSWORD: Generate a password for the database and add it here.

  • DLDS_SECRET_KEY: Generate a secret key and add it here.

  • DLDS_HOSTNAME: Hostname of your system, e.g. localhost.

# .env
DLDS_POSTGRES_PASSWORD=postgres
DLDS_SECRET_KEY=mysecretkey
DLDS_HOSTNAME=localhost
CODE

On the first start, you need to set up the database:

docker-compose up -d db
docker-compose run backend bash init_db.sh
BASH

Afterward, you can start the remaining containers:

docker-compose up -d
BASH

If you want to stop the containers, use:

docker-compose stop
BASH

Afterward, you can start the server again with:

docker-compose start
CODE

Exemplary Docker Compose File:

# docker-compose.yml

version: '3.4'

services:
  db:
    image: postgres:12
    restart: unless-stopped
    environment:
      - POSTGRES_DB=dlds
      - POSTGRES_PASSWORD=${DLDS_POSTGRES_PASSWORD}
    volumes:
      - dlds_db:/var/lib/postgresql/data
  redis:
    image: redis:6.0.9
    restart: unless-stopped
  backend:
    image: dataspree/dlds-server
    restart: unless-stopped
    environment:
      - OPENBLAS_NUM_THREADS=1
      - DJANGO_SETTINGS_MODULE=DeepLearningDS.settings
      - DLDS_SECRET_KEY=${DLDS_SECRET_KEY}
      - DLDS_PORT=8000
      - DLDS_BACKEND_DOMAIN=${DLDS_HOSTNAME}
      - DLDS_FRONTEND_DOMAIN=${DLDS_HOSTNAME}
      - DLDS_DB_HOST=db
      - DLDS_DB_NAME=dlds
      - DLDS_DB_USERNAME=postgres
      - DLDS_DB_PASSWORD=${DLDS_POSTGRES_PASSWORD}
      - DLDS_ENABLE_REGISTRATION=true
      - DLDS_DATA_DIRECTORY=/dlds-data
      - DLDS_REDIS_HOST=redis
    ports:
      - "8000:8000"
    volumes:
      - dlds_data:/dlds-data
    depends_on:
      - db
  frontend:
    image: dataspree/dlds-frontend
    environment:
      - DLDS_FRONTEND_DOMAIN=${DLDS_HOSTNAME}
      - DLDS_BACKEND_DOMAIN=${DLDS_HOSTNAME}
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - dlds_caddy_data:/data
      - dlds_caddy_config:/config
volumes:
  dlds_db:
  dlds_data:
  dlds_caddy_data:
  dlds_caddy_config:
YAML

Setup External Access

In order to allow users from other clients to access the server, ensure that the firewall is properly configured: allow to communicate via ports 80 and 443 (inbound).

Furthermore, the environment variable DLDS_HOSTNAME must be set to the domain name of the server. In case you want to access the server via its IP address, you can also use it. Restart the server after you have changed the environment variables so that these changes are applied.

Setup Certificates

The Deep Learning DS Server is shipped with Caddy as a web server and reverse proxy. It is configured to create self-signed certificates on start-up that are stored in the Docker volume dlds_caddy_data in case you have used the Docker Compose file from above.

You can install this certificate into the trust stores of your clients.

Important: make sure to only distribute root.crt and no private keys.

It is recommended to use an existing PKI instead of self-signed certificates. For setting up HTTPS with custom certificates in Caddy, refer to:

You can edit the Caddy configuration /etc/caddy/config.json inside the dlds-frontend container for this purpose (e.g., write a Dockerfile that inherits from dlds-frontend and that modifies the configuration).

Once you finished these instructions, Deep Learning DS should be set up and running. You can now access Deep Learning DS via the domain you entered as DLDS_HOSTNAME: https://<DLDS_HOSTNAME>

Linux

The installation of Deep Learning DS on Linux is based on Docker. See the section “Docker“ for details.

Windows

There are two ways to install the Deep Learning DS Server on Windows: via Docker (see section “Docker”) and via an installer. The Docker-based installation gives more control on the setup whereas the installer is more straight-forward.

The Deep Learning DS Server Installer for Windows makes it very easy to install Deep Learning DS. Open the installer and follow the installation instructions. The installer will install a PostgreSQL database in the selected installation directory and set up a local web server for Deep Learning DS.

The default installation path for the Deep Learning DS Server is C:\Program Files\Data Spree\Deep Learning DS\Server\proxy.

After successful installation, the Deep Learning DS Server is started automatically.

Deep Learning DS is started in form of Windows services. You can see it’s status by opening the services window (e.g., via the Windows Task Manager) and checking the entries DeepLearningDSBackend and DeepLearningDSReverseProxy.

Once the server is started, you must follow two additional steps:

  1. Setup external access: after installation, full access is restricted to requests from the server directly (localhost). You need to specify the domain name for which access should be granted (see instructions below).

  2. Install certificate: self-signed certificates are generated during the initial start of the integrated webserver. It is recommended to exchange these certificates with your own ones or install the generated certificates at your clients.

Setup External Access

In order to allow users from other clients to access the server, ensure that the Windows firewall is properly configured: allow <DLDS-INSTALLATION-PATH>\proxy\caddy.exe to communicate via ports 80 and 443 (inbound).

Furthermore, the two environment variables DLDS_FRONTEND_DOMAIN and DLDS_BACKEND_DOMAIN must be set to the domain name of the server. In case you want to access the server via its IP address, you can also use it. Restart the server after you have changed the environment variables so that these changes are applied. On Windows, you can open services and restart the two services DeepLearningDSBackend and DeepLearningDSReverseProxy. Rebooting the server is another alternative.

Setup Certificates

The Deep Learning DS Server is shipped with Caddy as a web server and reverse proxy. It is configured to create self-signed certificates on start-up. The generated root certificate can be found (assuming Windows is installed on C:\) at:

C:\Windows\System32\config\systemprofile\AppData\Roaming\Caddy\pki\authorities\local\root.crt

You can install this certificate into the trust stores of your clients:

  • On Windows, right-click on the certificate file root.crt, select install and choose the certificate store “Trusted Root Certification Authorities” as location

  • Using Firefox, you can import the certificate in the settings menu

  • On Mac, you need to add the certificate via Keychain Access

Important: make sure to only distribute root.crt and no private keys.

It is recommended to use an existing PKI instead of self-signed certificates. For setting up HTTPS with custom certificates in Caddy, refer to:

You can edit the Caddy configuration <DLDS-INSTALLATION-PATH>\proxy\config.json for this purpose and restart Caddy by restarting the Windows service DeepLearningDSReverseProxy.

Once you finished these instructions, Deep Learning DS should be set up and running. You can now access Deep Learning DS via the domain you entered as DLDS_FRONTEND_DOMAIN: https://<DLDS_FRONTEND_DOMAIN>

First Start

On the first start of the Deep Learning DS Server, you must create an organization and an admin user. Open a browser and go to Deep Learning DS, e.g. running on https://localhost. You will be prompted to log in. Instead, click “register” and create your organization. Once you have done that, you must upload a valid license file (license.json) for your organization. Reach out to one of our sales representatives for more information on how to get a license (sales@data-spree.com).

After uploading the organization license, you can go to the settings of your organization to create more users and assign user licenses to them.

Releases

All releases are available for download at https://www.data-spree.com/resources/releases