Skip to content

Commit 005bcf7

Browse files
committed
Merge branch 'develop' into feature/TED9-166_extend-github-download-packages
2 parents 67bd820 + 1a3e707 commit 005bcf7

5 files changed

Lines changed: 1737 additions & 2 deletions

File tree

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ shortuuid==1.0.13
2828
pendulum==3.0.0
2929
saxonche==12.8.0
3030
elasticsearch-dbapi==0.2.11
31-
git+https://github.com/meaningfy-ws/mapping-suite-sdk.git@develop
31+
git+https://github.com/meaningfy-ws/mapping-suite-sdk.git@6912e51999fce515d0175e4e9c2b0c3b4cd6b551

src/infra/ted-sws-stack/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ docker compose -p ted-sws-stack logs -f
6767
| `.env.testing` | Testing/SRV passwords from Vault (generated by `make testing-unified-dotenv`) |
6868
| `airflow/Dockerfile` | Airflow image with celery provider |
6969
| `airflow/requirements.txt` | Python dependencies for Airflow |
70+
| `fuseki/seed/*.ttl` | Seed data loaded into Fuseki on first startup (one dataset per file) |
7071

7172
## Environment Configuration
7273

@@ -165,6 +166,16 @@ docker volume rm minio-data mongodb-data fuseki-data sftp-data airflow-postgres-
165166
make start-local-stack
166167
```
167168

169+
## Fuseki Seed Data
170+
171+
The `fuseki-init` service runs once on startup (after Fuseki is healthy) and
172+
idempotently creates datasets from TTL files in `fuseki/seed/`. Each file
173+
becomes a dataset named after the file (e.g., `test_limes.ttl` → dataset
174+
`test_limes`). Existing datasets are skipped.
175+
176+
To add a new dataset, drop a `.ttl` file in `fuseki/seed/` and restart the
177+
stack. No code changes required.
178+
168179
## Migration from Old Setup
169180

170181
### Before (old way)

src/infra/ted-sws-stack/airflow/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ shortuuid==1.0.13
2828
pendulum==3.0.0
2929
saxonche==12.8.0
3030
elasticsearch-dbapi==0.2.11
31-
git+https://github.com/meaningfy-ws/mapping-suite-sdk.git@develop
31+
git+https://github.com/meaningfy-ws/mapping-suite-sdk.git@6912e51999fce515d0175e4e9c2b0c3b4cd6b551

src/infra/ted-sws-stack/docker-compose.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,50 @@ services:
9999
restart: unless-stopped
100100
environment:
101101
ADMIN_PASSWORD: ${FUSEKI_ADMIN_PASSWORD}
102+
healthcheck:
103+
test: ["CMD", "wget", "-qO-", "http://localhost:3030/$/ping"]
104+
interval: 5s
105+
timeout: 5s
106+
retries: 10
102107
networks:
103108
- internal
104109
- proxy-net
105110

111+
fuseki-init:
112+
image: curlimages/curl:8.12.1
113+
container_name: fuseki-init
114+
restart: "no"
115+
depends_on:
116+
fuseki:
117+
condition: service_healthy
118+
environment:
119+
FUSEKI_ADMIN_PASSWORD: ${FUSEKI_ADMIN_PASSWORD}
120+
volumes:
121+
- ./fuseki/seed:/seed:ro
122+
entrypoint: ["/bin/sh", "-c"]
123+
command:
124+
- |
125+
DATASETS=$$(curl -sf -u "admin:$$FUSEKI_ADMIN_PASSWORD" "http://fuseki:3030/\$$/datasets")
126+
for f in /seed/*.ttl; do
127+
ds=$$(basename "$$f" .ttl)
128+
if echo "$$DATASETS" | grep -q "\"/$${ds}\""; then
129+
echo "Dataset $$ds already exists, skipping."
130+
else
131+
echo "Creating dataset $$ds..."
132+
curl -sf -u "admin:$$FUSEKI_ADMIN_PASSWORD" -X POST \
133+
"http://fuseki:3030/\$$/datasets" \
134+
-d "dbName=$$ds&dbType=tdb2"
135+
echo "Loading data into $$ds..."
136+
curl -sf -u "admin:$$FUSEKI_ADMIN_PASSWORD" -X POST \
137+
"http://fuseki:3030/$$ds/data" \
138+
-H "Content-Type: text/turtle" \
139+
--data-binary "@$$f" && echo "Loaded $$f into $$ds" || echo "FAIL: could not load $$f"
140+
fi
141+
done
142+
echo "Fuseki init complete."
143+
networks:
144+
- internal
145+
106146
metabase:
107147
image: *metabase-version
108148
container_name: metabase

0 commit comments

Comments
 (0)