@redpanda-data/docs-extensions-and-macros 4.3.0 → 4.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/doc-tools.js +376 -0
- package/cli-utils/add-caret-external-links.py +68 -0
- package/cli-utils/beta-from-antora.js +27 -0
- package/cli-utils/generate-cluster-docs.sh +83 -0
- package/cli-utils/install-test-dependencies.sh +158 -0
- package/cli-utils/python-venv.sh +20 -0
- package/cli-utils/start-cluster.sh +53 -0
- package/docker-compose/bootstrap.yml +67 -0
- package/docker-compose/docker-compose.yml +414 -0
- package/docker-compose/generate-profiles.yaml +77 -0
- package/docker-compose/rpk-profile.yaml +24 -0
- package/docker-compose/transactions-schema.json +37 -0
- package/docker-compose/transactions.md +46 -0
- package/docker-compose/transform/README.adoc +73 -0
- package/docker-compose/transform/go.mod +5 -0
- package/docker-compose/transform/go.sum +2 -0
- package/docker-compose/transform/regex.wasm +0 -0
- package/docker-compose/transform/transform.go +122 -0
- package/docker-compose/transform/transform.yaml +33 -0
- package/extensions/replace-attributes-in-attachments.js +1 -1
- package/extensions/util/compute-out.js +38 -0
- package/extensions/util/create-asciidoc-file.js +15 -0
- package/macros/data-template.js +2 -2
- package/package.json +15 -3
- package/tools/docusaurus-to-antora-conversion-scripts/convert-docs.sh +114 -0
- package/tools/docusaurus-to-antora-conversion-scripts/get-file-changes.sh +9 -0
- package/tools/docusaurus-to-antora-conversion-scripts/post-process-asciidoc.js +63 -0
- package/tools/docusaurus-to-antora-conversion-scripts/pre-process-markdown.js +108 -0
- package/tools/fetch-from-github.js +63 -0
- package/tools/gen-rpk-ascii.py +477 -0
- package/tools/get-console-version.js +53 -0
- package/tools/get-redpanda-version.js +53 -0
- package/tools/metrics/metrics.py +199 -0
- package/tools/metrics/requirements.txt +1 -0
- package/tools/property-extractor/Makefile +99 -0
- package/tools/property-extractor/README.adoc +206 -0
- package/tools/property-extractor/definitions.json +245 -0
- package/tools/property-extractor/file_pair.py +7 -0
- package/tools/property-extractor/json-to-asciidoc/generate_docs.py +460 -0
- package/tools/property-extractor/parser.py +224 -0
- package/tools/property-extractor/property_bag.py +4 -0
- package/tools/property-extractor/property_extractor.py +243 -0
- package/tools/property-extractor/requirements.txt +2 -0
- package/tools/property-extractor/tests/transformers_test.py +376 -0
- package/tools/property-extractor/transformers.py +397 -0
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
name: redpanda-cluster
|
|
2
|
+
networks:
|
|
3
|
+
redpanda_network:
|
|
4
|
+
driver: bridge
|
|
5
|
+
volumes:
|
|
6
|
+
redpanda-0: null
|
|
7
|
+
redpanda-1: null
|
|
8
|
+
redpanda-2: null
|
|
9
|
+
minio: null
|
|
10
|
+
services:
|
|
11
|
+
##################
|
|
12
|
+
# Redpanda Brokers #
|
|
13
|
+
##################
|
|
14
|
+
redpanda-0:
|
|
15
|
+
command:
|
|
16
|
+
- redpanda
|
|
17
|
+
- start
|
|
18
|
+
- --kafka-addr internal://0.0.0.0:9092,external://0.0.0.0:19092
|
|
19
|
+
# Address the broker advertises to clients that connect to the Kafka API.
|
|
20
|
+
# Use the internal addresses to connect to the Redpanda brokers
|
|
21
|
+
# from inside the same Docker network.
|
|
22
|
+
# Use the external addresses to connect to the Redpanda brokers
|
|
23
|
+
# from outside the Docker network.
|
|
24
|
+
- --advertise-kafka-addr internal://redpanda-0:9092,external://localhost:19092
|
|
25
|
+
- --pandaproxy-addr internal://0.0.0.0:8082,external://0.0.0.0:18082
|
|
26
|
+
# Address the broker advertises to clients that connect to the HTTP Proxy.
|
|
27
|
+
- --advertise-pandaproxy-addr internal://redpanda-0:8082,external://localhost:18082
|
|
28
|
+
- --schema-registry-addr internal://0.0.0.0:8081,external://0.0.0.0:18081
|
|
29
|
+
# Redpanda brokers use the RPC API to communicate with each other internally.
|
|
30
|
+
- --rpc-addr redpanda-0:33145
|
|
31
|
+
- --advertise-rpc-addr redpanda-0:33145
|
|
32
|
+
# Mode dev-container uses well-known configuration properties for development in containers.
|
|
33
|
+
- --mode dev-container
|
|
34
|
+
# Tells Seastar (the framework Redpanda uses under the hood) to use 1 core on the system.
|
|
35
|
+
- --smp 1
|
|
36
|
+
- --default-log-level=info
|
|
37
|
+
image: docker.redpanda.com/redpandadata/${REDPANDA_DOCKER_REPO:-redpanda}:${REDPANDA_VERSION:-latest}
|
|
38
|
+
container_name: redpanda-0
|
|
39
|
+
# Sets the username and password of the bootstrap SCRAM superuser
|
|
40
|
+
# See https://docs.redpanda.com/current/deploy/deployment-option/self-hosted/manual/production/production-deployment/#bootstrap-a-user-account
|
|
41
|
+
environment:
|
|
42
|
+
RP_BOOTSTRAP_USER: "superuser:secretpassword"
|
|
43
|
+
volumes:
|
|
44
|
+
- redpanda-0:/var/lib/redpanda/data
|
|
45
|
+
- ./bootstrap.yml:/etc/redpanda/.bootstrap.yaml
|
|
46
|
+
networks:
|
|
47
|
+
- redpanda_network
|
|
48
|
+
ports:
|
|
49
|
+
- 18081:18081
|
|
50
|
+
- 18082:18082
|
|
51
|
+
- 19092:19092
|
|
52
|
+
- 19644:9644
|
|
53
|
+
healthcheck:
|
|
54
|
+
test: ["CMD", "rpk", "cluster", "info", "-X", "user=superuser", "-X", "pass=secretpassword"]
|
|
55
|
+
interval: 10s
|
|
56
|
+
timeout: 15s
|
|
57
|
+
retries: 10
|
|
58
|
+
depends_on:
|
|
59
|
+
minio:
|
|
60
|
+
condition: service_healthy
|
|
61
|
+
redpanda-1:
|
|
62
|
+
command:
|
|
63
|
+
- redpanda
|
|
64
|
+
- start
|
|
65
|
+
- --kafka-addr internal://0.0.0.0:9092,external://0.0.0.0:29092
|
|
66
|
+
- --advertise-kafka-addr internal://redpanda-1:9092,external://localhost:29092
|
|
67
|
+
- --pandaproxy-addr internal://0.0.0.0:8082,external://0.0.0.0:28082
|
|
68
|
+
- --advertise-pandaproxy-addr internal://redpanda-1:8082,external://localhost:28082
|
|
69
|
+
- --schema-registry-addr internal://0.0.0.0:8081,external://0.0.0.0:28081
|
|
70
|
+
- --rpc-addr redpanda-1:33145
|
|
71
|
+
- --advertise-rpc-addr redpanda-1:33145
|
|
72
|
+
- --mode dev-container
|
|
73
|
+
- --smp 1
|
|
74
|
+
- --default-log-level=info
|
|
75
|
+
- --seeds redpanda-0:33145
|
|
76
|
+
image: docker.redpanda.com/redpandadata/${REDPANDA_DOCKER_REPO:-redpanda}:${REDPANDA_VERSION:-latest}
|
|
77
|
+
container_name: redpanda-1
|
|
78
|
+
environment:
|
|
79
|
+
RP_BOOTSTRAP_USER: "superuser:secretpassword"
|
|
80
|
+
volumes:
|
|
81
|
+
- redpanda-1:/var/lib/redpanda/data
|
|
82
|
+
- ./bootstrap.yml:/etc/redpanda/.bootstrap.yaml
|
|
83
|
+
networks:
|
|
84
|
+
- redpanda_network
|
|
85
|
+
ports:
|
|
86
|
+
- 28081:28081
|
|
87
|
+
- 28082:28082
|
|
88
|
+
- 29092:29092
|
|
89
|
+
- 29644:9644
|
|
90
|
+
depends_on:
|
|
91
|
+
- redpanda-0
|
|
92
|
+
- minio
|
|
93
|
+
redpanda-2:
|
|
94
|
+
command:
|
|
95
|
+
- redpanda
|
|
96
|
+
- start
|
|
97
|
+
- --kafka-addr internal://0.0.0.0:9092,external://0.0.0.0:39092
|
|
98
|
+
- --advertise-kafka-addr internal://redpanda-2:9092,external://localhost:39092
|
|
99
|
+
- --pandaproxy-addr internal://0.0.0.0:8082,external://0.0.0.0:38082
|
|
100
|
+
- --advertise-pandaproxy-addr internal://redpanda-2:8082,external://localhost:38082
|
|
101
|
+
- --schema-registry-addr internal://0.0.0.0:8081,external://0.0.0.0:38081
|
|
102
|
+
- --rpc-addr redpanda-2:33145
|
|
103
|
+
- --advertise-rpc-addr redpanda-2:33145
|
|
104
|
+
- --mode dev-container
|
|
105
|
+
- --smp 1
|
|
106
|
+
- --default-log-level=info
|
|
107
|
+
- --seeds redpanda-0:33145
|
|
108
|
+
image: docker.redpanda.com/redpandadata/${REDPANDA_DOCKER_REPO:-redpanda}:${REDPANDA_VERSION:-latest}
|
|
109
|
+
container_name: redpanda-2
|
|
110
|
+
environment:
|
|
111
|
+
RP_BOOTSTRAP_USER: "superuser:secretpassword"
|
|
112
|
+
volumes:
|
|
113
|
+
- redpanda-2:/var/lib/redpanda/data
|
|
114
|
+
- ./bootstrap.yml:/etc/redpanda/.bootstrap.yaml
|
|
115
|
+
networks:
|
|
116
|
+
- redpanda_network
|
|
117
|
+
ports:
|
|
118
|
+
- 38081:38081
|
|
119
|
+
- 38082:38082
|
|
120
|
+
- 39092:39092
|
|
121
|
+
- 39644:9644
|
|
122
|
+
depends_on:
|
|
123
|
+
- redpanda-0
|
|
124
|
+
- minio
|
|
125
|
+
####################
|
|
126
|
+
# Redpanda Console #
|
|
127
|
+
####################
|
|
128
|
+
console:
|
|
129
|
+
container_name: redpanda-console
|
|
130
|
+
image: docker.redpanda.com/redpandadata/${CONSOLE_DOCKER_REPO:-console}:${REDPANDA_CONSOLE_VERSION:-latest}
|
|
131
|
+
networks:
|
|
132
|
+
- redpanda_network
|
|
133
|
+
entrypoint: /bin/sh
|
|
134
|
+
command: -c 'echo "$$CONSOLE_CONFIG_FILE" > /tmp/config.yml && /app/console'
|
|
135
|
+
volumes:
|
|
136
|
+
- ./config:/tmp/config/
|
|
137
|
+
environment:
|
|
138
|
+
CONFIG_FILEPATH: ${CONFIG_FILEPATH:-/tmp/config.yml}
|
|
139
|
+
CONSOLE_CONFIG_FILE: |
|
|
140
|
+
# Configure a connection to the Redpanda cluster
|
|
141
|
+
# See https://docs.redpanda.com/current/console/config/connect-to-redpanda/
|
|
142
|
+
kafka:
|
|
143
|
+
brokers: ["redpanda-0:9092"]
|
|
144
|
+
sasl:
|
|
145
|
+
enabled: true
|
|
146
|
+
impersonateUser: true
|
|
147
|
+
schemaRegistry:
|
|
148
|
+
enabled: true
|
|
149
|
+
urls: ["http://redpanda-0:8081","http://redpanda-1:8081","http://redpanda-2:8081"]
|
|
150
|
+
authentication:
|
|
151
|
+
impersonateUser: true
|
|
152
|
+
redpanda:
|
|
153
|
+
adminApi:
|
|
154
|
+
enabled: true
|
|
155
|
+
urls: ["http://redpanda-0:9644","http://redpanda-1:9644","http://redpanda-2:9644"]
|
|
156
|
+
authentication:
|
|
157
|
+
basic:
|
|
158
|
+
username: superuser
|
|
159
|
+
password: secretpassword
|
|
160
|
+
impersonateUser: false
|
|
161
|
+
console:
|
|
162
|
+
# Configures Redpanda Console to fetch topic documentation from GitHub and display it in the UI.
|
|
163
|
+
# See https://docs.redpanda.com/current/console/config/topic-documentation/
|
|
164
|
+
topicDocumentation:
|
|
165
|
+
enabled: true
|
|
166
|
+
git:
|
|
167
|
+
enabled: true
|
|
168
|
+
repository:
|
|
169
|
+
url: https://github.com/redpanda-data/docs
|
|
170
|
+
branch: main
|
|
171
|
+
baseDirectory: tests/docker-compose
|
|
172
|
+
authentication:
|
|
173
|
+
jwtSigningKey: vazxnT+ZHtxKslK6QlDGovcYnSjTk/lKMmZ+mHrBVE+YdVDkLgSuP6AszAKe9Gvq
|
|
174
|
+
basic:
|
|
175
|
+
enabled: true
|
|
176
|
+
authorization:
|
|
177
|
+
roleBindings:
|
|
178
|
+
- roleName: admin
|
|
179
|
+
users:
|
|
180
|
+
- loginType: basic
|
|
181
|
+
name: superuser
|
|
182
|
+
ports:
|
|
183
|
+
- 8080:8080
|
|
184
|
+
depends_on:
|
|
185
|
+
redpanda-0:
|
|
186
|
+
condition: service_healthy
|
|
187
|
+
####################
|
|
188
|
+
# Redpanda Connect #
|
|
189
|
+
####################
|
|
190
|
+
connect:
|
|
191
|
+
container_name: redpanda-connect
|
|
192
|
+
image: docker.redpanda.com/redpandadata/connect
|
|
193
|
+
networks:
|
|
194
|
+
- redpanda_network
|
|
195
|
+
entrypoint: /bin/sh
|
|
196
|
+
depends_on:
|
|
197
|
+
redpanda-0:
|
|
198
|
+
condition: service_healthy
|
|
199
|
+
command: -c 'echo "$$CONNECT_CFG_FILE" > /tmp/connect.yml; /redpanda-connect -c /tmp/connect.yml'
|
|
200
|
+
environment:
|
|
201
|
+
# This Redpanda Connect configuration creates fake data,
|
|
202
|
+
# processes it, and writes the output to a set of topics.
|
|
203
|
+
#
|
|
204
|
+
# Input:
|
|
205
|
+
# - Uses Redpanda Connect's generate input to generate fake data.
|
|
206
|
+
# See https://docs.redpanda.com/redpanda-connect/components/inputs/generate/
|
|
207
|
+
# Pipeline:
|
|
208
|
+
# - Bloblang mapping to batch each input and map 1 message to 'logins'
|
|
209
|
+
# topic, and a random number (1-3) of messages to 'transaction' topic
|
|
210
|
+
# - Unarchive processor to parse the JSON array and extract each
|
|
211
|
+
# element into its own message.
|
|
212
|
+
# See https://docs.redpanda.com/redpanda-connect/guides/bloblang/about/
|
|
213
|
+
# Output:
|
|
214
|
+
# - kafka_franz output to write the messages to the Redpanda brokers.
|
|
215
|
+
# See https://docs.redpanda.com/redpanda-connect/components/outputs/kafka_franz/
|
|
216
|
+
CONNECT_CFG_FILE: |
|
|
217
|
+
input:
|
|
218
|
+
generate:
|
|
219
|
+
interval: 1s
|
|
220
|
+
mapping: |
|
|
221
|
+
let first_name = fake("first_name")
|
|
222
|
+
let last_name = fake("last_name")
|
|
223
|
+
|
|
224
|
+
root.user_id = counter()
|
|
225
|
+
root.name = $$first_name + " " + $$last_name
|
|
226
|
+
root.email = ($$first_name.slice(0,1) + $$last_name + "@" + fake("domain_name")).lowercase()
|
|
227
|
+
root.ip = fake("ipv4")
|
|
228
|
+
root.login_time = now()
|
|
229
|
+
pipeline:
|
|
230
|
+
processors:
|
|
231
|
+
- mapping: |
|
|
232
|
+
root = range(0, random_int(min:2, max:4)).map_each(cust -> this)
|
|
233
|
+
- unarchive:
|
|
234
|
+
format: "json_array"
|
|
235
|
+
- mapping: |
|
|
236
|
+
if batch_index() == 0 {
|
|
237
|
+
meta topic = "logins"
|
|
238
|
+
root = this
|
|
239
|
+
} else {
|
|
240
|
+
meta topic = "transactions"
|
|
241
|
+
root.user_id = this.user_id
|
|
242
|
+
root.email = this.email
|
|
243
|
+
root.index = batch_index() - 1
|
|
244
|
+
root.product_url = fake("url")
|
|
245
|
+
root.price = fake("amount_with_currency")
|
|
246
|
+
root.timestamp = now()
|
|
247
|
+
}
|
|
248
|
+
output:
|
|
249
|
+
kafka_franz:
|
|
250
|
+
seed_brokers: [ "redpanda-0:9092" ]
|
|
251
|
+
topic: $${! metadata("topic") }
|
|
252
|
+
sasl:
|
|
253
|
+
- mechanism: SCRAM-SHA-256
|
|
254
|
+
password: secretpassword
|
|
255
|
+
username: superuser
|
|
256
|
+
####################
|
|
257
|
+
# rpk container to create the edu-filtered-domains topic #
|
|
258
|
+
# See https://docs.redpanda.com/current/reference/rpk/rpk-topic/rpk-topic-create/
|
|
259
|
+
####################
|
|
260
|
+
createtopic:
|
|
261
|
+
command:
|
|
262
|
+
- topic
|
|
263
|
+
- create
|
|
264
|
+
- edu-filtered-domains
|
|
265
|
+
- -X user=superuser
|
|
266
|
+
- -X pass=secretpassword
|
|
267
|
+
- -X brokers=redpanda-0:9092
|
|
268
|
+
- --topic-config
|
|
269
|
+
- redpanda.iceberg.mode=key_value
|
|
270
|
+
image: docker.redpanda.com/redpandadata/${REDPANDA_DOCKER_REPO:-redpanda}:${REDPANDA_VERSION:-latest}
|
|
271
|
+
networks:
|
|
272
|
+
- redpanda_network
|
|
273
|
+
depends_on:
|
|
274
|
+
redpanda-0:
|
|
275
|
+
condition: service_healthy
|
|
276
|
+
####################
|
|
277
|
+
# rpk container to register the schema #
|
|
278
|
+
# See https://docs.redpanda.com/current/manage/schema-reg/schema-reg-api/
|
|
279
|
+
####################
|
|
280
|
+
registerschema:
|
|
281
|
+
command:
|
|
282
|
+
- registry
|
|
283
|
+
- schema
|
|
284
|
+
- create
|
|
285
|
+
- transactions
|
|
286
|
+
- --schema
|
|
287
|
+
- /etc/redpanda/transactions-schema.json
|
|
288
|
+
- -X user=superuser
|
|
289
|
+
- -X pass=secretpassword
|
|
290
|
+
- -X registry.hosts=redpanda-0:8081
|
|
291
|
+
image: docker.redpanda.com/redpandadata/${REDPANDA_DOCKER_REPO:-redpanda}:${REDPANDA_VERSION:-latest}
|
|
292
|
+
# Mount the local directory that contains your schema to the container.
|
|
293
|
+
volumes:
|
|
294
|
+
- ./transactions-schema.json:/etc/redpanda/transactions-schema.json
|
|
295
|
+
networks:
|
|
296
|
+
- redpanda_network
|
|
297
|
+
depends_on:
|
|
298
|
+
redpanda-0:
|
|
299
|
+
condition: service_healthy
|
|
300
|
+
####################
|
|
301
|
+
# rpk container to deploy a consumer group #
|
|
302
|
+
# See https://docs.redpanda.com/current/reference/rpk/rpk-topic/rpk-topic-consume/
|
|
303
|
+
####################
|
|
304
|
+
consumergroup:
|
|
305
|
+
command:
|
|
306
|
+
- topic
|
|
307
|
+
- consume
|
|
308
|
+
- transactions
|
|
309
|
+
- --group
|
|
310
|
+
- transactions-consumer
|
|
311
|
+
- -X user=superuser
|
|
312
|
+
- -X pass=secretpassword
|
|
313
|
+
- -X brokers=redpanda-0:9092
|
|
314
|
+
image: docker.redpanda.com/redpandadata/${REDPANDA_DOCKER_REPO:-redpanda}:${REDPANDA_VERSION:-latest}
|
|
315
|
+
networks:
|
|
316
|
+
- redpanda_network
|
|
317
|
+
depends_on:
|
|
318
|
+
- deploytransform
|
|
319
|
+
####################
|
|
320
|
+
# rpk container to deploy the pre-built data transform #
|
|
321
|
+
# See https://docs.redpanda.com/current/develop/data-transforms/deploy/
|
|
322
|
+
####################
|
|
323
|
+
deploytransform:
|
|
324
|
+
command:
|
|
325
|
+
- transform
|
|
326
|
+
- deploy
|
|
327
|
+
- --file=/etc/redpanda/regex.wasm
|
|
328
|
+
- --name=regex
|
|
329
|
+
- --input-topic=logins
|
|
330
|
+
- --output-topic=edu-filtered-domains
|
|
331
|
+
- --var=PATTERN="[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.edu"
|
|
332
|
+
- --var=MATCH_VALUE=true
|
|
333
|
+
- -X user=superuser
|
|
334
|
+
- -X pass=secretpassword
|
|
335
|
+
- -X admin.hosts=redpanda-0:9644
|
|
336
|
+
image: docker.redpanda.com/redpandadata/${REDPANDA_DOCKER_REPO:-redpanda}:${REDPANDA_VERSION:-latest}
|
|
337
|
+
volumes:
|
|
338
|
+
- ./transform/regex.wasm:/etc/redpanda/regex.wasm
|
|
339
|
+
networks:
|
|
340
|
+
- redpanda_network
|
|
341
|
+
depends_on:
|
|
342
|
+
redpanda-0:
|
|
343
|
+
condition: service_healthy
|
|
344
|
+
createtopic:
|
|
345
|
+
condition: service_started
|
|
346
|
+
####################
|
|
347
|
+
# MinIO for Tiered Storage #
|
|
348
|
+
# See https://min.io/
|
|
349
|
+
#
|
|
350
|
+
# NOTE: MinIO is included in this quickstart for development and evaluation purposes only.
|
|
351
|
+
# It is not supported for production deployments of Redpanda.
|
|
352
|
+
#
|
|
353
|
+
# For production environments, use one of the supported object storage providers:
|
|
354
|
+
# https://docs.redpanda.com/current/deploy/deployment-option/self-hosted/manual/production/requirements/#object-storage-providers-for-tiered-storage
|
|
355
|
+
####################
|
|
356
|
+
minio:
|
|
357
|
+
container_name: minio
|
|
358
|
+
image: minio/minio
|
|
359
|
+
command: server --console-address ":9001" /data
|
|
360
|
+
ports:
|
|
361
|
+
- 9000:9000
|
|
362
|
+
- 9001:9001
|
|
363
|
+
environment:
|
|
364
|
+
MINIO_ROOT_USER: minio
|
|
365
|
+
MINIO_ROOT_PASSWORD: redpandaTieredStorage7
|
|
366
|
+
MINIO_SERVER_URL: "http://minio:9000"
|
|
367
|
+
MINIO_REGION_NAME: local
|
|
368
|
+
MINIO_DOMAIN: minio
|
|
369
|
+
volumes:
|
|
370
|
+
- minio:/data
|
|
371
|
+
networks:
|
|
372
|
+
redpanda_network:
|
|
373
|
+
aliases:
|
|
374
|
+
- redpanda.minio
|
|
375
|
+
healthcheck:
|
|
376
|
+
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/ready"]
|
|
377
|
+
interval: 10s
|
|
378
|
+
timeout: 5s
|
|
379
|
+
retries: 3
|
|
380
|
+
mc:
|
|
381
|
+
depends_on:
|
|
382
|
+
minio:
|
|
383
|
+
condition: service_healthy
|
|
384
|
+
image: minio/mc
|
|
385
|
+
container_name: mc
|
|
386
|
+
networks:
|
|
387
|
+
- redpanda_network
|
|
388
|
+
environment:
|
|
389
|
+
- AWS_ACCESS_KEY_ID=minio
|
|
390
|
+
- AWS_SECRET_ACCESS_KEY=redpandaTieredStorage7
|
|
391
|
+
- AWS_REGION=local
|
|
392
|
+
entrypoint: >
|
|
393
|
+
/bin/sh -c "
|
|
394
|
+
until (/usr/bin/mc config host add minio http://minio:9000 minio redpandaTieredStorage7) do echo '...waiting...' && sleep 1; done;
|
|
395
|
+
/usr/bin/mc mb minio/redpanda;
|
|
396
|
+
/usr/bin/mc policy set public minio/redpanda;
|
|
397
|
+
tail -f /dev/null
|
|
398
|
+
"
|
|
399
|
+
catalog:
|
|
400
|
+
image: tabulario/iceberg-rest
|
|
401
|
+
container_name: iceberg-rest
|
|
402
|
+
networks:
|
|
403
|
+
- redpanda_network
|
|
404
|
+
depends_on:
|
|
405
|
+
- minio
|
|
406
|
+
ports:
|
|
407
|
+
- 8181:8181
|
|
408
|
+
environment:
|
|
409
|
+
- AWS_ACCESS_KEY_ID=minio
|
|
410
|
+
- AWS_SECRET_ACCESS_KEY=redpandaTieredStorage7
|
|
411
|
+
- AWS_REGION=local
|
|
412
|
+
- CATALOG_WAREHOUSE=s3://redpanda/
|
|
413
|
+
- CATALOG_IO__IMPL=org.apache.iceberg.aws.s3.S3FileIO
|
|
414
|
+
- CATALOG_S3_ENDPOINT=http://minio:9000
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
input:
|
|
2
|
+
# Use the 'generate' input
|
|
3
|
+
# https://docs.redpanda.com/redpanda-connect/components/inputs/generate/
|
|
4
|
+
generate:
|
|
5
|
+
# The interval at which new records are generated.
|
|
6
|
+
interval: 1s
|
|
7
|
+
# The mapping section defines how each generated record is structured.
|
|
8
|
+
# The language used here is called Bloblang.
|
|
9
|
+
# https://docs.redpanda.com/redpanda-connect/guides/bloblang/about/
|
|
10
|
+
mapping: |
|
|
11
|
+
# Generate a fake first name using the 'first_name' faker function.
|
|
12
|
+
let first_name = fake("first_name")
|
|
13
|
+
|
|
14
|
+
# Generate a fake last name using the 'last_name' faker function.
|
|
15
|
+
let last_name = fake("last_name")
|
|
16
|
+
|
|
17
|
+
# Define possible subscription levels for users.
|
|
18
|
+
let subscription_levels = ["Free", "Basic", "Premium"]
|
|
19
|
+
|
|
20
|
+
# Define possible notification channels for user preferences.
|
|
21
|
+
let notifications = ["email", "sms", "push" ]
|
|
22
|
+
|
|
23
|
+
# Define supported languages for user preferences.
|
|
24
|
+
let languages = ["en", "es", "fr", "de", "zh", "jp"]
|
|
25
|
+
|
|
26
|
+
# Assign a unique user ID using a UUID digit generator.
|
|
27
|
+
root.user_id = fake("uuid_digit")
|
|
28
|
+
|
|
29
|
+
# Assign the generated first name to the 'first_name' field.
|
|
30
|
+
root.first_name = $first_name
|
|
31
|
+
|
|
32
|
+
# Assign the generated last name to the 'last_name' field.
|
|
33
|
+
root.last_name = $last_name
|
|
34
|
+
|
|
35
|
+
# Construct the user's email by combining the first initial, last name, and a fake domain name.
|
|
36
|
+
# The email is converted to lowercase for consistency.
|
|
37
|
+
root.email = ($first_name.slice(0,1) + $last_name + "@" + fake("domain_name")).lowercase()
|
|
38
|
+
|
|
39
|
+
# Assign a fake registration date using the 'date' faker function.
|
|
40
|
+
root.registration_date = fake("date")
|
|
41
|
+
|
|
42
|
+
# Assign the current timestamp as the last login time.
|
|
43
|
+
root.last_login = now()
|
|
44
|
+
|
|
45
|
+
# Randomly assign a subscription level by selecting an index from the 'subscription_levels' array.
|
|
46
|
+
root.subscription_level = $subscription_levels.index(random_int(min: 0, max: 2))
|
|
47
|
+
|
|
48
|
+
# Randomly assign a language preference by selecting an index from the 'languages' array.
|
|
49
|
+
root.preferences.language = $languages.index(random_int(min: 0, max: 5))
|
|
50
|
+
|
|
51
|
+
# Randomly assign a notification preference by selecting an index from the 'notifications' array.
|
|
52
|
+
root.preferences.notifications = $notifications.index(random_int(min: 0, max: 2))
|
|
53
|
+
pipeline:
|
|
54
|
+
processors:
|
|
55
|
+
- mapping: |
|
|
56
|
+
# Set the target topic for the generated records to 'profiles'.
|
|
57
|
+
meta topic = "profiles"
|
|
58
|
+
|
|
59
|
+
# Assign the entire record (root) to be sent to the specified topic.
|
|
60
|
+
root = this
|
|
61
|
+
output:
|
|
62
|
+
# Use the 'kafka_franz' output to send the result back to Redpanda
|
|
63
|
+
# https://docs.redpanda.com/redpanda-connect/components/outputs/kafka_franz/
|
|
64
|
+
kafka_franz:
|
|
65
|
+
# Define the list of seed brokers for the Kafka cluster.
|
|
66
|
+
seed_brokers: [ "localhost:19092", "localhost:29092", "localhost:39092"]
|
|
67
|
+
# Dynamically assign the topic based on the metadata specified in the processors.
|
|
68
|
+
# In this case, it resolves to the 'profiles' topic.
|
|
69
|
+
topic: ${! metadata("topic") }
|
|
70
|
+
# Configure SASL authentication to securely connect to the Kafka brokers.
|
|
71
|
+
sasl:
|
|
72
|
+
- # Specify the SASL mechanism to use for authentication.
|
|
73
|
+
mechanism: SCRAM-SHA-256
|
|
74
|
+
# The password for the SASL authentication.
|
|
75
|
+
password: secretpassword
|
|
76
|
+
# The username for the SASL authentication.
|
|
77
|
+
username: superuser
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# This file configures `rpk` to connect to a remote Redpanda cluster running in the same local network as `rpk`.
|
|
2
|
+
|
|
3
|
+
# Configuration for connecting to the Kafka API of the Redpanda cluster.
|
|
4
|
+
kafka_api:
|
|
5
|
+
# SASL (Simple Authentication and Security Layer) settings for authentication.
|
|
6
|
+
sasl:
|
|
7
|
+
user: superuser # The username used for authentication
|
|
8
|
+
password: secretpassword # The password associated with the username
|
|
9
|
+
mechanism: scram-sha-256 # Authentication mechanism; SCRAM-SHA-256 provides secure password-based authentication
|
|
10
|
+
# List of Kafka brokers in the Redpanda cluster.
|
|
11
|
+
# These brokers ensure high availability and fault tolerance for Kafka-based communication.
|
|
12
|
+
brokers:
|
|
13
|
+
- 127.0.0.1:19092 # Broker 1: Accessible on localhost, port 19092
|
|
14
|
+
- 127.0.0.1:29092 # Broker 2: Accessible on localhost, port 29092
|
|
15
|
+
- 127.0.0.1:39092 # Broker 3: Accessible on localhost, port 39092
|
|
16
|
+
|
|
17
|
+
# Configuration for connecting to the Redpanda Admin API.
|
|
18
|
+
# The Admin API allows you to perform administrative tasks such as managing configurations, monitoring, and scaling.
|
|
19
|
+
admin_api:
|
|
20
|
+
# List of Admin API endpoints for managing the cluster.
|
|
21
|
+
addresses:
|
|
22
|
+
- 127.0.0.1:19644 # Admin API for Broker 1: Accessible on localhost, port 19644
|
|
23
|
+
- 127.0.0.1:29644 # Admin API for Broker 2: Accessible on localhost, port 29644
|
|
24
|
+
- 127.0.0.1:39644 # Admin API for Broker 3: Accessible on localhost, port 39644
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "Transactions",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"email": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"format": "email",
|
|
9
|
+
"description": "The email address of the user involved in the transaction."
|
|
10
|
+
},
|
|
11
|
+
"index": {
|
|
12
|
+
"type": "integer",
|
|
13
|
+
"description": "A numeric index associated with the transaction."
|
|
14
|
+
},
|
|
15
|
+
"price": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"pattern": "^[A-Z]{3} \\d+(?:\\.\\d{2})?$",
|
|
18
|
+
"description": "A string representing the price of the product, including a currency code (ISO 4217) and an amount with two decimal places by default."
|
|
19
|
+
},
|
|
20
|
+
"product_url": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"format": "uri",
|
|
23
|
+
"description": "A URL that points to the product involved in the transaction."
|
|
24
|
+
},
|
|
25
|
+
"timestamp": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"format": "date-time",
|
|
28
|
+
"description": "The timestamp of when the transaction occurred, formatted in ISO 8601."
|
|
29
|
+
},
|
|
30
|
+
"user_id": {
|
|
31
|
+
"type": "integer",
|
|
32
|
+
"description": "A numeric identifier for the user."
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"required": ["email", "index", "price", "product_url", "timestamp", "user_id"],
|
|
36
|
+
"additionalProperties": false
|
|
37
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Transactions Topic Documentation
|
|
2
|
+
|
|
3
|
+
This document provides an overview of the `transactions` topic in the Redpanda cluster. The topic is designed to capture autogenerated transaction events with various attributes.
|
|
4
|
+
|
|
5
|
+
## Schema Overview
|
|
6
|
+
|
|
7
|
+
Each message in the `transactions` topic adheres to the following JSON schema:
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"email": "string",
|
|
12
|
+
"index": "integer",
|
|
13
|
+
"price": "string",
|
|
14
|
+
"product_url": "string",
|
|
15
|
+
"timestamp": "string",
|
|
16
|
+
"user_id": "integer"
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
- **email**: The email address of the user involved in the transaction.
|
|
21
|
+
- **index**: A numeric index associated with the transaction. This could represent the position or order of the transaction in a sequence.
|
|
22
|
+
- **price**: A string representing the price of the product. It includes a currency code (e.g., "XXX") followed by the amount.
|
|
23
|
+
- **product_url**: A URL that points to the product involved in the transaction.
|
|
24
|
+
- **timestamp**: The timestamp of when the transaction occurred, formatted in ISO 8601.
|
|
25
|
+
- **user_id**: A numeric identifier for the user. This is typically a unique ID assigned to each user in the system.
|
|
26
|
+
|
|
27
|
+
## Example message
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"email": "wzieme@ykczius.edu",
|
|
32
|
+
"index": 0,
|
|
33
|
+
"price": "XXX 5651308.100000",
|
|
34
|
+
"product_url": "http://yjomdta.top/DxvGsCn.php",
|
|
35
|
+
"timestamp": "2024-08-16T15:51:19.799474084Z",
|
|
36
|
+
"user_id": 1
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Use cases
|
|
41
|
+
|
|
42
|
+
You can use the `transactions` topic for various purposes, including:
|
|
43
|
+
|
|
44
|
+
- **Analytics**: Tracking and analyzing user transactions to understand buying behavior, popular products, etc.
|
|
45
|
+
- **Monitoring**: Observing transaction patterns to detect anomalies, such as unusual spikes or drops in transaction volume.
|
|
46
|
+
- **Data Processing**: Feeding transaction data into other systems, such as a data warehouse or real-time processing pipelines, for further processing and analysis.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
= Modify the Wasm Transform in the Quickstart
|
|
2
|
+
|
|
3
|
+
This directory contains the Go source code (`transform.go`) for the data transform that is used in the Redpanda Self-Managed quickstart.
|
|
4
|
+
If you're following the quickstart, you *do not* need to modify or rebuild this code. The Docker Compose configuration automatically deploys a pre-built transform called `regex.wasm`.
|
|
5
|
+
|
|
6
|
+
However, if you want to customize the data transform logic, continue reading.
|
|
7
|
+
|
|
8
|
+
== Why customize the transform?
|
|
9
|
+
|
|
10
|
+
- **Custom filtering**: Filter by a different regex or apply multiple conditions.
|
|
11
|
+
- **Data manipulation**: Transform records before writing them out. For example, redacting sensitive data or combining fields.
|
|
12
|
+
- **Extended functionality**: Add advanced logging, error handling, or multi-topic routing.
|
|
13
|
+
|
|
14
|
+
== Prerequisites
|
|
15
|
+
|
|
16
|
+
You need the following:
|
|
17
|
+
|
|
18
|
+
- At least Go 1.20 installed.
|
|
19
|
+
+
|
|
20
|
+
[source,bash]
|
|
21
|
+
----
|
|
22
|
+
go version
|
|
23
|
+
----
|
|
24
|
+
|
|
25
|
+
- The Redpanda CLI (`rpk`) installed.
|
|
26
|
+
|
|
27
|
+
- A running Redpanda cluster. If you're using the local quickstart with Docker Compose, ensure the cluster is up and running. Or, point `rpk` to another Redpanda environment.
|
|
28
|
+
|
|
29
|
+
== Modify and deploy your transform
|
|
30
|
+
|
|
31
|
+
. Open link:transform.go[transform.go] and make your changes. For example:
|
|
32
|
+
+
|
|
33
|
+
--
|
|
34
|
+
- Change the regex logic to handle different use cases.
|
|
35
|
+
- Add environment variables to control new features.
|
|
36
|
+
- Extend the `doRegexFilter()` function to manipulate records.
|
|
37
|
+
--
|
|
38
|
+
|
|
39
|
+
. Compile your Go code into a `.wasm` file:
|
|
40
|
+
+
|
|
41
|
+
[source,bash]
|
|
42
|
+
----
|
|
43
|
+
rpk transform build
|
|
44
|
+
----
|
|
45
|
+
+
|
|
46
|
+
This command compiles your Go source and produces a `.wasm` file that you can deploy to Redpanda.
|
|
47
|
+
|
|
48
|
+
. Deploy the new transform.
|
|
49
|
+
+
|
|
50
|
+
If your Docker Compose setup already has a service to deploy the transform, you can restart that service.
|
|
51
|
+
+
|
|
52
|
+
Otherwise, you can deploy your updated `.wasm` manually using `rpk transform deploy`.
|
|
53
|
+
|
|
54
|
+
. Produce messages into the input topic. For example:
|
|
55
|
+
+
|
|
56
|
+
[source,bash]
|
|
57
|
+
----
|
|
58
|
+
echo '{"key":"alice@university.edu","value":"test message"}' | rpk topic produce logins
|
|
59
|
+
----
|
|
60
|
+
|
|
61
|
+
. Consume from the output topic. For example:
|
|
62
|
+
+
|
|
63
|
+
[source,bash]
|
|
64
|
+
----
|
|
65
|
+
rpk topic consume edu-filtered-domains --num 1
|
|
66
|
+
----
|
|
67
|
+
|
|
68
|
+
== Suggested reading
|
|
69
|
+
|
|
70
|
+
- link:https://docs.redpanda.com/current/reference/rpk/[Redpanda `rpk` CLI Reference^].
|
|
71
|
+
- link:https://docs.redpanda.com/current/develop/data-transforms/build/[Develop Data Transforms^].
|
|
72
|
+
- https://golang.org/ref/mod[Go Modules^] for managing dependencies and builds in Go.
|
|
73
|
+
- https://docs.docker.com/compose/[Docker Compose^] for customizing your environment.
|
|
Binary file
|