container-superposition 0.1.8 → 0.1.9
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/dist/tool/commands/adopt.js +1 -1
- package/dist/tool/commands/adopt.js.map +1 -1
- package/dist/tool/commands/doctor.d.ts +1 -0
- package/dist/tool/commands/doctor.d.ts.map +1 -1
- package/dist/tool/commands/doctor.js +1370 -73
- package/dist/tool/commands/doctor.js.map +1 -1
- package/dist/tool/questionnaire/composer.d.ts +3 -1
- package/dist/tool/questionnaire/composer.d.ts.map +1 -1
- package/dist/tool/questionnaire/composer.js +87 -18
- package/dist/tool/questionnaire/composer.js.map +1 -1
- package/dist/tool/questionnaire/presets.d.ts.map +1 -1
- package/dist/tool/questionnaire/presets.js +1 -0
- package/dist/tool/questionnaire/presets.js.map +1 -1
- package/dist/tool/questionnaire/questionnaire.d.ts.map +1 -1
- package/dist/tool/questionnaire/questionnaire.js +3 -1
- package/dist/tool/questionnaire/questionnaire.js.map +1 -1
- package/dist/tool/schema/project-config.d.ts.map +1 -1
- package/dist/tool/schema/project-config.js +5 -1
- package/dist/tool/schema/project-config.js.map +1 -1
- package/dist/tool/schema/types.d.ts +4 -2
- package/dist/tool/schema/types.d.ts.map +1 -1
- package/docs/overlays.md +158 -147
- package/docs/specs/001-verbose-plan-graph/spec.md +5 -12
- package/docs/specs/002-superposition-config-file/spec.md +5 -12
- package/docs/specs/003-mkdocs2-overlay/spec.md +2 -9
- package/docs/specs/004-doctor-fix/spec.md +1 -8
- package/docs/specs/005-cuda-overlay/spec.md +2 -9
- package/docs/specs/006-rocm-overlay/spec.md +3 -10
- package/docs/specs/007-target-aware-generation/spec.md +4 -11
- package/docs/specs/008-project-file-canonical/spec.md +7 -8
- package/docs/specs/009-project-env/spec.md +3 -10
- package/docs/specs/010-compose-env-materialization/spec.md +3 -10
- package/docs/specs/011-overlay-parameters/spec.md +2 -9
- package/docs/specs/012-ollama-cli-overlay/spec.md +47 -0
- package/docs/specs/013-doctor-dependency-check/spec.md +250 -0
- package/docs/specs/014-doctor-compose-port-cross-validation/spec.md +276 -0
- package/docs/specs/015-doctor-env-example-drift/spec.md +248 -0
- package/docs/specs/016-doctor-reproducibility-check/spec.md +276 -0
- package/docs/specs/017-doctor-dry-run/spec.md +276 -0
- package/docs/specs/{007-init-project-file → 018-init-project-file}/spec.md +2 -9
- package/docs/specs/taxonomy.md +186 -0
- package/overlays/.presets/full-observability.yml +113 -0
- package/overlays/.presets/k8s-dev.yml +174 -0
- package/overlays/.presets/local-llm.yml +105 -0
- package/overlays/.presets/vector-ai.yml +150 -0
- package/overlays/.shared/vscode/js-ts-settings.json +19 -0
- package/overlays/.shared/vscode/markdown-extensions.json +8 -0
- package/overlays/alertmanager/devcontainer.patch.json +0 -1
- package/overlays/alertmanager/docker-compose.yml +8 -0
- package/overlays/alertmanager/overlay.yml +1 -0
- package/overlays/amp/devcontainer.patch.json +4 -1
- package/overlays/bun/devcontainer.patch.json +1 -10
- package/overlays/bun/overlay.yml +8 -1
- package/overlays/claude-code/devcontainer.patch.json +6 -1
- package/overlays/codex/devcontainer.patch.json +5 -0
- package/overlays/comfyui/docker-compose.yml +1 -0
- package/overlays/comfyui/overlay.yml +4 -0
- package/overlays/commitlint/devcontainer.patch.json +1 -6
- package/overlays/docker-sock/overlay.yml +1 -0
- package/overlays/dotnet/overlay.yml +4 -1
- package/overlays/fuseki/.env.example +5 -0
- package/overlays/fuseki/README.md +173 -0
- package/overlays/fuseki/devcontainer.patch.json +18 -0
- package/overlays/fuseki/docker-compose.yml +29 -0
- package/overlays/fuseki/overlay.yml +42 -0
- package/overlays/fuseki/verify.sh +58 -0
- package/overlays/gemini-cli/devcontainer.patch.json +4 -1
- package/overlays/go/overlay.yml +6 -1
- package/overlays/grafana/devcontainer.patch.json +0 -1
- package/overlays/grafana/docker-compose.yml +8 -2
- package/overlays/grafana/overlay.yml +6 -1
- package/overlays/jaeger/.env.example +11 -0
- package/overlays/jaeger/README.md +33 -4
- package/overlays/jaeger/devcontainer.patch.json +9 -1
- package/overlays/jaeger/docker-compose.yml +17 -0
- package/overlays/jaeger/overlay.yml +1 -12
- package/overlays/java/overlay.yml +6 -1
- package/overlays/jupyter/docker-compose.yml +1 -0
- package/overlays/jupyter/overlay.yml +1 -0
- package/overlays/keycloak/devcontainer.patch.json +0 -1
- package/overlays/keycloak/docker-compose.yml +1 -0
- package/overlays/keycloak/overlay.yml +15 -0
- package/overlays/localstack/docker-compose.yml +1 -0
- package/overlays/localstack/overlay.yml +19 -1
- package/overlays/loki/devcontainer.patch.json +0 -1
- package/overlays/loki/docker-compose.yml +8 -0
- package/overlays/loki/overlay.yml +1 -0
- package/overlays/mailpit/docker-compose.yml +1 -0
- package/overlays/mailpit/overlay.yml +1 -0
- package/overlays/minio/devcontainer.patch.json +1 -1
- package/overlays/minio/docker-compose.yml +1 -0
- package/overlays/minio/overlay.yml +23 -2
- package/overlays/mkdocs/devcontainer.patch.json +1 -5
- package/overlays/mkdocs/overlay.yml +3 -1
- package/overlays/mkdocs2/devcontainer.patch.json +1 -5
- package/overlays/mkdocs2/overlay.yml +2 -0
- package/overlays/mongodb/docker-compose.yml +2 -0
- package/overlays/mongodb/overlay.yml +26 -2
- package/overlays/mysql/docker-compose.yml +2 -0
- package/overlays/mysql/overlay.yml +36 -2
- package/overlays/nats/docker-compose.yml +1 -0
- package/overlays/nats/overlay.yml +18 -2
- package/overlays/nodejs/devcontainer.patch.json +1 -12
- package/overlays/nodejs/overlay.yml +8 -1
- package/overlays/ollama/README.md +4 -3
- package/overlays/ollama/docker-compose.yml +1 -0
- package/overlays/ollama/overlay.yml +6 -1
- package/overlays/ollama/verify.sh +5 -28
- package/overlays/ollama-cli/README.md +90 -0
- package/overlays/ollama-cli/devcontainer.patch.json +3 -0
- package/overlays/ollama-cli/overlay.yml +19 -0
- package/overlays/{ollama → ollama-cli}/setup.sh +7 -10
- package/overlays/ollama-cli/verify.sh +49 -0
- package/overlays/open-webui/docker-compose.yml +1 -0
- package/overlays/open-webui/overlay.yml +8 -1
- package/overlays/opencode/devcontainer.patch.json +4 -1
- package/overlays/otel-collector/README.md +4 -0
- package/overlays/otel-collector/devcontainer.patch.json +4 -1
- package/overlays/otel-collector/docker-compose.yml +8 -4
- package/overlays/otel-collector/overlay.yml +1 -0
- package/overlays/otel-demo-nodejs/devcontainer.patch.json +0 -1
- package/overlays/otel-demo-nodejs/docker-compose.yml +1 -0
- package/overlays/otel-demo-nodejs/overlay.yml +9 -1
- package/overlays/otel-demo-python/devcontainer.patch.json +0 -1
- package/overlays/otel-demo-python/docker-compose.yml +1 -0
- package/overlays/otel-demo-python/overlay.yml +6 -1
- package/overlays/pandoc/README.md +10 -0
- package/overlays/pandoc/devcontainer.patch.json +0 -5
- package/overlays/pandoc/overlay.yml +2 -0
- package/overlays/pandoc/setup.sh +10 -0
- package/overlays/pgvector/devcontainer.patch.json +11 -5
- package/overlays/pgvector/docker-compose.yml +1 -0
- package/overlays/pgvector/overlay.yml +3 -0
- package/overlays/playwright/devcontainer.patch.json +0 -5
- package/overlays/playwright/overlay.yml +2 -1
- package/overlays/postgres/docker-compose.yml +1 -0
- package/overlays/postgres/overlay.yml +4 -1
- package/overlays/pre-commit/devcontainer.patch.json +1 -7
- package/overlays/prometheus/devcontainer.patch.json +0 -1
- package/overlays/prometheus/docker-compose.yml +8 -0
- package/overlays/prometheus/overlay.yml +1 -0
- package/overlays/promtail/devcontainer.patch.json +1 -2
- package/overlays/promtail/docker-compose.yml +8 -0
- package/overlays/promtail/overlay.yml +1 -0
- package/overlays/qdrant/docker-compose.yml +1 -0
- package/overlays/qdrant/overlay.yml +5 -1
- package/overlays/rabbitmq/docker-compose.yml +1 -0
- package/overlays/rabbitmq/overlay.yml +25 -2
- package/overlays/redis/docker-compose.yml +7 -0
- package/overlays/redis/overlay.yml +15 -1
- package/overlays/redpanda/docker-compose.yml +1 -0
- package/overlays/redpanda/overlay.yml +15 -3
- package/overlays/rocm/overlay.yml +2 -1
- package/overlays/rust/overlay.yml +3 -1
- package/overlays/sqlserver/docker-compose.yml +1 -0
- package/overlays/sqlserver/overlay.yml +17 -0
- package/overlays/tempo/devcontainer.patch.json +0 -1
- package/overlays/tempo/docker-compose.yml +8 -0
- package/overlays/tempo/overlay.yml +1 -0
- package/overlays/windsurf-cli/devcontainer.patch.json +4 -1
- package/package.json +1 -1
- package/overlays/.shared/otel/otel-base-config.yaml +0 -30
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# Vector AI Stack Preset
|
|
2
|
+
# Full RAG pipeline: vector DB + local embeddings + Python client
|
|
3
|
+
|
|
4
|
+
id: vector-ai
|
|
5
|
+
name: Vector AI Stack
|
|
6
|
+
description: Full RAG pipeline — Qdrant vector database, Ollama for local embeddings, and Python for client code
|
|
7
|
+
type: meta
|
|
8
|
+
category: preset
|
|
9
|
+
supports: [compose] # Requires Docker Compose for Qdrant and Ollama services
|
|
10
|
+
tags: [preset, ai, rag, vector, embeddings, qdrant, ollama, python]
|
|
11
|
+
|
|
12
|
+
selects:
|
|
13
|
+
required:
|
|
14
|
+
- qdrant
|
|
15
|
+
- ollama
|
|
16
|
+
- ollama-cli
|
|
17
|
+
- python
|
|
18
|
+
|
|
19
|
+
userChoice: {}
|
|
20
|
+
|
|
21
|
+
parameters:
|
|
22
|
+
gpu:
|
|
23
|
+
description: 'GPU acceleration for embedding generation'
|
|
24
|
+
default: none
|
|
25
|
+
options:
|
|
26
|
+
- id: none
|
|
27
|
+
overlays: []
|
|
28
|
+
description: 'CPU only — adequate for embedding workloads (smaller models)'
|
|
29
|
+
- id: nvidia
|
|
30
|
+
overlays: [cuda]
|
|
31
|
+
description: 'Nvidia GPU via CUDA — significantly faster embedding throughput'
|
|
32
|
+
- id: amd
|
|
33
|
+
overlays: [rocm]
|
|
34
|
+
description: 'AMD GPU via ROCm'
|
|
35
|
+
|
|
36
|
+
chat_ui:
|
|
37
|
+
description: 'Browser chat UI (optional — useful for testing your RAG pipeline)'
|
|
38
|
+
default: none
|
|
39
|
+
options:
|
|
40
|
+
- id: none
|
|
41
|
+
overlays: []
|
|
42
|
+
description: 'No chat UI — use the API or your own frontend'
|
|
43
|
+
- id: open-webui
|
|
44
|
+
overlays: [open-webui]
|
|
45
|
+
description: 'Open WebUI — test RAG-augmented chat visually'
|
|
46
|
+
|
|
47
|
+
glueConfig:
|
|
48
|
+
environment:
|
|
49
|
+
OLLAMA_HOST: 'http://ollama:11434'
|
|
50
|
+
QDRANT_HOST: 'qdrant'
|
|
51
|
+
QDRANT_PORT: '6333'
|
|
52
|
+
QDRANT_URL: 'http://qdrant:6333'
|
|
53
|
+
EMBEDDING_MODEL: 'nomic-embed-text'
|
|
54
|
+
|
|
55
|
+
portMappings:
|
|
56
|
+
qdrant-rest: 6333
|
|
57
|
+
qdrant-grpc: 6334
|
|
58
|
+
ollama-api: 11434
|
|
59
|
+
|
|
60
|
+
readme: |
|
|
61
|
+
## Vector AI Stack
|
|
62
|
+
|
|
63
|
+
This devcontainer provides a complete local RAG (Retrieval-Augmented Generation) pipeline.
|
|
64
|
+
|
|
65
|
+
### Services
|
|
66
|
+
|
|
67
|
+
| Service | Port | Purpose |
|
|
68
|
+
|---------|------|---------|
|
|
69
|
+
| Qdrant | 6333 (REST), 6334 (gRPC) | Vector database |
|
|
70
|
+
| Ollama | 11434 | LLM and embedding model runtime |
|
|
71
|
+
| ollama-cli | — | `ollama` command in terminal |
|
|
72
|
+
|
|
73
|
+
### Quick Start
|
|
74
|
+
|
|
75
|
+
#### 1. Pull an embedding model
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
ollama pull nomic-embed-text
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
#### 2. Pull a chat model (for RAG generation)
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
ollama pull llama3.2
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
#### 3. Build your pipeline (Python example)
|
|
88
|
+
|
|
89
|
+
```python
|
|
90
|
+
from qdrant_client import QdrantClient
|
|
91
|
+
import ollama
|
|
92
|
+
import os
|
|
93
|
+
|
|
94
|
+
qdrant = QdrantClient(url=os.environ["QDRANT_URL"])
|
|
95
|
+
embedding_model = os.environ["EMBEDDING_MODEL"]
|
|
96
|
+
|
|
97
|
+
# Create a collection
|
|
98
|
+
from qdrant_client.models import Distance, VectorParams
|
|
99
|
+
qdrant.create_collection(
|
|
100
|
+
collection_name="docs",
|
|
101
|
+
vectors_config=VectorParams(size=768, distance=Distance.COSINE),
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
# Embed and index a document
|
|
105
|
+
text = "Container Superposition makes devcontainer composition easy."
|
|
106
|
+
response = ollama.embed(model=embedding_model, input=text)
|
|
107
|
+
vector = response["embeddings"][0]
|
|
108
|
+
|
|
109
|
+
qdrant.upsert(
|
|
110
|
+
collection_name="docs",
|
|
111
|
+
points=[{"id": 1, "vector": vector, "payload": {"text": text}}],
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
# Search
|
|
115
|
+
query = "How does devcontainer composition work?"
|
|
116
|
+
q_vec = ollama.embed(model=embedding_model, input=query)["embeddings"][0]
|
|
117
|
+
results = qdrant.search(collection_name="docs", query_vector=q_vec, limit=3)
|
|
118
|
+
for r in results:
|
|
119
|
+
print(r.payload["text"])
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Environment Variables
|
|
123
|
+
|
|
124
|
+
Already set in your devcontainer:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
OLLAMA_HOST=http://ollama:11434
|
|
128
|
+
QDRANT_HOST=qdrant
|
|
129
|
+
QDRANT_PORT=6333
|
|
130
|
+
QDRANT_URL=http://qdrant:6333
|
|
131
|
+
EMBEDDING_MODEL=nomic-embed-text
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Qdrant Dashboard
|
|
135
|
+
|
|
136
|
+
Access the Qdrant web dashboard at http://localhost:6333/dashboard to inspect
|
|
137
|
+
collections, run queries, and monitor index health.
|
|
138
|
+
|
|
139
|
+
### Recommended Python Packages
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
pip install qdrant-client ollama openai langchain-community
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Next Steps
|
|
146
|
+
|
|
147
|
+
- Add the `local-llm` preset's Open WebUI to test your RAG pipeline through a chat interface
|
|
148
|
+
- Swap `nomic-embed-text` for `mxbai-embed-large` for higher-quality embeddings
|
|
149
|
+
- Use Qdrant's named vectors for hybrid dense + sparse retrieval
|
|
150
|
+
- Add `prometheus` and `grafana` overlays to monitor Qdrant query performance
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"customizations": {
|
|
3
|
+
"vscode": {
|
|
4
|
+
"extensions": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"],
|
|
5
|
+
"settings": {
|
|
6
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
7
|
+
"editor.formatOnSave": true,
|
|
8
|
+
"[typescript]": {
|
|
9
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
10
|
+
"editor.formatOnSave": true
|
|
11
|
+
},
|
|
12
|
+
"[javascript]": {
|
|
13
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
14
|
+
"editor.formatOnSave": true
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -2,6 +2,7 @@ version: '3.8'
|
|
|
2
2
|
services:
|
|
3
3
|
alertmanager:
|
|
4
4
|
image: prom/alertmanager:${ALERTMANAGER_VERSION:-latest}
|
|
5
|
+
restart: unless-stopped
|
|
5
6
|
command:
|
|
6
7
|
- '--config.file=/etc/alertmanager/alertmanager.yml'
|
|
7
8
|
- '--storage.path=/alertmanager'
|
|
@@ -12,9 +13,16 @@ services:
|
|
|
12
13
|
- '${ALERTMANAGER_PORT:-9093}:9093'
|
|
13
14
|
networks:
|
|
14
15
|
- devnet
|
|
16
|
+
healthcheck:
|
|
17
|
+
test: ['CMD', 'wget', '-qO-', 'http://localhost:9093/-/ready']
|
|
18
|
+
interval: 10s
|
|
19
|
+
timeout: 5s
|
|
20
|
+
retries: 5
|
|
21
|
+
start_period: 10s
|
|
15
22
|
|
|
16
23
|
volumes:
|
|
17
24
|
alertmanager_data:
|
|
18
25
|
|
|
19
26
|
networks:
|
|
20
27
|
devnet:
|
|
28
|
+
name: devnet
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.base.schema.json"
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.base.schema.json",
|
|
3
|
+
"postCreateCommand": {
|
|
4
|
+
"setup-amp": "bash .devcontainer/scripts/setup-amp.sh"
|
|
5
|
+
}
|
|
3
6
|
}
|
|
@@ -12,16 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"customizations": {
|
|
14
14
|
"vscode": {
|
|
15
|
-
"extensions": ["oven.bun-vscode"
|
|
16
|
-
"settings": {
|
|
17
|
-
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
18
|
-
"[typescript]": {
|
|
19
|
-
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
20
|
-
},
|
|
21
|
-
"[javascript]": {
|
|
22
|
-
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
23
|
-
}
|
|
24
|
-
}
|
|
15
|
+
"extensions": ["oven.bun-vscode"]
|
|
25
16
|
}
|
|
26
17
|
},
|
|
27
18
|
"remoteEnv": {
|
package/overlays/bun/overlay.yml
CHANGED
|
@@ -5,7 +5,12 @@ category: language
|
|
|
5
5
|
supports: []
|
|
6
6
|
requires: []
|
|
7
7
|
suggests: []
|
|
8
|
-
conflicts:
|
|
8
|
+
conflicts:
|
|
9
|
+
- grafana
|
|
10
|
+
- open-webui
|
|
11
|
+
- mysql
|
|
12
|
+
- redpanda
|
|
13
|
+
- otel-demo-nodejs
|
|
9
14
|
tags:
|
|
10
15
|
- language
|
|
11
16
|
- bun
|
|
@@ -14,3 +19,5 @@ tags:
|
|
|
14
19
|
ports:
|
|
15
20
|
- 3000
|
|
16
21
|
- 8080
|
|
22
|
+
imports:
|
|
23
|
+
- .shared/vscode/js-ts-settings.json
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.base.schema.json"
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.base.schema.json",
|
|
3
|
+
"customizations": {
|
|
4
|
+
"vscode": {
|
|
5
|
+
"extensions": ["anthropic.claude-code"]
|
|
6
|
+
}
|
|
7
|
+
}
|
|
3
8
|
}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.base.schema.json"
|
|
3
|
-
"features": {
|
|
4
|
-
"ghcr.io/devcontainers/features/node:1": {
|
|
5
|
-
"version": "lts"
|
|
6
|
-
}
|
|
7
|
-
}
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.base.schema.json"
|
|
8
3
|
}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# Apache Jena Fuseki Overlay
|
|
2
|
+
|
|
3
|
+
SPARQL 1.1 server and RDF triplestore powered by Apache Jena TDB2, with a built-in web administration UI.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Apache Jena Fuseki** — SPARQL 1.1 server supporting queries, updates, and the Graph Store Protocol
|
|
8
|
+
- **TDB2 triplestore** — High-performance persistent RDF storage with better concurrency than TDB1
|
|
9
|
+
- **Admin web UI** — Browser-based interface for managing datasets, running ad-hoc queries, and monitoring the server (port 3030)
|
|
10
|
+
- **REST management API** — Create, list, and delete datasets without restarting the server
|
|
11
|
+
- **Dataset auto-creation** — A default dataset is created automatically on first start
|
|
12
|
+
- **Persistent storage** — RDF data is stored in a named Docker volume (`fuseki-data`) and survives container restarts
|
|
13
|
+
- **Docker Compose service** — Runs as an isolated sidecar container accessible on the `devnet` network
|
|
14
|
+
|
|
15
|
+
## How It Works
|
|
16
|
+
|
|
17
|
+
This overlay adds Fuseki as a separate Docker Compose service. Fuseki runs inside its own container and is reachable from your development container using the hostname `fuseki`.
|
|
18
|
+
|
|
19
|
+
**Service configuration:**
|
|
20
|
+
|
|
21
|
+
- Image: `ghcr.io/stain/jena-fuseki`
|
|
22
|
+
- Network: `devnet` (shared with the dev container)
|
|
23
|
+
- Persistence: `fuseki-data` volume for TDB2 database files
|
|
24
|
+
- Port: 3030 (customizable via `FUSEKI_PORT` host mapping)
|
|
25
|
+
|
|
26
|
+
**Environment variables set in the dev container:**
|
|
27
|
+
|
|
28
|
+
| Variable | Value | Description |
|
|
29
|
+
| ----------------------- | -------------------- | ----------------------------------------- |
|
|
30
|
+
| `FUSEKI_HOST` | `fuseki` | Container hostname for internal access |
|
|
31
|
+
| `FUSEKI_PORT` | `3030` | Container-internal port for SPARQL access |
|
|
32
|
+
| `FUSEKI_URL` | `http://fuseki:3030` | Base URL for SPARQL requests |
|
|
33
|
+
| `FUSEKI_DATASET` | `ds` (default) | Name of the default dataset |
|
|
34
|
+
| `FUSEKI_ADMIN_PASSWORD` | see `.env` | Admin user password (set in `.env`) |
|
|
35
|
+
|
|
36
|
+
## Common Commands
|
|
37
|
+
|
|
38
|
+
### SPARQL Queries
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Simple SELECT query
|
|
42
|
+
curl -X POST \
|
|
43
|
+
-H "Content-Type: application/sparql-query" \
|
|
44
|
+
-d "SELECT * WHERE { ?s ?p ?o } LIMIT 10" \
|
|
45
|
+
"$FUSEKI_URL/$FUSEKI_DATASET/query"
|
|
46
|
+
|
|
47
|
+
# Query with URL encoding (GET request)
|
|
48
|
+
curl -G "$FUSEKI_URL/$FUSEKI_DATASET/query" \
|
|
49
|
+
--data-urlencode "query=SELECT * WHERE { ?s ?p ?o } LIMIT 10"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Loading RDF Data
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# Load a Turtle file into the default graph
|
|
56
|
+
curl -X PUT \
|
|
57
|
+
-H "Content-Type: text/turtle" \
|
|
58
|
+
--data-binary @data.ttl \
|
|
59
|
+
"$FUSEKI_URL/$FUSEKI_DATASET/data"
|
|
60
|
+
|
|
61
|
+
# Add data without replacing existing triples (POST)
|
|
62
|
+
curl -X POST \
|
|
63
|
+
-H "Content-Type: text/turtle" \
|
|
64
|
+
--data-binary @more-data.ttl \
|
|
65
|
+
"$FUSEKI_URL/$FUSEKI_DATASET/data"
|
|
66
|
+
|
|
67
|
+
# Load into a named graph
|
|
68
|
+
curl -X PUT \
|
|
69
|
+
-H "Content-Type: text/turtle" \
|
|
70
|
+
--data-binary @data.ttl \
|
|
71
|
+
"$FUSEKI_URL/$FUSEKI_DATASET/data?graph=http://example.org/mygraph"
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### SPARQL Update
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# Insert triples via SPARQL Update
|
|
78
|
+
curl -X POST \
|
|
79
|
+
-H "Content-Type: application/sparql-update" \
|
|
80
|
+
-d "INSERT DATA { <http://example.org/s> <http://example.org/p> \"o\" . }" \
|
|
81
|
+
"$FUSEKI_URL/$FUSEKI_DATASET/update"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Dataset Management
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# List all datasets (requires admin credentials)
|
|
88
|
+
curl -u "admin:$FUSEKI_ADMIN_PASSWORD" "$FUSEKI_URL/\$/datasets"
|
|
89
|
+
|
|
90
|
+
# Create a new TDB2-backed dataset
|
|
91
|
+
curl -X POST \
|
|
92
|
+
-u "admin:$FUSEKI_ADMIN_PASSWORD" \
|
|
93
|
+
-H "Content-Type: application/x-www-form-urlencoded" \
|
|
94
|
+
-d "dbName=mydata&dbType=tdb2" \
|
|
95
|
+
"$FUSEKI_URL/\$/datasets"
|
|
96
|
+
|
|
97
|
+
# Delete a dataset
|
|
98
|
+
curl -X DELETE \
|
|
99
|
+
-u "admin:$FUSEKI_ADMIN_PASSWORD" \
|
|
100
|
+
"$FUSEKI_URL/\$/datasets/mydata"
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Admin UI
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# Open in browser (from the host machine)
|
|
107
|
+
open http://localhost:3030
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Log in with username `admin` and the configured `FUSEKI_ADMIN_PASSWORD`. From the UI you can browse and query datasets, upload RDF files, create/delete datasets, and monitor server statistics.
|
|
111
|
+
|
|
112
|
+
## Use Cases
|
|
113
|
+
|
|
114
|
+
- **Semantic web development** — Prototype and test OWL/RDFS ontologies and SPARQL queries locally
|
|
115
|
+
- **Linked data applications** — Build applications that consume or publish RDF data
|
|
116
|
+
- **Knowledge graph projects** — Store, update, and query knowledge graphs during development
|
|
117
|
+
- **Data integration** — Use SPARQL Federation or CONSTRUCT queries to merge heterogeneous data sources
|
|
118
|
+
- **Research and education** — Run SPARQL 1.1 workloads without a cloud account
|
|
119
|
+
|
|
120
|
+
**Integrates well with:**
|
|
121
|
+
|
|
122
|
+
- `java` — Use Apache Jena client library (`jena-arq`) for typed SPARQL queries
|
|
123
|
+
- `python` — Use `SPARQLWrapper` or `rdflib-endpoint` for data science workflows
|
|
124
|
+
- `nodejs` — Use `n3` or `comunica` for JavaScript/TypeScript SPARQL clients
|
|
125
|
+
|
|
126
|
+
## Configuration
|
|
127
|
+
|
|
128
|
+
### Environment Variables
|
|
129
|
+
|
|
130
|
+
The overlay includes a `.env.example` file. Copy and customize:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
cd .devcontainer
|
|
134
|
+
cp .env.example .env
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**Default values (`.devcontainer/.env.example`):**
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
FUSEKI_VERSION=latest
|
|
141
|
+
FUSEKI_PORT=3030
|
|
142
|
+
FUSEKI_ADMIN_PASSWORD=admin # ⚠ Change this for any shared environment
|
|
143
|
+
FUSEKI_DATASET=ds
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
⚠️ **Security:** The default `FUSEKI_ADMIN_PASSWORD=admin` must be changed for any environment accessible beyond localhost.
|
|
147
|
+
|
|
148
|
+
### SPARQL Endpoints
|
|
149
|
+
|
|
150
|
+
Default dataset `ds` endpoints (from inside the dev container):
|
|
151
|
+
|
|
152
|
+
| Endpoint | URL |
|
|
153
|
+
| ----------------- | ------------------------------ |
|
|
154
|
+
| SPARQL Query | `http://fuseki:3030/ds/query` |
|
|
155
|
+
| SPARQL Update | `http://fuseki:3030/ds/update` |
|
|
156
|
+
| Graph Store (GSP) | `http://fuseki:3030/ds/data` |
|
|
157
|
+
| Admin UI | `http://fuseki:3030` |
|
|
158
|
+
|
|
159
|
+
All endpoints are also forwarded to `localhost:3030` on the host machine.
|
|
160
|
+
|
|
161
|
+
## References
|
|
162
|
+
|
|
163
|
+
- [Apache Jena Fuseki Documentation](https://jena.apache.org/documentation/fuseki2/)
|
|
164
|
+
- [SPARQL 1.1 Query Language](https://www.w3.org/TR/sparql11-query/)
|
|
165
|
+
- [SPARQL 1.1 Update](https://www.w3.org/TR/sparql11-update/)
|
|
166
|
+
- [Fuseki Docker Image (stain/jena-docker)](https://github.com/stain/jena-docker)
|
|
167
|
+
- [Apache Jena TDB2](https://jena.apache.org/documentation/tdb2/)
|
|
168
|
+
|
|
169
|
+
**Related Overlays:**
|
|
170
|
+
|
|
171
|
+
- `java` — Develop JVM applications using Apache Jena client libraries
|
|
172
|
+
- `python` — Use RDFLib or SPARQLWrapper for Python-based SPARQL workflows
|
|
173
|
+
- `nodejs` — Build JavaScript SPARQL clients with Comunica or N3.js
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.base.schema.json",
|
|
3
|
+
"runServices": ["fuseki"],
|
|
4
|
+
"forwardPorts": [3030],
|
|
5
|
+
"portsAttributes": {
|
|
6
|
+
"3030": {
|
|
7
|
+
"label": "Fuseki SPARQL Server",
|
|
8
|
+
"onAutoForward": "openBrowser"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"remoteEnv": {
|
|
12
|
+
"FUSEKI_HOST": "fuseki",
|
|
13
|
+
"FUSEKI_PORT": "3030",
|
|
14
|
+
"FUSEKI_DATASET": "{{cs.FUSEKI_DATASET}}",
|
|
15
|
+
"FUSEKI_ADMIN_PASSWORD": "{{cs.FUSEKI_ADMIN_PASSWORD}}",
|
|
16
|
+
"FUSEKI_URL": "http://fuseki:3030"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
version: '3.8'
|
|
2
|
+
|
|
3
|
+
services:
|
|
4
|
+
fuseki:
|
|
5
|
+
image: stain/jena-fuseki:${FUSEKI_VERSION:-{{cs.FUSEKI_VERSION}}}
|
|
6
|
+
restart: unless-stopped
|
|
7
|
+
volumes:
|
|
8
|
+
- fuseki-data:/fuseki
|
|
9
|
+
environment:
|
|
10
|
+
ADMIN_PASSWORD: ${FUSEKI_ADMIN_PASSWORD:-{{cs.FUSEKI_ADMIN_PASSWORD}}}
|
|
11
|
+
FUSEKI_DATASET_1: ${FUSEKI_DATASET:-{{cs.FUSEKI_DATASET}}}
|
|
12
|
+
TDB: '2'
|
|
13
|
+
ports:
|
|
14
|
+
- '${FUSEKI_PORT:-{{cs.FUSEKI_PORT}}}:3030'
|
|
15
|
+
networks:
|
|
16
|
+
- devnet
|
|
17
|
+
healthcheck:
|
|
18
|
+
test: ['CMD-SHELL', 'curl -sf http://localhost:3030/$/ping || exit 1']
|
|
19
|
+
interval: 10s
|
|
20
|
+
timeout: 5s
|
|
21
|
+
retries: 5
|
|
22
|
+
start_period: 20s
|
|
23
|
+
|
|
24
|
+
volumes:
|
|
25
|
+
fuseki-data:
|
|
26
|
+
|
|
27
|
+
networks:
|
|
28
|
+
devnet:
|
|
29
|
+
name: devnet
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
id: fuseki
|
|
2
|
+
name: Apache Jena Fuseki
|
|
3
|
+
description: SPARQL 1.1 server and triplestore backed by Apache Jena TDB
|
|
4
|
+
category: database
|
|
5
|
+
supports:
|
|
6
|
+
- compose
|
|
7
|
+
requires: []
|
|
8
|
+
suggests:
|
|
9
|
+
- java
|
|
10
|
+
- python
|
|
11
|
+
- nodejs
|
|
12
|
+
conflicts: []
|
|
13
|
+
serviceOrder: 0
|
|
14
|
+
tags:
|
|
15
|
+
- database
|
|
16
|
+
- rdf
|
|
17
|
+
- sparql
|
|
18
|
+
- triplestore
|
|
19
|
+
- semantic-web
|
|
20
|
+
- linked-data
|
|
21
|
+
- jena
|
|
22
|
+
ports:
|
|
23
|
+
- port: 3030
|
|
24
|
+
service: fuseki
|
|
25
|
+
protocol: http
|
|
26
|
+
description: Fuseki SPARQL server and admin UI
|
|
27
|
+
path: /
|
|
28
|
+
onAutoForward: openBrowser
|
|
29
|
+
parameters:
|
|
30
|
+
FUSEKI_VERSION:
|
|
31
|
+
description: Apache Jena Fuseki image version tag
|
|
32
|
+
default: latest
|
|
33
|
+
FUSEKI_PORT:
|
|
34
|
+
description: Host port mapped to Fuseki (3030 inside container)
|
|
35
|
+
default: '3030'
|
|
36
|
+
FUSEKI_ADMIN_PASSWORD:
|
|
37
|
+
description: Fuseki admin user password
|
|
38
|
+
default: admin
|
|
39
|
+
sensitive: true
|
|
40
|
+
FUSEKI_DATASET:
|
|
41
|
+
description: Name of the default dataset to create on first start
|
|
42
|
+
default: ds
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Verification script for Apache Jena Fuseki overlay
|
|
3
|
+
# Confirms Fuseki is running and responding to requests
|
|
4
|
+
|
|
5
|
+
set -e
|
|
6
|
+
|
|
7
|
+
FUSEKI_HOST="${FUSEKI_HOST:-fuseki}"
|
|
8
|
+
FUSEKI_PORT="${FUSEKI_PORT:-3030}"
|
|
9
|
+
FUSEKI_URL="http://${FUSEKI_HOST}:${FUSEKI_PORT}"
|
|
10
|
+
|
|
11
|
+
echo "Verifying Apache Jena Fuseki overlay..."
|
|
12
|
+
echo ""
|
|
13
|
+
|
|
14
|
+
# Check curl is available
|
|
15
|
+
echo "1. Checking curl availability..."
|
|
16
|
+
if command -v curl &> /dev/null; then
|
|
17
|
+
echo " curl found"
|
|
18
|
+
else
|
|
19
|
+
echo " curl not found - cannot verify Fuseki service"
|
|
20
|
+
exit 1
|
|
21
|
+
fi
|
|
22
|
+
|
|
23
|
+
# Check Fuseki ping endpoint
|
|
24
|
+
echo ""
|
|
25
|
+
echo "2. Checking Fuseki service at ${FUSEKI_URL}/\$/ping..."
|
|
26
|
+
FUSEKI_READY=false
|
|
27
|
+
for i in {1..15}; do
|
|
28
|
+
if curl -sf "${FUSEKI_URL}/\$/ping" &> /dev/null; then
|
|
29
|
+
echo " Fuseki service is ready"
|
|
30
|
+
FUSEKI_READY=true
|
|
31
|
+
break
|
|
32
|
+
fi
|
|
33
|
+
sleep 2
|
|
34
|
+
done
|
|
35
|
+
|
|
36
|
+
if [ "$FUSEKI_READY" = false ]; then
|
|
37
|
+
echo " Fuseki service not ready after 30 seconds"
|
|
38
|
+
exit 1
|
|
39
|
+
fi
|
|
40
|
+
|
|
41
|
+
# Check dataset exists
|
|
42
|
+
DATASET="${FUSEKI_DATASET:-ds}"
|
|
43
|
+
ADMIN_PASSWORD="${FUSEKI_ADMIN_PASSWORD:-admin}"
|
|
44
|
+
echo ""
|
|
45
|
+
echo "3. Checking dataset '${DATASET}' exists..."
|
|
46
|
+
HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
|
|
47
|
+
-u "admin:${ADMIN_PASSWORD}" \
|
|
48
|
+
"${FUSEKI_URL}/\$/datasets/${DATASET}")
|
|
49
|
+
|
|
50
|
+
if [ "$HTTP_STATUS" = "200" ]; then
|
|
51
|
+
echo " Dataset '${DATASET}' found"
|
|
52
|
+
else
|
|
53
|
+
echo " Dataset '${DATASET}' not found (HTTP ${HTTP_STATUS}) - it may still be initializing"
|
|
54
|
+
fi
|
|
55
|
+
|
|
56
|
+
echo ""
|
|
57
|
+
echo "Apache Jena Fuseki overlay verification complete"
|
|
58
|
+
echo "Admin UI: ${FUSEKI_URL}"
|