Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to use input cluster_mode and docker compose files #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.idea
5 changes: 0 additions & 5 deletions Dockerfile

This file was deleted.

25 changes: 17 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
# redpanda github action

This [GitHub Action](https://github.com/features/actions) sets up Redpanda instance.
This [GitHub Action](https://github.com/features/actions) sets up Redpanda instance in Single Broker or Three Broker Cluster mode.

Docker images source [redpanda-data/redpanda](docker.vectorized.io/vectorized/redpanda).
Docker images source [redpanda-data/redpanda](https://hub.docker.com/r/redpandadata/redpanda).

---------
# Usage

See [action.yml](action.yml)

Basic:
Single Broker Mode:
```yaml
- name: start redpanda
uses: redpanda-data/github-action@v0.1.3
uses: redpanda-data/github-action@v1.0.0
with:
version: "latest"
cluster_mode: "false"
```
Now you should be able to connect to `redpanda` (kafka-api) running at `localhost:19092`

Now you should be able to connect to `redpanda` (kafka-api) running at `localhost:9092`

Cluster Mode:
```yaml
- name: start redpanda
uses: redpanda-data/[email protected]
with:
version: "latest"
cluster_mode: "true"
```
Now you should be able to connect to `redpanda` (kafka-api) running at `localhost:19092,localhost:29092,localhost:39092`

----------

Expand Down Expand Up @@ -133,10 +142,10 @@ sudo yum install redpanda

## Beta releases on Docker

This is an example with the `v21.3.5-beta3` version prior to the 21.3.5 release.
This is an example with the `v24.2.14` version prior to the `24.2.11` release.

```
# example!
docker.vectorized.io/vectorized/redpanda:v21.3.5-beta3
redpandadata/redpanda:v24.2.12
```

36 changes: 32 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "redpanda-action"
description: "Setup Redpanda"
author: "fernandes"
description: "Setup Redpanda Single or Cluster Mode"
author: "Debabrata Patnaik/Celso Fernandes/Alexander Gallego"
branding:
icon: fast-forward
color: red
Expand All @@ -9,6 +9,34 @@ inputs:
description: "Version of Redpanda to use"
required: false
default: "latest"
cluster_mode:
description: "Whether to run Redpanda in three node cluster mode"
required: false
default: "false"
runs:
using: "docker"
image: "Dockerfile"
using: composite
steps:
- name: Cluster Input Details
shell: bash
run: |
echo "Starting redpanda broker/cluster with version: redpandadata/redpanda:${{ inputs.version }}"
echo "Cluster Mode: ${{ inputs.cluster_mode }}"
- name: Start Redpanda Single Node Broker
if: inputs.cluster_mode != 'true'
run: REDPANDA_IMAGE_TAG="${{ inputs.version }}" docker compose -f ${{ github.action_path }}/docker-compose-single.yml up -d
shell: bash
- name: Start Redpanda Three Node Cluster
shell: bash
if: inputs.cluster_mode == 'true'
run: REDPANDA_IMAGE_TAG="${{ inputs.version }}" docker compose -f ${{ github.action_path }}/docker-compose-three-node-cluster.yml up -d
- name: Print Redpanda cluster details
shell: bash
if: success()
run: |
echo "Redpanda configured"
echo "Container Details"
docker container ls | grep redpanda
echo "Network Details"
docker network ls | grep redpanda
echo "Volume Details"
docker volume ls | grep redpanda
41 changes: 41 additions & 0 deletions docker-compose-single.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: redpanda-quickstart-one-broker
networks:
redpanda_network:
driver: bridge
volumes:
redpanda-0: null
services:
redpanda-0:
command:
- redpanda
- start
- --kafka-addr internal://0.0.0.0:9092,external://0.0.0.0:19092
# Address the broker advertises to clients that connect to the Kafka API.
# Use the internal addresses to connect to the Redpanda brokers'
# from inside the same Docker network.
# Use the external addresses to connect to the Redpanda brokers'
# from outside the Docker network.
- --advertise-kafka-addr internal://redpanda-0:9092,external://localhost:19092
- --pandaproxy-addr internal://0.0.0.0:8082,external://0.0.0.0:18082
# Address the broker advertises to clients that connect to the HTTP Proxy.
- --advertise-pandaproxy-addr internal://redpanda-0:8082,external://localhost:18082
- --schema-registry-addr internal://0.0.0.0:8081,external://0.0.0.0:18081
# Redpanda brokers use the RPC API to communicate with each other internally.
- --rpc-addr redpanda-0:33145
- --advertise-rpc-addr redpanda-0:33145
# Mode dev-container uses well-known configuration properties for development in containers.
- --mode dev-container
# Tells Seastar (the framework Redpanda uses under the hood) to use 1 core on the system.
- --smp 1
- --default-log-level=info
image: docker.redpanda.com/redpandadata/redpanda:${REDPANDA_IMAGE_TAG}
container_name: redpanda-0
volumes:
- redpanda-0:/var/lib/redpanda/data
networks:
- redpanda_network
ports:
- 18081:18081
- 18082:18082
- 19092:19092
- 19644:9644
98 changes: 98 additions & 0 deletions docker-compose-three-node-cluster.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
networks:
redpanda_network:
driver: bridge
volumes:
redpanda-0: null
redpanda-1: null
redpanda-2: null
services:
redpanda-0:
command:
- redpanda
- start
- --kafka-addr internal://0.0.0.0:9092,external://0.0.0.0:19092
# Address the broker advertises to clients that connect to the Kafka API.
# Use the internal addresses to connect to the Redpanda brokers'
# from inside the same Docker network.
# Use the external addresses to connect to the Redpanda brokers'
# from outside the Docker network.
- --advertise-kafka-addr internal://redpanda-0:9092,external://localhost:19092
- --pandaproxy-addr internal://0.0.0.0:8082,external://0.0.0.0:18082
# Address the broker advertises to clients that connect to the HTTP Proxy.
- --advertise-pandaproxy-addr internal://redpanda-0:8082,external://localhost:18082
- --schema-registry-addr internal://0.0.0.0:8081,external://0.0.0.0:18081
# Redpanda brokers use the RPC API to communicate with each other internally.
- --rpc-addr redpanda-0:33145
- --advertise-rpc-addr redpanda-0:33145
# Mode dev-container uses well-known configuration properties for development in containers.
- --mode dev-container
# Tells Seastar (the framework Redpanda uses under the hood) to use 1 core on the system.
- --smp 1
- --default-log-level=info
image: docker.redpanda.com/redpandadata/redpanda:${REDPANDA_IMAGE_TAG}
container_name: redpanda-0
volumes:
- redpanda-0:/var/lib/redpanda/data
networks:
- redpanda_network
ports:
- 18081:18081
- 18082:18082
- 19092:19092
- 19644:9644
redpanda-1:
command:
- redpanda
- start
- --kafka-addr internal://0.0.0.0:9092,external://0.0.0.0:29092
- --advertise-kafka-addr internal://redpanda-1:9092,external://localhost:29092
- --pandaproxy-addr internal://0.0.0.0:8082,external://0.0.0.0:28082
- --advertise-pandaproxy-addr internal://redpanda-1:8082,external://localhost:28082
- --schema-registry-addr internal://0.0.0.0:8081,external://0.0.0.0:28081
- --rpc-addr redpanda-1:33145
- --advertise-rpc-addr redpanda-1:33145
- --mode dev-container
- --smp 1
- --default-log-level=info
- --seeds redpanda-0:33145
image: docker.redpanda.com/redpandadata/redpanda:${REDPANDA_IMAGE_TAG}
container_name: redpanda-1
volumes:
- redpanda-1:/var/lib/redpanda/data
networks:
- redpanda_network
ports:
- 28081:28081
- 28082:28082
- 29092:29092
- 29644:9644
depends_on:
- redpanda-0
redpanda-2:
command:
- redpanda
- start
- --kafka-addr internal://0.0.0.0:9092,external://0.0.0.0:39092
- --advertise-kafka-addr internal://redpanda-2:9092,external://localhost:39092
- --pandaproxy-addr internal://0.0.0.0:8082,external://0.0.0.0:38082
- --advertise-pandaproxy-addr internal://redpanda-2:8082,external://localhost:38082
- --schema-registry-addr internal://0.0.0.0:8081,external://0.0.0.0:38081
- --rpc-addr redpanda-2:33145
- --advertise-rpc-addr redpanda-2:33145
- --mode dev-container
- --smp 1
- --default-log-level=info
- --seeds redpanda-0:33145
image: docker.redpanda.com/redpandadata/redpanda:${REDPANDA_IMAGE_TAG}
container_name: redpanda-2
volumes:
- redpanda-2:/var/lib/redpanda/data
networks:
- redpanda_network
ports:
- 38081:38081
- 38082:38082
- 39092:39092
- 39644:9644
depends_on:
- redpanda-0
6 changes: 0 additions & 6 deletions entrypoint.sh

This file was deleted.