Skip to content

Commit 4913d84

Browse files
authored
Merge branch 'main' into feat/context-memory-entity
2 parents 2f7eff4 + 0ab31cb commit 4913d84

60 files changed

Lines changed: 4314 additions & 740 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CLAUDE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,14 @@ These checks run automatically in CI. Code that violates them **will not merge**
491491
- This keeps the codebase modular and prevents generic utilities from becoming cluttered with connector-specific edge cases
492492
- **Use `model_str()` for Pydantic RootModel to string conversion** — OpenMetadata schema types like `ColumnName`, `EntityName`, `FullyQualifiedEntityName`, and `UUID` are Pydantic `RootModel[str]` subclasses where `str()` returns `"root='value'"` instead of the raw value. Always use `model_str()` from `metadata.ingestion.ometa.utils` instead of manual `hasattr(x, "root")` / `str(x.root)` checks.
493493

494+
### Caching
495+
- **All caches MUST be bounded.** Never use a bare `dict` / `HashMap` / `Map` as a cache without an explicit size cap — they grow with the input and cause OOMs on large catalogs/ingestions. The only exception is when the user explicitly asks for an unbounded cache for a specific case.
496+
- Pick a sane default (typically 100–1000 entries depending on entity size); if you're unsure, ask the user.
497+
- **Python**: use `collections.OrderedDict` with `popitem(last=False)` eviction after insert, `@functools.lru_cache(maxsize=N)`, or `cachetools.LRUCache`. Cache both hits and misses (negative caching) — repeated unresolvable lookups are a common hot path.
498+
- **Java**: use Caffeine (`Caffeine.newBuilder().maximumSize(N).build()`) or Guava `CacheBuilder.newBuilder().maximumSize(N).build()`. Never a bare `HashMap`.
499+
- **TypeScript**: use `lru-cache` — never a bare `Map` or plain object.
500+
- **Before adding a cache, check whether the underlying call is already cached at a lower layer.** Example: `OpenMetadata._search_es_entity` is `@lru_cache(maxsize=512)`, so wrapping `get_entity_from_es` / `es_search_container_by_path` calls in a local dict cache is redundant — drop the local cache and rely on the existing LRU.
501+
494502
### Testing Philosophy
495503
- **Test real behavior, not mock wiring** - if a test requires mocking 3+ classes just to verify a method call, it's testing the wrong thing
496504
- **Prefer integration tests** over heavily-mocked unit tests. This project has full integration test infrastructure (OpenMetadataApplicationTest, Docker containers, real OpenSearch). Use it.

docker/development/docker-compose-fuseki.yml

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,41 @@ services:
3434
condition: service_healthy
3535

3636
fuseki:
37-
image: stain/jena-fuseki:5.0.0
37+
# Build from the in-repo Dockerfile (Fuseki 5.6.0) instead of the
38+
# unmaintained `stain/jena-fuseki` Docker Hub image, which capped at 5.1.0
39+
# and never picked up the 2025 admin-side Fuseki CVE fixes (CVE-2025-49656,
40+
# CVE-2025-50151 — both fixed in Jena 5.5.0). The `image:` tag below names
41+
# the locally-built image so subsequent `docker compose up` runs reuse the
42+
# cached build instead of rebuilding from scratch each time.
43+
build:
44+
context: ../rdf-store
45+
dockerfile: Dockerfile
46+
image: openmetadata-fuseki:5.6.0
3847
container_name: openmetadata-fuseki
3948
hostname: fuseki
4049
ports:
4150
- "3030:3030"
4251
networks:
4352
- local_app_net
4453
environment:
45-
- ADMIN_PASSWORD=admin
54+
# Default for local dev only — production deployments MUST override
55+
# via the FUSEKI_ADMIN_PASSWORD env var (and FUSEKI_OPENMETADATA_PASSWORD)
56+
# before bringing this stack up. The entrypoint envsubsts these into
57+
# shiro.ini at container start so the override actually takes effect.
58+
- FUSEKI_ADMIN_PASSWORD=${FUSEKI_ADMIN_PASSWORD:-admin}
59+
- FUSEKI_OPENMETADATA_PASSWORD=${FUSEKI_OPENMETADATA_PASSWORD:-openmetadata-secret}
4660
- JVM_ARGS=${FUSEKI_JVM_ARGS:--Xmx1500m -Xms256m}
47-
- FUSEKI_BASE=/fuseki
4861
volumes:
49-
- fuseki-data:/fuseki
62+
# New volume name (was `fuseki-data` mounted at `/fuseki`). The in-repo
63+
# Dockerfile stores TDB2 at `/fuseki-data` and the data layout differs
64+
# from the old stain/jena-fuseki image — re-using the previous volume
65+
# name would mount stale state at a path Fuseki no longer reads from,
66+
# silently looking like an empty database. Using a fresh volume name
67+
# forces operators to consciously migrate (or accept a re-index). The
68+
# orphaned `fuseki-data` volume can be removed manually with
69+
# `docker volume rm fuseki-data` after confirming the new stack is
70+
# healthy.
71+
- fuseki-tdb2-data:/fuseki-data
5072
deploy:
5173
resources:
5274
limits:
@@ -60,8 +82,6 @@ services:
6082
timeout: 10s
6183
retries: 20
6284
start_period: 60s
63-
# Create the database directory before starting Fuseki
64-
entrypoint: /bin/sh -c "mkdir -p /fuseki/databases/openmetadata && exec /docker-entrypoint.sh /jena-fuseki/fuseki-server --update --loc=/fuseki/databases/openmetadata /openmetadata"
6585

6686
networks:
6787
local_app_net:
@@ -72,5 +92,5 @@ networks:
7292
- subnet: "172.16.239.0/24"
7393

7494
volumes:
75-
fuseki-data:
95+
fuseki-tdb2-data:
7696
driver: local

docker/development/docker-compose-postgres-fuseki.yml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ volumes:
1515
ingestion-volume-dags:
1616
ingestion-volume-tmp:
1717
es-data:
18-
fuseki-data:
18+
# See docker-compose-fuseki.yml — renamed from `fuseki-data` to avoid
19+
# silently mounting stale state under the new Fuseki layout.
20+
fuseki-tdb2-data:
1921
services:
2022
postgresql:
2123
build:
@@ -565,17 +567,29 @@ services:
565567
- /var/run/docker.sock:/var/run/docker.sock:z # Need 600 permissions to run DockerOperator
566568

567569
fuseki:
568-
image: stain/jena-fuseki:5.0.0
570+
# See docker-compose-fuseki.yml for the rationale behind building from the
571+
# in-repo Dockerfile instead of using `stain/jena-fuseki:*` (unmaintained,
572+
# capped at 5.1.0, missing 2025 admin-side CVE fixes).
573+
build:
574+
context: ../rdf-store
575+
dockerfile: Dockerfile
576+
image: openmetadata-fuseki:5.6.0
569577
container_name: openmetadata-fuseki
570578
hostname: fuseki
571579
ports:
572580
- "3030:3030"
573581
environment:
574-
- ADMIN_PASSWORD=admin
582+
# Local-dev default — production deployments MUST override via
583+
# FUSEKI_ADMIN_PASSWORD / FUSEKI_OPENMETADATA_PASSWORD env vars.
584+
- FUSEKI_ADMIN_PASSWORD=${FUSEKI_ADMIN_PASSWORD:-admin}
585+
- FUSEKI_OPENMETADATA_PASSWORD=${FUSEKI_OPENMETADATA_PASSWORD:-openmetadata-secret}
575586
- JVM_ARGS=-Xmx4g -Xms2g
576-
- FUSEKI_BASE=/fuseki
577587
volumes:
578-
- fuseki-data:/fuseki
588+
# See docker-compose-fuseki.yml for why the volume was renamed from
589+
# `fuseki-data` to `fuseki-tdb2-data` (the data layout differs from the
590+
# previous stain/jena-fuseki image and reusing the old name silently
591+
# mounts stale state at a path Fuseki no longer reads).
592+
- fuseki-tdb2-data:/fuseki-data
579593
deploy:
580594
resources:
581595
limits:
@@ -584,8 +598,6 @@ services:
584598
memory: 2G
585599
networks:
586600
- local_app_net
587-
# Create the database directory before starting Fuseki
588-
entrypoint: /bin/sh -c "mkdir -p /fuseki/databases/openmetadata && exec /docker-entrypoint.sh /jena-fuseki/fuseki-server --update --loc=/fuseki/databases/openmetadata /openmetadata"
589601

590602

591603

docker/docker-compose-quickstart/Dockerfile.fuseki-alpine

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ RUN apt-get update && \
88
rm -rf /var/lib/apt/lists/*
99

1010
# Set Fuseki version and paths
11-
ENV FUSEKI_VERSION=4.10.0
11+
ENV FUSEKI_VERSION=5.6.0
1212
ENV FUSEKI_HOME=/fuseki
1313
ENV FUSEKI_BASE=/fuseki
1414

docker/docker-compose-quickstart/Dockerfile.fuseki-arm64

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ RUN apt-get update || true && \
1414
rm -rf /var/lib/apt/lists/*
1515

1616
# Set Fuseki version
17-
ENV FUSEKI_VERSION=5.0.0
17+
ENV FUSEKI_VERSION=5.6.0
1818
ENV FUSEKI_HOME=/fuseki
1919

2020
# Download and install Fuseki

docker/docker-compose-quickstart/Dockerfile.fuseki-multiarch

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Multi-architecture Fuseki build
2-
FROM --platform=$TARGETPLATFORM openjdk:17-jdk-slim
2+
# eclipse-temurin replaces the deprecated openjdk Docker Hub images.
3+
FROM --platform=$TARGETPLATFORM eclipse-temurin:17-jre-jammy
34

45
# Install required packages
56
RUN apt-get update && \
@@ -9,7 +10,7 @@ RUN apt-get update && \
910
rm -rf /var/lib/apt/lists/*
1011

1112
# Set Fuseki version and paths
12-
ENV FUSEKI_VERSION=4.10.0
13+
ENV FUSEKI_VERSION=5.6.0
1314
ENV FUSEKI_HOME=/fuseki
1415
ENV FUSEKI_BASE=/fuseki
1516

docker/docker-compose-quickstart/Dockerfile.fuseki-simple

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ FROM --platform=$BUILDPLATFORM alpine:latest AS downloader
33

44
RUN apk add --no-cache wget tar
55

6-
ENV FUSEKI_VERSION=5.0.0
6+
ENV FUSEKI_VERSION=5.6.0
77
WORKDIR /tmp
88

99
RUN wget -q https://archive.apache.org/dist/jena/binaries/apache-jena-fuseki-${FUSEKI_VERSION}.tar.gz && \
1010
tar -xzf apache-jena-fuseki-${FUSEKI_VERSION}.tar.gz && \
1111
mv apache-jena-fuseki-${FUSEKI_VERSION} /fuseki-dist
1212

13-
# Use OpenJDK base image for runtime
14-
FROM openjdk:17-slim
13+
# Runtime: eclipse-temurin replaces the deprecated openjdk Docker Hub images.
14+
FROM eclipse-temurin:17-jre-jammy
1515

1616
ENV FUSEKI_HOME=/fuseki
1717
ENV FUSEKI_BASE=/fuseki

docker/docker-compose-quickstart/Dockerfile.fuseki-working

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Simple Fuseki build that works on ARM64
2-
FROM openjdk:17-slim
2+
# eclipse-temurin replaces the deprecated openjdk Docker Hub images.
3+
FROM eclipse-temurin:17-jre-jammy
34

45
# Set Fuseki version and paths
5-
ENV FUSEKI_VERSION=4.10.0
6+
ENV FUSEKI_VERSION=5.6.0
67
ENV FUSEKI_HOME=/fuseki
78
ENV FUSEKI_BASE=/fuseki
89

docker/docker-compose-quickstart/docker-compose-fuseki-rosetta.yml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,32 @@ services:
33
fuseki:
44
# Force AMD64 platform with Rosetta 2 emulation
55
platform: linux/amd64
6-
image: stain/jena-fuseki:5.0.0
6+
# Build from the in-repo Dockerfile (Fuseki 5.6.0). See
7+
# docker-compose-fuseki.yml for the full rationale.
8+
build:
9+
context: ../rdf-store
10+
dockerfile: Dockerfile
11+
image: openmetadata-fuseki:5.6.0
712
container_name: fuseki-standalone
813
hostname: fuseki
914
ports:
1015
- "3030:3030"
1116
environment:
12-
# Admin credentials
13-
- ADMIN_PASSWORD=admin
14-
# JVM memory settings
17+
# Local-dev default — production deployments MUST override via
18+
# FUSEKI_ADMIN_PASSWORD / FUSEKI_OPENMETADATA_PASSWORD env vars.
19+
- FUSEKI_ADMIN_PASSWORD=${FUSEKI_ADMIN_PASSWORD:-admin}
20+
- FUSEKI_OPENMETADATA_PASSWORD=${FUSEKI_OPENMETADATA_PASSWORD:-openmetadata-secret}
1521
- JVM_ARGS=-Xmx8g -Xms4g
16-
- FUSEKI_BASE=/fuseki
1722
volumes:
18-
# Mount directory for persistent storage
19-
- ${DOCKER_VOLUMES_PATH:-./docker-volumes}/fuseki:/fuseki
23+
# Host bind path renamed from `.../fuseki` (used by the old stain image
24+
# layout) to `.../fuseki-tdb2-data` so an existing host directory with
25+
# the previous layout isn't silently mounted at /fuseki-data — Fuseki
26+
# would see an empty TDB2 store and the old data would appear lost.
27+
# Operators upgrading can either delete the new dir to start fresh or
28+
# migrate old data manually.
29+
- ${DOCKER_VOLUMES_PATH:-./docker-volumes}/fuseki-tdb2-data:/fuseki-data
2030
networks:
2131
- fuseki-net
22-
# Create openmetadata dataset on startup
23-
entrypoint: /bin/sh -c "mkdir -p /fuseki/databases/openmetadata && exec /docker-entrypoint.sh /jena-fuseki/fuseki-server --update --loc=/fuseki/databases/openmetadata /openmetadata"
2432
healthcheck:
2533
test: ["CMD", "wget", "-q", "--spider", "http://localhost:3030/$/ping"]
2634
interval: 15s

docker/docker-compose-quickstart/docker-compose-fuseki-standalone.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
11
# Standalone Apache Jena Fuseki for RDF/Knowledge Graph storage
22
services:
33
fuseki:
4-
image: stain/jena-fuseki:5.0.0
4+
# Build from the in-repo Dockerfile (Fuseki 5.6.0). See
5+
# ../development/docker-compose-fuseki.yml for the full rationale.
6+
build:
7+
context: ../rdf-store
8+
dockerfile: Dockerfile
9+
image: openmetadata-fuseki:5.6.0
510
container_name: fuseki-standalone
611
hostname: fuseki
712
ports:
813
- "3030:3030"
914
environment:
10-
# Admin credentials
11-
- ADMIN_PASSWORD=admin
12-
# JVM memory settings - adjust based on your system
15+
# Local-dev default — production deployments MUST override via
16+
# FUSEKI_ADMIN_PASSWORD / FUSEKI_OPENMETADATA_PASSWORD env vars.
17+
- FUSEKI_ADMIN_PASSWORD=${FUSEKI_ADMIN_PASSWORD:-admin}
18+
- FUSEKI_OPENMETADATA_PASSWORD=${FUSEKI_OPENMETADATA_PASSWORD:-openmetadata-secret}
1319
- JVM_ARGS=-Xmx4g -Xms2g
14-
# Fuseki configuration
15-
- FUSEKI_BASE=/fuseki
1620
volumes:
17-
# Mount directory for persistent storage (configurable via .env)
18-
- ${DOCKER_VOLUMES_PATH:-./docker-volumes}/fuseki:/fuseki
21+
# See docker-compose-fuseki-rosetta.yml — host bind path renamed so
22+
# existing directories with the old stain layout aren't silently
23+
# mounted at the new /fuseki-data path.
24+
- ${DOCKER_VOLUMES_PATH:-./docker-volumes}/fuseki-tdb2-data:/fuseki-data
1925
networks:
2026
- fuseki-net
21-
# Create openmetadata dataset on startup
22-
entrypoint: /bin/sh -c "mkdir -p /fuseki/databases/openmetadata && exec /docker-entrypoint.sh /jena-fuseki/fuseki-server --update --loc=/fuseki/databases/openmetadata /openmetadata"
2327
healthcheck:
2428
test: ["CMD", "wget", "-q", "--spider", "http://localhost:3030/$/ping"]
2529
interval: 15s

0 commit comments

Comments
 (0)