DNA //evolutions

JOpt TourOptimizer on Linux

This document describes how to host JOpt TourOptimizer locally on Linux systems. It is intended for system administrators, DevOps engineers, and integrators who want to operate JOpt on a single machine or within an on-premise Linux environment without Kubernetes.

The document focuses on container-based hosting, which is the recommended approach for Linux deployments. Native execution of the Spring application is possible but not covered here.


System Requirements

The following prerequisites must be met on the target Linux system:

  • 64-bit Linux distribution (x86_64 or ARM64)
  • Linux kernel with cgroup and namespace support
  • Docker-compatible container runtime (Docker Engine, containerd, Podman, etc.)
  • Minimum recommended resources:
    • CPU: 2 cores
    • Memory: 4 GB RAM
  • CPU virtualization enabled (recommended for performance)

Architectural Overview

When hosted locally on Linux, JOpt TourOptimizer runs as a single containerized Spring application:

  • The application exposes REST endpoints via HTTP
  • Configuration is provided via environment variables or configuration files
  • Logs are written to standard output
  • Persistent data (if required) is mounted via volumes

The deployment model is simple and well suited for development, testing, and small to medium on-premise installations.


Container Runtime Setup

Install a Docker-compatible container runtime using your distribution’s package manager.

Example (Docker Engine on Debian/Ubuntu):

sudo apt update
sudo apt install docker.io
sudo systemctl enable docker
sudo systemctl start docker

Ensure your user is allowed to run containers:

sudo usermod -aG docker $USER

Log out and back in to apply the group change.


Running JOpt TourOptimizer

Basic Container Execution

Once the container runtime is available, JOpt TourOptimizer can be started using a simple container run command.

Example:

docker run \
  --name jopt-touroptimizer \
  -p 8080:8080 \
  dna-evolutions/jopt-touroptimizer:latest

After startup, the application will be available at:

http://localhost:8080

Configuration via Environment Variables

JOpt follows standard Spring configuration conventions. Configuration values can be passed using environment variables.

Example:

docker run \
  --name jopt-touroptimizer \
  -p 8080:8080 \
  -e SPRING_PROFILES_ACTIVE=linux \
  -e JOPT_LICENSE_KEY=<license-key> \
  dna-evolutions/jopt-touroptimizer:latest

Configuration via Files

For more complex setups, configuration files can be mounted into the container.

Example:

docker run \
  --name jopt-touroptimizer \
  -p 8080:8080 \
  -v /opt/jopt/config/application.yml:/app/config/application.yml:ro \
  dna-evolutions/jopt-touroptimizer:latest

Spring will automatically detect configuration files located in standard search paths.


Resource Management

JOpt performs compute-intensive optimization tasks. Explicit resource limits are recommended to ensure predictable behavior.

Example:

docker run \
  --name jopt-touroptimizer \
  -p 8080:8080 \
  --cpus="2.0" \
  --memory="4g" \
  dna-evolutions/jopt-touroptimizer:latest

Running as a System Service

For production-like environments, it is recommended to run JOpt as a managed system service.

Example using systemd:

[Unit]
Description=JOpt TourOptimizer
After=network.target docker.service
Requires=docker.service

[Service]
Restart=always
ExecStart=/usr/bin/docker run --rm \
  --name jopt-touroptimizer \
  -p 8080:8080 \
  dna-evolutions/jopt-touroptimizer:latest
ExecStop=/usr/bin/docker stop jopt-touroptimizer

[Install]
WantedBy=multi-user.target

This ensures automatic startup and restart after failures or reboots.


Logging and Monitoring

  • Logs are written to standard output and can be accessed using:
    docker logs jopt-touroptimizer
    
  • Integration with external logging solutions can be achieved via Docker logging drivers.
  • Spring Boot Actuator endpoints may be enabled for health and metrics monitoring.

Security Considerations

  • Run containers as non-root whenever possible
  • Store license keys and credentials outside of shell history
  • Restrict network exposure using firewall rules
  • Prefer HTTPS if exposing the service beyond localhost

Update and Maintenance

To update JOpt TourOptimizer:

docker pull dna-evolutions/jopt-touroptimizer:<new-version>
docker stop jopt-touroptimizer
docker rm jopt-touroptimizer
docker run ...

Always test new versions in a staging environment before upgrading production systems.


Summary

Hosting JOpt TourOptimizer locally on Linux provides a simple and reliable deployment model with minimal operational overhead. By leveraging container runtimes and standard Spring configuration mechanisms, the application can be operated consistently across development and on-premise production environments.

For high availability, scalability, or multi-tenant setups, a Kubernetes-based deployment is recommended instead.