Skip to content

JakovVisn/microservice-launcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Microservice Launcher

Microservice Launcher is cross-platform a C++ application using Qt framework for launching and managing microservices.

main_window.png

Table of Contents

Introduction

Microservice Launcher is designed to simplify the local development of microservices by facilitating the launching, stopping, and monitoring of their states. Additionally, it supports the creation of custom commands that can be integrated into the UI.

Features

Dynamic Directory Item Retrieval

Microservice Launcher dynamically retrieves the names of all items located in a specified Directory.

Custom Short Name Extraction

Microservice Launcher extracts a custom short name for each microservice using a specified script, short_name.sh. This script accepts the following argument:

  1. Directory of the microservice

If a short name is found, it will be displayed alongside the microservice's full name.

Custom Ports Extraction

Microservice Launcher extracts custom ports for each microservice using a specified command located in a ports.sh file. This script accepts two arguments:

  1. Directory of the microservice
  2. short name (or empty string if not exist)

If ports are successfully retrieved, they are displayed alongside the microservice's name. These ports are utilized for monitoring the state of microservices and getting the microservice's PID.

Search Functionality

The Microservice Launcher features a search bar that allows users to find microservices by name, short name, or ports. While users are typing, matching microservices are highlighted in real-time.

Microservice Status Display

Users cannot directly control this checkbox; it updates automatically when the application starts, before executing a command with the Execute for selected services flag enabled, or when the Refresh button is pressed. Depending on the status of the microservice, the checkbox changes its state:

  • If a process with the name of the microservice exists, the checkbox will be checked.
  • If there is no process with the name of the microservice and no ports are in use, the checkbox will be unchecked.
  • If no process with the name of the microservice exists but at least one port is in use, the checkbox will be checked and marked green, indicating that the microservice is running in debug mode.

Refer to the image above.

Microservice Selection Checkbox

The Microservice Launcher has checkboxes to select the microservices to which the command will be applied.

Command Menu Customization

Microservice Launcher includes a command menu that allows users to organize commands with buttons. When adding a new command, a corresponding button in the menu is not automatically generated. Instead, users can configure the button layout — including the number of rows and the style of each button — using the Configuration file.

command_menu.png

Settings Menu

Microservice Launcher includes a Settings menu where users can configure various options.

settings_menu.png

Save State on Exit Checkbox

  • The Save State on Exit checkbox enables users to save the state of checkboxes before exiting the application.

Flags Management Menu

Menu Flags Provides options for managing flags.

flags_management_menu.png

  • Show Flag Control Panel
    • Show Flag Control Panel checkbox controls the visibility of flags under each microservice, showing or hiding them without disabling them.
  • Add New Flag Button
    • Add New Flag button allows users to input a new flag and save it.
  • Apply Flags to All Services Button
    • Apply Flags to All Services button opens a menu with all existing flags. By selecting a specific flag, users can apply it to all services without needing to activate the Show Flag Control Panel.
  • Remove Flags from All Services Button
    • Remove Flags from All Services button opens a menu with all existing flags. By selecting a specific flag, users can remove it from all services without needing to activate the Show Flag Control Panel.

Add New Command Button

  • The Add New Command button opens a window for inputting parameters for a new command. After creating a command, the new command button immediately appears in the Additional Commands menu.

add_new_command.png

Command Name
  • The Command Name will be used as the name of the button that will be used to execute the command. Also by this name it will be possible to find this command in the Configuration file and change other parameters or the size of the button.
Script Name
  • One script can be used by different commands. The script must be located in the root of the application, with the given name.
Command
  • Thanks to Command, you can use the same script for different commands by passing different commands to it. Command is an optional argument.
Command Arguments
  • A list of arguments to be requested from the user before executing the command. The arguments will be passed to the script along with the rest of the arguments.
Execute for selected services checkbox
  • If checked, the script will be executed only for selected services. Otherwise, the script will be executed one time.
Disable currently selected services checkbox

Add New Save Button

  • The Add New Save button prompts users to enter a name for the new save, saves all selected checkboxes, and adds the save with the specified name to the Save menu.

Save Menu

  • Save menu contains all saves, created with Add New Save Button. By clicking on the save, the state of saved checkboxes will be restored.

Additional Commands Menu

  • This menu contains all commands, including main menu commands.

Custom Commands

Depending on Execute for selected services flag, different arguments will be passed to the script when it is executed:

  1. Command (or empty string if not exist)
  2. Directory
  3. List of command arguments (if were provided while command creation process)
  1. Command (or empty string if not exist)
  2. Directory
  3. Process name
  4. Short name (or empty string if not exist)
  5. PID of process (or empty string if process is not launched)
  6. List of command arguments (if were provided while command creation process)
  7. List of enabled flags (if exists)

Standard Commands

Microservice Launcher provides three default commands that are available to the user by default: Select All, Deselect All, and Refresh. The position, presence, and size of the standard command buttons can be customized through the Configuration file. Each command serves a specific purpose as described below:

Select All

Deselect All

Refresh

The Refresh button allows users to manually update the status indicator checkboxes for all microservices.

Configuration file

The config.ini file defines the behavior and layout of the Microservice Launcher application. Below is a detailed explanation of each section and its parameters.

  • Main

General settings for the application.

  • Directory
    • The directory where all microservices are located.
  • ExcludedFolders
    • List of directories within the Directory that should be ignored.
  • DefaultButtonStyle
    • The default style of buttons in the main window.
  • MainWindowButtons

The MainWindowButtons section defines the layout of buttons displayed in the main application window. Each entry in this group represents a row of buttons, where the order and names of buttons are specified as a comma-separated list.

  • Entry Format: Each row is labeled as buttonLayoutX, where X is a unique number (e.g., buttonLayout1, buttonLayout2).
  • Button List: Buttons in each row are listed in the desired order and separated by commas.
  • Flexibility: The number of rows (buttonLayout entries) and the number of buttons in each row are flexible. You can add as many rows or buttons as needed to customize the interface layout.
  • Save

The Save section keeps a group of services that will be launched by clicking the button with the corresponding name in the Save Menu. The number of saves is not limited. Each Save group starts with the group's name and contains a comma-separated list of services.

  • WindowSize

The WindowSize section defines the size of the main window in pixels.

  • height
    • The height of the main window in pixels.
  • width
    • The width of the main window in pixels.
  • Command_<Name>

Each Command_<Name> section defines a custom command that can be executed by the user. The <Name> of the section should contain the same name of the command. Each section can contain the following parameters:

  • scriptName
    • The name of the script that will be executed when the command is triggered.
  • command
    • The command that will be passed to the script as an argument.
  • args
    • A list of arguments that will be passed to the script.
  • executeForSelected
    • A boolean value that determines whether the command will be executed selected services or only once.
  • excludedServices
    • List of services that will be ignored when the command is executed
  • buttonStyle
    • The style of the button that will be used in the main window.

Deployment

  • Mac OS

To build the project on macOS, follow these steps:

  1. Download Qt for open source use from the official website.
  2. Open the project in Qt Creator.
  3. Select the Release profile.
  4. Build the project.
  5. Copy the built application to the Desktop.
  6. Use the macdeployqt tool to deploy the application:
   $HOME/Qt/6.8.2/macos/bin/macdeployqt $HOME/Desktop/MicroserviceLauncher.app
  1. Zip the application and send it to the recipient.
  2. The recipient needs to unzip the application and run the following command to remove the quarantine attribute:
   xattr -rd com.apple.quarantine $HOME/Downloads/MicroserviceLauncher.app
  • Linux

To build the project on Linux (tested on Ubuntu 20.04.6 LTS), follow these steps:

  1. Download Qt for open source use from the official website.
  2. Install C++ compiler:
   sudo apt install g++
  1. Open the project in Qt Creator.
  2. Select the Release profile.
  3. Build the project.
  4. Copy the built application to the Desktop/MicroserviceLauncher folder.
  5. Create a MicroserviceLauncher.desktop file in this folder.
  6. Download the linuxdeployqt tool from the official repository.
  7. Run the following command to deploy the application:
   $HOME/Downloads/linuxdeployqt-continuous-x86_64.AppImage $HOME/Desktop/MicroserviceLauncher/MicroserviceLauncher.desktop -appimage
  1. Zip the application and send it to the recipient.
  2. The recipient needs to unzip the application.

About

Cross-platform C++ application using Qt framework for launching and managing microservices.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors