Skip to content

Commit

Permalink
Update for OSMC demo and presentation (#5)
Browse files Browse the repository at this point in the history
* Update versions ready for OSMC

Signed-off-by: Patrick Stephens <[email protected]>

* Update readme

Signed-off-by: Patrick Stephens <[email protected]>

* Update readme

Signed-off-by: Patrick Stephens <[email protected]>

* Update URL for osmc.de

Signed-off-by: Patrick Stephens <[email protected]>

* Update to use prebuilt image by default

Signed-off-by: Patrick Stephens <[email protected]>

---------

Signed-off-by: Patrick Stephens <[email protected]>
  • Loading branch information
patrick-stephens authored Nov 12, 2024
1 parent ccab97e commit ad68186
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

# 1st stage, build the app
FROM container-registry.oracle.com/java/openjdk:23 as build
FROM container-registry.oracle.com/java/openjdk:23 AS build

# Install maven
WORKDIR /usr/share
Expand Down
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Introduction

This repository was used as the basis for two talks at [Cloud Native Rejects Paris 2024](https://cfp.cloud-native.rejekts.io/cloud-native-rejekts-eu-paris-2024/talk/LXXPWR/) and [Open Source Monitoring Conference 2024](https://osmc.de/talks/fluent-bit-the-engine-to-power-chat-ops/).

The demo for [Cloud Native Rejects Paris 2024 talk](https://cfp.cloud-native.rejekts.io/cloud-native-rejekts-eu-paris-2024/talk/review/PP8T37LPQUSTTRWBXVCHFJSSKDM9B98J).

The [actual presentation is available in this repo](./docs/Fluent_Bit_for_ChatOps-Cloud_Native_Rejekts_EU_2024.pdf).
Expand Down Expand Up @@ -30,3 +32,39 @@ SYNTH_ALERT_PORT=
```

Once this is done, just run up `docker compose up` to start sending an alert and responding.

Once running, you will see a report of an issue like so and can tell it to fix it up:

![Example chatops slack responses](./docs/slack_example.png)

Specify a command to run using the syntax `FLBNode:<Hostname>:<Port> FLBCmd:<Command>`, this syntax is arbitrary and just an example for usage in the demo.

```shell
FLBNode:node1:8090 FLBCmd:fix_permissions
```

The command will show you it is running (just a dummy here as an example):

```shell
node1-1 | [0] alert: [[1731410091.996160421, {}], {"ERROR"=>"testfile.txt has incorrect permissions"}]
...
http-slack-server-1 | 2024.11.12 11:15:24 INFO com.oracle.flb.chatops.FLBSocialCommandResource VirtualThread[#63,[0x4de53a24 0x79177571] WebServer socket]/runnable@ForkJoinPool-1-worker-4: Actioning:
http-slack-server-1 | {"isOk" : "true", "command":"fix_permissions", "FLBNode"="node1:8090"}
http-slack-server-1 | 2024.11.12 11:15:24 INFO com.oracle.flb.chatops.FLBSocialCommandResource VirtualThread[#63,[0x4de53a24 0x79177571] WebServer socket]/runnable@ForkJoinPool-1-worker-4: Thread : [0x4de53a24 0x79177571] WebServer socket ending <<<<<<<<<<<<<
node1-1 | [2024/11/12 11:15:24] [ info] [output:http:http.1] http-slack-server:8080, HTTP status=200
node1-1 | {postAlertNoId= 11-14-53}
node1-1 | {
node1-1 | command = "fix_permissions",
node1-1 | tagged = "11-14-53",
node1-1 | time = "11-15-24",
node1-1 | <metatable> = {
node1-1 | type = 2
node1-1 | }
node1-1 | }
node1-1 | Will execute fix_permissions
node1-1 | running: /fluent-bit/etc/cmd_fix_permissions.sh > /logs//remoteCommand.lua.out
node1-1 | [0] command: [[1731410124.293250380, {}], {"command"=>"fix_permissions", "time"=>"11-15-24", "tagged"=>"11-14-53"}]
node1-1 | [2024/11/12 11:15:24] [ info] [input:tail:tail.3] inotify_fs_add(): inode=2 watch_fd=1 name=/logs//remoteCommand.lua.out
node1-1 | [0] results: [[1731410124.999926256, {}], {"log"=>"chmod a+w testfile.txt"}]
...
```
11 changes: 7 additions & 4 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
version: '2'

services:
node1:
image: ghcr.io/calyptia/core/calyptia-fluent-bit:24.2.3 # OR fluent/fluent-bit:2.2.2-debug
# Using Chronosphere LTS image
image: ghcr.io/calyptia/core/calyptia-fluent-bit:24.11.1
# OR any image with a shell, e.g.
# image: fluent/fluent-bit:3.1.10-debug
ports:
# HTTP server communication
- ':8090'
Expand All @@ -21,8 +22,10 @@ services:
working_dir: /fluent-bit/etc/

http-slack-server:
# A pre-built image is pushed automatically by the repo
image: ghcr.io/fluent/fluent-bit-chatops-demo
# Otherwise build locally
build:
# image: ghcr.io/fluent/fluent-bit-chatops-demo
context: .
dockerfile: Dockerfile
ports:
Expand Down
Binary file added docs/slack_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ad68186

Please sign in to comment.