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

opa-react-demo: add RP connect and djblue/portal for DL viewing #11

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
20 changes: 20 additions & 0 deletions opa-react-demo/connect.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
input:
broker:
inputs:
- http_server:
path: /post/logs
processors:
- decompress:
algorithm: gzip
- unarchive:
format: json_array

buffer:
memory: {}

output:
http_client:
url: http://portal:5678/submit
verb: POST
headers:
"Content-Type": application/json
18 changes: 18 additions & 0 deletions opa-react-demo/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,26 @@ services:
- --server
- --addr=:8181
- --log-level=debug
- --config-file=/eopa.yml
- /policies
volumes:
- ./policies:/policies
- ./eopa.yml:/eopa.yml
environment:
EOPA_LICENSE_KEY: ${EOPA_LICENSE_KEY}

portal:
build: portal
ports:
- "5678:5678"

connect:
image: docker.redpanda.com/redpandadata/redpanda:latest
ports:
- "4195:4195"
command:
- connect
- run
- /connect.yml
volumes:
- ./connect.yml:/connect.yml
8 changes: 8 additions & 0 deletions opa-react-demo/eopa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
services:
- name: connect
url: http://connect:4195/post
decision_logs:
service: connect
reporting:
min_delay_seconds: 0
max_delay_seconds: 1
7 changes: 7 additions & 0 deletions opa-react-demo/portal/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM clojure:tools-deps-bullseye-slim
WORKDIR /app
COPY . .

EXPOSE 5678
# TODO(sr): build at build time, run uberjar here
ENTRYPOINT ["clj", "-X", "start/run"]
1 change: 1 addition & 0 deletions opa-react-demo/portal/deps.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{:deps {djblue/portal {:mvn/version "0.57.0"}}}
6 changes: 6 additions & 0 deletions opa-react-demo/portal/src/start.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(ns start
(:require [portal.api :as p]))

(defn run [_]
(p/start {:port 5678})
@(promise))