Skip to content

Commit

Permalink
--wip-- [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
sago2k8 committed Oct 17, 2024
1 parent b3728d2 commit 0e50979
Show file tree
Hide file tree
Showing 9 changed files with 2,143 additions and 3 deletions.
19 changes: 19 additions & 0 deletions .direnv/bin/nix-direnv-reload
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -e
if [[ ! -d "/Users/santiagojimenez/development/redpanda/console" ]]; then
echo "Cannot find source directory; Did you move it?"
echo "(Looking for "/Users/santiagojimenez/development/redpanda/console")"
echo 'Cannot force reload with this script - use "direnv reload" manually and then try again'
exit 1
fi

# rebuild the cache forcefully
_nix_direnv_force_reload=1 direnv exec "/Users/santiagojimenez/development/redpanda/console" true

# Update the mtime for .envrc.
# This will cause direnv to reload again - but without re-building.
touch "/Users/santiagojimenez/development/redpanda/console/.envrc"

# Also update the timestamp of whatever profile_rc we have.
# This makes sure that we know we are up to date.
touch -r "/Users/santiagojimenez/development/redpanda/console/.envrc" "/Users/santiagojimenez/development/redpanda/console/.direnv"/*.rc
1 change: 1 addition & 0 deletions .direnv/nix-profile-pre674705.b833ff01a0d6
2,027 changes: 2,027 additions & 0 deletions .direnv/nix-profile-pre674705.b833ff01a0d6.rc

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use nix
82 changes: 82 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# run with:
# docker-compose up
version: "3.7"
services:
redpanda:
image: docker.vectorized.io/vectorized/redpanda:latest
command:
- redpanda start
- --smp 1
- --overprovisioned
- --node-id 0
- --kafka-addr internal://redpanda:29092,external://0.0.0.0:9092
- --advertise-kafka-addr internal://redpanda:29092,external://localhost:9092
- --pandaproxy-addr 0.0.0.0:8082
- --advertise-pandaproxy-addr localhost:8082
- --reserve-memory
- 0M
ports:
- 8081:8081
- 8082:8082
- 9092:9092
- 9644:9644

owl-shop:
#image: quay.io/cloudhut/owl-shop:v1.2.0
image: quay.io/cloudhut/owl-shop:latest
environment:
# - SHOP_KAFKA_BROKERS=localhost:9092
- SHOP_KAFKA_BROKERS=redpanda:29092
- SHOP_KAFKA_TOPICREPLICATIONFACTOR=1
- SHOP_TRAFFIC_INTERVAL_RATE=2
- SHOP_TRAFFIC_INTERVAL_DURATION=0.1s
depends_on:
- redpanda

debezium:
image: debezium/connect:2.0
hostname: debezium
depends_on:
- redpanda
ports:
- "8088:8083"
environment:
BOOTSTRAP_SERVERS: "redpanda:29092"
GROUP_ID: dbz-connect-group
REST_ADVERTISED_HOST_NAME: debezium
CONFIG_STORAGE_TOPIC: dbz-connect-configs
OFFSET_STORAGE_TOPIC: dbz-connect-offsets
STATUS_STORAGE_TOPIC: dbz-connect-status

connect:
image: docker.cloudsmith.io/redpanda/connectors-unsupported/connectors:latest
hostname: connect
depends_on:
- redpanda
ports:
- "8083:8083"
environment:
AWS_ACCESS_KEY_ID:
AWS_SECRET_ACCESS_KEY:
CONNECT_CONFIGURATION: |
key.converter=org.apache.kafka.connect.converters.ByteArrayConverter
value.converter=org.apache.kafka.connect.converters.ByteArrayConverter
group.id=connectors-cluster
offset.storage.topic=_internal_connectors_offsets
config.storage.topic=_internal_connectors_configs
status.storage.topic=_internal_connectors_status
config.storage.replication.factor=-1
offset.storage.replication.factor=-1
status.storage.replication.factor=-1
offset.flush.interval.ms=1000
producer.linger.ms=1
producer.batch.size=131072
config.config.providers=file,secretsManager
config.providers.file.class=org.apache.kafka.common.config.provider.FileConfigProvider
config.providers.secretsManager.class=com.redpanda.connectors.config.provider.aws.SecretsManagerConfigProvider
config.providers.secretsManager.param.secret.prefix=redpanda/my-redpanda-id/connectors/redpanda/
config.providers.secretsManager.param.aws.region=eu-west-1
CONNECT_BOOTSTRAP_SERVERS: redpanda:29092
CONNECT_GC_LOG_ENABLED: "false"
CONNECT_HEAP_OPTS: -Xms512M -Xmx512M
CONNECT_LOG_LEVEL: info
1 change: 1 addition & 0 deletions frontend/rsbuild.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export default defineConfig({
config.output.publicPath = 'auto';
config.output.globalObject = 'self';
config.output.filename = '[name].bundle.js';
config.output.crossOriginLoading = 'anonymous';

const plugins = [
new NodePolyfillPlugin({
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { monacoYamlOptions } from './components/misc/PipelinesYamlEditor';
import * as monaco from 'monaco-editor';
import { loader, Monaco } from '@monaco-editor/react';
import { LicenseService } from './protogen/redpanda/api/console/v1alpha1/license_connect';
import './remoteWebWorker';
// import './remoteWebWorker';

declare const __webpack_public_path__: string;

Expand Down
5 changes: 3 additions & 2 deletions frontend/src/remoteWebWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ typeof window !== 'undefined' &&
class Worker extends BaseWorker {
constructor(scriptURL: string | URL, options?: WorkerOptions) {
const url = String(scriptURL);

super(
// Check if the URL is remote
url.includes('://') && !url.startsWith(window.location.origin)
url.includes('://')
? // Launch the worker with an inline script that will use `importScripts`
// to bootstrap the actual script to work around the same origin policy.
URL.createObjectURL(
Expand All @@ -41,7 +42,7 @@ typeof window !== 'undefined' &&
// i = original importScripts
// a = arguments
// u = URL
`importScripts=((i)=>(...a)=>i(...a.map((u)=>''+new URL(u,"${url}"))))(importScripts);importScripts("${url}")`,
`importScripts("${url}")`,
],
{ type: 'text/javascript' }
)
Expand Down
8 changes: 8 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# save this as shell.nix
{pkgs ? import <nixpkgs> {}}:
pkgs.mkShell {
packages = [
pkgs.nodejs_20
pkgs.go_1_22
];
}

0 comments on commit 0e50979

Please sign in to comment.