Local deployment and development

Overview

Provides explicit information about the local deployment of the Eureka platform and useful development notes.

System pre-requisites

Windows

The local deployment will work with installed Docker Desktop or with Windows WSL: https://learn.microsoft.com/en-us/windows/wsl/install.

Working with the virtual machine is possible, make sure that Docker and Docker-Compose CLI are compatible.

WSL preparation

1. Install WSL and OS (of your choice)

Follow the guide to install WSL: How to install Linux on Windows with WSL
Make sure that the installed distribution is run with WSL v2.0. It can be checked with the following command:

$ wsl -l -v NAME STATE VERSION * Ubuntu-22.04 Running 2

2. Enable systemd

Enable systemd: Use systemd to manage Linux services with WSL
NOTE: Before performing this operation you can check if systemd is already enabled:

# in WSL: sudo cat /etc/wsl.conf

if it contains the following lines then this step can skipped.

[boot] systemd=true

Ensure systemd is running

Install docker for your distribution

  1. Ensure WSL is up-to-date

  2. Install prerequisites for Docker

    Still in the terminal, change the network config so that Docker can interact with the firewall using the command below:

    When asked, choose iptables-legacy.

  3. Install Docker
    Make sure Ubuntu trusts the Docker packages

    Then install Docker, Docker-Compose CLI, and containerd:

    Verify the Docker service status

  4. Configure a user to work with Docker (Optional, it will allow to run docker command without root access)
    Add our user to the Docker group:

    To confirm the change worked, close the terminal tab and open a new Ubuntu tab, then run:

    It should now list the docker group if it doesn't, repeat the previous command.

    Now, we'll need to assign a group ID to Docker. First, let's check if an example ID is unused:

    If not, retry with another ID. After finding an unused ID, use it in the following step:

    We'll need to restart Ubuntu now. To do this, close the terminal, then open the command line as administrator and run:

    Wait 7-10 seconds to open the Linux terminal and run the following commands:

Install python v3

Python provides an ability to manipulate with deployment locally, and part of scripts using it to update the version of containers, discovery information, etc. It can be installed from Python.org

check the Python version

It should be Python 3.10.12 or higher

Install JQ

jq is a tool to manipulate with JSON objects

Check jq version, it should be like jq-1.6

Expose Docker to Windows shell and Idea

To expose the Docker command a simple executable file can be added to Windows $PATH:

To expose Docker's TCP port securely, you can use an SSH tunnel from Windows to WSL.

  1. Install SSH Server in WSL:

    • Update your packages and install OpenSSH:

  2. Ensure SSH is running:

  3. Configure SSH (if necessary):

    • You might want to configure SSH to start automatically or adjust settings, but default settings are usually sufficient for local development.

  4. Create an SSH Tunnel from Windows:

    • Open a command prompt or PowerShell in Windows.

    • Create an SSH tunnel mapping the Docker socket:

    • This command forwards the local port 2375 to the Docker socket in WSL. Replace your_wsl_username with your actual WSL username.

  5. Set DOCKER_HOST in Windows:

    • Set the DOCKER_HOST environment variable to use the local forwarded port (in PowerShell or using Edit the System environment variables in Control Panel):

Linux

Will be added

MacOS

Will be added

Enabling container management

A suggested solution is to use the Portainer (under Zip License).

It can be set by following the guide: https://docs.portainer.io/start/install

Create a volume to persist Portainer information

Then run a container, it will start automatically with Docker

It became available in the browser via

Docker compose profiles

core-components

Provides base infrastructure to run the Eureka platform, such as database, secret management, etc.

mgr-components

Provides a deployment for Eureka platform management:

  • mgr-tenants is responsible for managing tenants in the system

  • mgr-applications is responsible for applications and module discovery

  • mgr-tenant-entitlements is responsible for managing applications per tenant (entitlement, upgrade and revoke processes per tenant)

app-platform-minimal

`app-platform-minimal` contains basic functionality for Eureka platform:

  • User and AuthUsers management (mod-users-keycloak + mod-users + mod-users-bl)

  • Authentication and authorization (keycloak + mod-login-keycloak + sidecars)

  • Capability/Role/Policy management (mod-roles-keycloak)

  • Scheduled timers support (mod-scheduler)

  • Notes (mod-notes)

  • Tenant settings management (mod-settings)

Installation

app-platform-minimal installation instruction is described in eureka-platform-bootstrap README.md in section Run applications in docker