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 |
---|---|---|---|
|
|
||
Download or Install from the provided USB Stick Resources |
Download or Install from the provided USB Stick Resources |
||
OpenJDK v11 |
|
||
|
|
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:
-
Click on the Extensions icon in the Activity Bar on the side of VS Code, search and install.
-
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
-
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.
|
Optional tools
kn-workflow
is a handy tool for deploying your project in OpenShift, but it can also be used to run the workflow locally in a container (so you don’t need to configure Java and Quarkus).
Download the latest tar archive suitable for your environment, from the Serverless Logic download mirror page.
Podman Installation and configuration
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:
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
Follow this guide for the podman installation: https://github.com/containers/podman/blob/main/docs/tutorials/podman-for-windows.md
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
Pull the Serverless Workflow devmode image
In order to run and test the Serverless Workflow project locally, you need a container image which is lauched behind the scene by kn-workflow
.
However, as it’s distributed through the official Red Hat registry, you’ll need 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/logic-swf-devmode-rhel8:1.34.0
The parameter --platform linux/amd64 is important when you run it on a Mac with an M1 chip (which has a different processor architecture)
|