Setup

This section provides guidance on how to set up your local computer to host a OpenShift Serverless Logic development environment.

It’s recommended to execute this section with a reliable connection. Avoid running this part of the lab together with other people because of the bandwidth required. Moreover, some tasks will take a long time to download resources.

Prerequisite tools

The following CLI tools are required for running the exercises in this tutorial. Please have them installed and configured before you get started with any of the tutorial chapters.

Tool Fedora MacOS Windows

git

dnf install -y git

Download

Download

Visual Studio Code

Download or Install from the provided USB Stick Resources

Download or Install from the provided USB Stick Resources

Download or Install from the provided USB Stick Resources

OpenJDK v11

dnf install -y java-11-openjdk-devel

Mac Version Download

Windows Download

Apache Maven

dnf install -y maven

Download

Download

podman v4.3.1

Check the detailed instructions below under the proper tab

If you have already installed Docker in your environment, or you feel more comfortable with it, feel free to replace Podman with Docker.

Instructions to install Podman and configure Quarkus (Testcontainer) to rely on it:

  • Fedora

  • Mac

  • Mac (Apple M1)

  • Windows

Issue the following commands:

sudo dnf install -y podman podman-docker

Make sure that you have installed the 4.3.1 version or later, issuing podman --version:

podman version 4.3.1

Enable podman socket listener:

systemctl --user enable podman.socket --now

Configure Testcontainers through the following commands:

echo "docker.host = unix:///run/user/$(id -u)/podman/podman.sock" > ~/.testcontainers.properties
echo "ryuk.container.privileged = true" >>  ~/.testcontainers.properties

For more information and troubleshooting refer to https://quarkus.io/guides/podman#linux

Leverage Homebrew to install Podman and its required dependencies:

brew install podman

Make sure that you have installed the 4.3.1 version or later, issuing podman --version:

podman version 4.3.1

Install podman helper:

sudo /usr/local/Cellar/podman/4.3.1/bin/podman-mac-helper install

Create your Podman machine, set it to run rootful containers, then start it:

podman machine init
podman machine set --rootful
podman machine start

Configure Testcontainers through the following commands:

echo "ryuk.container.privileged = true" >  ~/.testcontainers.properties

Leverage Homebrew to install Podman and its required dependencies:

brew install podman

Make sure that you have installed the 4.3.1 version or later, issuing podman --version:

podman version 4.3.1

Install podman helper:

sudo /usr/local/Cellar/podman/4.3.1/bin/podman-mac-helper install

Create your Podman machine, set it to run rootful containers, then start it:

podman machine init
podman machine set --rootful
podman machine start

Add support for running x86_64-based containers on a Mac with an M1 chip with the following commands

podman machine ssh
sudo -i
rpm-ostree install qemu-user-static
systemctl reboot

Configure Testcontainers through the following commands:

echo "ryuk.container.privileged = true" >  ~/.testcontainers.properties

Make sure that you have installed the 4.3.1 version or later, issuing podman --version:

podman version 4.3.1

Before starting the Podman machine, set it to prefer rootful container execution:

podman machine set --rootful

Visual Studio Code Extensions

Launch Visual Studio Code to install the following extensions:

  • Language Support for Java™ by Red Hat

  • Kogito Serverless Workflow Editor

  • REST Client (from Huachao Mao)

There are 2 ways:

  1. Click on the Extensions icon in the Activity Bar on the side of VS Code, search and install.

    extensions view icon
  2. Launch VS Code Quick Open (Ctrl+P), paste the following commands, and press enter:

    • ext install vscjava.vscode-java-pack

    • ext install redhat.vscode-extension-serverless-workflow-editor

    • ext install humao.rest-client

Pull the serverless data index image

In order to run and test locally the Serverless Workflow project, you need the data index container image, it will be started behind the scene by Quarkus. However, since it’s distributed through the Red Hat official registry you have to login before pulling the image.

Find here the instruction on how to create / retrieve your credentials: Registry Authentication

Login to registry.redhat.io with your Red Hat credentials;

podman login registry.redhat.io

Pull the serverless data index image:

podman pull --platform linux/amd64 registry.redhat.io/openshift-serverless-1-tech-preview/logic-data-index-ephemeral-rhel8:1.28
The parameter --platform linux/amd64 is important when you run it on a Mac with an M1 chip (which has a different processor architecture)

Clone and build the startup project

Get your local copy of the start-up project:

Enter in the project folder and start Quarkus in dev mode.

cd order-swf
mvn quarkus:dev
The first time you launch maven on this project, it is going to take a considerable amount of time because it has to download all the dependencies from the Internet.