Deploying Orkes Conductor in Docker

Deploying Orkes Conductor in Docker: Step-by-Step Setup and Configuration

Introduction

Orkes Conductor is a powerful orchestration engine designed for microservices and workflows. Originally developed by Netflix, it has become a popular choice for managing complex workflows in a microservices architecture. In this guide, we'll walk you through the step-by-step process of deploying Orkes Conductor using Docker, making it easier to get started with this robust tool.

Prerequisites

Before we dive in, ensure you have the following installed on your machine:

  • Docker: You can download and install Docker from the official website.
  • Java Development Kit (JDK): Ensure you have JDK 8 or later installed.
  • Git: For cloning the necessary repositories.

Step 1: Setting Up Docker

First, let's verify that Docker is installed and running on your machine. Open your terminal and run:

docker --version

You should see the Docker version information. If not, follow the installation instructions on the Docker website.

Step 2: Cloning the Orkes Conductor Repository

Next, clone the Orkes Conductor repository from GitHub:

git clone https://github.com/Netflix/conductor.git
cd conductor

Step 3: Building the Docker Images

Navigate to the docker directory within the cloned repository:

cd docker

Build the Docker images using the provided Docker Compose file:

docker-compose build

This command will build the necessary Docker images for Orkes Conductor.

Step 4: Running Orkes Conductor

Once the images are built, you can start the Conductor server and UI using Docker Compose:

docker-compose up

This command will start the Conductor server, Elasticsearch, and the Conductor UI. You can access the Conductor UI by navigating to http://localhost:5000 in your web browser.

Step 5: Configuring Orkes Conductor

With Orkes Conductor up and running, you may need to configure it to suit your needs. Configuration can be done through environment variables or configuration files. Here’s an example of setting environment variables in the docker-compose.yml file:

version: '3'
services:
  conductor-server:
    image: conductoross/conductor-server:latest
    environment:
      - CONFIG_PROP=value
    ports:
      - "8080:8080"
  conductor-ui:
    image: conductoross/conductor-ui:latest
    ports:
      - "5000:5000"
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.10.1
    environment:
      - discovery.type=single-node
    ports:
      - "9200:9200"

Step 6: Creating Your First Workflow

With Orkes Conductor up and running, let's create a simple workflow. Workflows in Conductor are defined using JSON. Here's an example of a basic workflow definition:

{
  "name": "sample_workflow",
  "description": "A simple workflow example",
  "version": 1,
  "tasks": [
    {
      "name": "task_1",
      "taskReferenceName": "t1",
      "type": "SIMPLE",
      "startDelay": 0,
      "inputParameters": {
        "param1": "value1"
      }
    },
    {
      "name": "task_2",
      "taskReferenceName": "t2",
      "type": "SIMPLE",
      "startDelay": 0,
      "inputParameters": {
        "param2": "value2"
      }
    }
  ],
  "schemaVersion": 2
}

Save this JSON to a file named sample_workflow.json.

Step 7: Registering the Workflow

To register the workflow, use the Conductor UI or the API. For simplicity, we'll use the UI:

  1. Navigate to the Conductor UI at http://localhost:5000.
  2. Go to the "Workflow Defs" tab.
  3. Click "Create New Workflow".
  4. Paste the JSON definition into the editor and save it.

Step 8: Executing the Workflow

Now that the workflow is registered, you can execute it:

  1. Go to the "Workflows" tab in the Conductor UI.
  2. Click "Start New Workflow".
  3. Select sample_workflow from the dropdown and start the workflow.

You should see the workflow execution details, including the status of each task.

Conclusion

Congratulations! You've successfully deployed Orkes Conductor using Docker and created your first workflow. This guide provides a foundation for exploring more advanced features of Orkes Conductor, such as task scheduling, error handling, and integrating with other microservices.

For more detailed information, refer to the Orkes Conductor documentation and the Baeldung guide on Orkes Conductor.

Happy coding! 🚀

Post a Comment

Previous Post Next Post