How to use local service development in containerized Integration Server or Microservices Runtime?

Overview

In versions prior to 9.10, Designer used only the “default” Integration Server instance as the local development server. However, from version 9.10, you have the flexibility to designate any Integration Server instance as your local development server, provided that the selected instance is installed in the same directory as the active Designer instance. Furthermore, Software AG Designer 10.15 and later versions introduced local service development in containerized Integration Server or Microservices Runtime. The ability to designate any Integration Server instance as your local development server brings a new level of flexibility to your workflow.

This tutorial will guide you through leveraging the Integration Server or Microservices Runtime in a Docker container as your local development server.

Prerequisites

Before delving further, let’s ensure that:

  • Docker and Designer are installed on the same host.
  • Docker images are available in the Container Registry at https://containers.softwareag.com/
    Note: The Microservices Runtime images are readily available in the registry. However, you must create images for the Integration Server.
  • The latest fix is installed for Software AG Designer 10.15.
  • An existing Git repository is available.

To start off, let’s clone your existing Git repository to your local machine using the following command:
git clone <repository URL>

In this tutorial, the repository name is larrepo.

Setting Integration Server or Microservices Runtime as the Local Development Server

The tutorial helps you to streamline your local development server process in four easy steps:

  1. Create or pull Docker images from the specified registry.
  2. Use Designer to map the container volume.
  3. Add the cloned Git repository to your development environment.
  4. Create a local service development project.

Create or pull Docker images from the specified registry

Mount the corresponding host directory of the external Git repository in the Docker container:

  1. Pull the docker image with volume of the cloned repo and a valid port number using the following start up command:
  1. Container name
  2. Port number
  3. Host directory
  4. Installation directory and container path
  5. MSR image

Here, an MSR image is used and the port number is 5559.
You can also use the following sample command:

docker run -i -t -d \
--name $[container_name] \
-v $[container_named_volume]: [Install_Dir]/IntegrationServer/packages \
-v [host_git_project_location]:/[container_git_project_location]
-p [host_primary_port:]primary_port \
[image_name] \
/bin/bash

For MSR, there is a change in the path for the installation directory:
[Install_Dir]/IntegrationServer/packages

Copy the sample command and edit it according to your configuration.

  1. Confirm that the server definition is valid for the port number used by checking Window > Preferences > Software AG > Integration Servers.

As we have the option to enable local service development in a containerized Integration Server or Microservices Runtime, let’s see how to mount a file volume into the Docker container through Designer.

Use Designer to map the volume

  1. In Designer, select Window > Preferences > Software AG > Service Development > Local Service Development, and select Enable local service development in containerized Integration Server or Microservices Runtime.
  2. Click Add to set the docker volume and port details.
    The Add New Volume dialog box appears.
  3. Enter Host Path, Container Path, and click OK.
  4. Enter the port number in the designated field.

See the docker command and fill in the volume details:

  1. Click Apply to save the configuration.
    Now, you can see that the package is shared:

shared_package

Now, let’s add the cloned Git repository using Designer.

Add the cloned Git repository

  1. In Designer, go to Window > Show View > Other > Git > Git Repositories.

git_repo

  1. In Git Repositories, click Add an existing local Git repository.
  1. In the Add Git Repositories dialog box that appears, browse the cloned repository from your local machine.
  2. Click Add.
    The added Git repository is now available in Git Repositories.

added_git_repo

So, you have enabled local service development, mounted the volume to Docker container, and added the Git repository. Now, let’s create or convert a project as a local service development project.

Create a Local Service Development project

You can create a package and convert it to a local service development project or import a package from a Git repository.

In this tutorial, you will create a package and convert it.

Create a new package and add assets

  1. In Designer, go to File > New > Package.
  2. In the New Integration Server Package dialog box, select the Integration Server in which you want to create the package.
  3. In the Name field, type the name for the new package using any combination of letters, numbers, and the underscore character.
  4. Click Finish.
    Designer refreshes the Package Navigator view and displays the new package.
  5. Create an empty flow service and define it by inserting flow steps.

package_assets

Convert the package as a local service development project

  1. In Package Navigator view, right-click the package for which you want to create a local service development project and select Create Local Service Development Project.
  1. Designer notifies you to refresh your workspace resources before performing VCS operations. Click OK to proceed.
    Note: Refresh your workspace using native hooks or polling preferences in Preferences > General > Workspaces or refresh manually.
  2. Designer notifies again that containerized Integration Server or Microservices Runtime requires a local service development utility API. Click OK to install a local service development utility package.
    The Repository dialog box displays the list of volumes mounted.
  3. Select the mapped repository (Host Path and Container Path).
  4. Enter your path within your repository (optional).
  5. Click OK.
  6. In the Share Project dialog box that appears, select the repository location.
  1. Click Finish.
    In the Package Navigator view, you can see the repository link created for the project.

converted_LSD_project

Now, the demo package is converted to a local service development package.

We can also add these changes to a Git repository. As you have the larrepo repository cloned and added in Designer. Let’s commit these changes to the repository.

Commit changes to the cloned repository

  1. Right-click the newly created local service development package, select Teams > Commit.

In Git Staging, you can see the unstaged changes.

  1. In Git Staging, review and commit changes, then click Push Head.
  2. Click Commit and Push after adding a commit message.
    You can verify the results in Designer.

commit_push

So, you have successfully created a package, converted it as a local service development project and shared it to your cloned repository. Additionally, you also committed some changes to the shared project and pushed the changes to your existing Git repository in a few minutes. This setup allows you to efficiently collaborate on shared projects.

With Docker at the helm, your local development environment becomes a dynamic, reproducible space that adapts to the evolving demands of your projects. For further exploration and troubleshooting, consider joining our community forum.


This article is part of the TECHniques newsletter blog - technical tips and tricks for the Software AG community. Subscribe to receive our quarterly updates or read the latest issue.

5 Likes