Skip to content

Latest commit

 

History

History
85 lines (60 loc) · 2.97 KB

dev-setup.md

File metadata and controls

85 lines (60 loc) · 2.97 KB

Development environment

This is docker-compose based dev-setup which helps to deploy dependent services like cloud-connector, playbook-dispatcher and host-inventory locally.

Installation

Before starting the development make sure below packages/binaries are installed on the system.

Package/binary Version Documentation
golang >=1.17 https://go.dev/doc/install
mqtt cli >=4.24.0 https://hivemq.github.io/mqtt-cli/docs/installation/
docker & docker-compose latest https://docs.docker.com/desktop/install/fedora/
librdkafka & librdkafka-devel latest Use package-manager to install it. dnf install -y librdkafka librdkafka-devel
kcat (formaly kafkacat) latest https://docs.confluent.io/platform/current/tools/kafkacat-usage.html

Clone the repository

git clone [email protected]:RedHatInsights/config-manager.git

Update /etc/hosts with below.

127.0.0.1       kafka
127.0.0.1       minio

Usage

Run dependent services

Use below command to start kafka, cloud-connector, playbook-dispatcher and other dependent services.

cd scripts
docker-compose up

Note - If you are unable to pull image from quay.io then try to login quay.io using docker login quay.io and run docker-compose up again.

After running docker-compose up run the below command give a minute for all the container to come up and then run below command and make sure there are >=20 containers running.

docker ps | wc -l 

Now we are ready to start config-manager locally.

Running inventory-consumer locally.

Use the below make command to start inventory-consumer service.

make start-inventory-consumer

Sending data to local config-manager.

make send_mqtt_msg

Above command sends host-registration request to host-inventory and also send the connection status to cloud-connector service.

On the terminal where you ran make start-inventory-consumer you will see logs populating. At this point config-manager tries to setup the host by installing rhc-worker-playbook package and applies current org profile to the host.

Running dispatcher-consumer locally.

Use the below make command to dispatcher-consumer service.

make start-dispatcher-consumer

Sending data to local dispatcher-consumer.

make send_run_event_msg

The above command sends a run event message to the platform.playbook-dispatcher.runs topic which is then consumed by our dispatcher-consumer service.

Running config-manager API.

Use the below make command to start api server.

make configure-xjoin
make start-httpapi