container-superposition 0.1.1 → 0.1.3
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/README.md +206 -1
- package/dist/scripts/init.js +235 -179
- package/dist/scripts/init.js.map +1 -1
- package/dist/tool/commands/doctor.d.ts +15 -0
- package/dist/tool/commands/doctor.d.ts.map +1 -0
- package/dist/tool/commands/doctor.js +862 -0
- package/dist/tool/commands/doctor.js.map +1 -0
- package/dist/tool/commands/explain.d.ts +13 -0
- package/dist/tool/commands/explain.d.ts.map +1 -0
- package/dist/tool/commands/explain.js +211 -0
- package/dist/tool/commands/explain.js.map +1 -0
- package/dist/tool/commands/list.d.ts +16 -0
- package/dist/tool/commands/list.d.ts.map +1 -0
- package/dist/tool/commands/list.js +121 -0
- package/dist/tool/commands/list.js.map +1 -0
- package/dist/tool/commands/plan.d.ts +16 -0
- package/dist/tool/commands/plan.d.ts.map +1 -0
- package/dist/tool/commands/plan.js +329 -0
- package/dist/tool/commands/plan.js.map +1 -0
- package/dist/tool/questionnaire/composer.d.ts +6 -1
- package/dist/tool/questionnaire/composer.d.ts.map +1 -1
- package/dist/tool/questionnaire/composer.js +300 -202
- package/dist/tool/questionnaire/composer.js.map +1 -1
- package/dist/tool/readme/markdown-parser.d.ts.map +1 -1
- package/dist/tool/readme/markdown-parser.js.map +1 -1
- package/dist/tool/readme/readme-generator.d.ts.map +1 -1
- package/dist/tool/readme/readme-generator.js +11 -6
- package/dist/tool/readme/readme-generator.js.map +1 -1
- package/dist/tool/schema/deployment-targets.d.ts +77 -0
- package/dist/tool/schema/deployment-targets.d.ts.map +1 -0
- package/dist/tool/schema/deployment-targets.js +91 -0
- package/dist/tool/schema/deployment-targets.js.map +1 -0
- package/dist/tool/schema/manifest-migrations.d.ts +51 -0
- package/dist/tool/schema/manifest-migrations.d.ts.map +1 -0
- package/dist/tool/schema/manifest-migrations.js +159 -0
- package/dist/tool/schema/manifest-migrations.js.map +1 -0
- package/dist/tool/schema/overlay-loader.d.ts +1 -1
- package/dist/tool/schema/overlay-loader.d.ts.map +1 -1
- package/dist/tool/schema/overlay-loader.js +42 -14
- package/dist/tool/schema/overlay-loader.js.map +1 -1
- package/dist/tool/schema/types.d.ts +44 -2
- package/dist/tool/schema/types.d.ts.map +1 -1
- package/dist/tool/utils/merge.d.ts +134 -0
- package/dist/tool/utils/merge.d.ts.map +1 -0
- package/dist/tool/utils/merge.js +277 -0
- package/dist/tool/utils/merge.js.map +1 -0
- package/dist/tool/utils/port-utils.d.ts +29 -0
- package/dist/tool/utils/port-utils.d.ts.map +1 -0
- package/dist/tool/utils/port-utils.js +128 -0
- package/dist/tool/utils/port-utils.js.map +1 -0
- package/dist/tool/utils/version.d.ts +9 -0
- package/dist/tool/utils/version.d.ts.map +1 -0
- package/dist/tool/utils/version.js +32 -0
- package/dist/tool/utils/version.js.map +1 -0
- package/docs/architecture.md +25 -21
- package/docs/deployment-targets.md +150 -0
- package/docs/discovery-commands.md +442 -0
- package/docs/merge-strategy.md +700 -0
- package/docs/minimal-and-editor.md +265 -0
- package/docs/overlay-imports.md +209 -0
- package/docs/overlay-manifest-refactoring.md +2 -2
- package/docs/overlay-metadata-archive.md +1 -1
- package/docs/overlays.md +91 -23
- package/docs/presets-architecture.md +3 -3
- package/docs/presets.md +1 -1
- package/docs/publishing.md +36 -35
- package/docs/team-workflow.md +540 -0
- package/overlays/.presets/data-engineering.yml +392 -0
- package/overlays/.presets/event-sourced-service.yml +262 -0
- package/overlays/.presets/frontend.yml +287 -0
- package/overlays/.presets/k8s-operator-dev.yml +462 -0
- package/overlays/.registry/README.md +1 -1
- package/overlays/.registry/deployment-targets.yml +54 -0
- package/overlays/.shared/README.md +43 -0
- package/overlays/.shared/compose/common-healthchecks.yml +38 -0
- package/overlays/.shared/otel/instrumentation.env +20 -0
- package/overlays/.shared/otel/otel-base-config.yaml +30 -0
- package/overlays/.shared/vscode/recommended-extensions.json +14 -0
- package/overlays/README.md +1 -1
- package/overlays/codex/overlay.yml +1 -0
- package/overlays/duckdb/README.md +274 -0
- package/overlays/duckdb/devcontainer.patch.json +10 -0
- package/overlays/duckdb/overlay.yml +17 -0
- package/overlays/duckdb/setup.sh +45 -0
- package/overlays/duckdb/verify.sh +32 -0
- package/overlays/git-helpers/overlay.yml +1 -0
- package/overlays/grafana/README.md +5 -5
- package/overlays/grafana/dashboard-provider.yml +1 -1
- package/overlays/grafana/docker-compose.yml +2 -2
- package/overlays/grafana/overlay.yml +6 -1
- package/overlays/jaeger/overlay.yml +16 -3
- package/overlays/jupyter/.env.example +6 -0
- package/overlays/jupyter/README.md +210 -0
- package/overlays/jupyter/devcontainer.patch.json +14 -0
- package/overlays/jupyter/docker-compose.yml +23 -0
- package/overlays/jupyter/overlay.yml +18 -0
- package/overlays/jupyter/verify.sh +35 -0
- package/overlays/kind/README.md +221 -0
- package/overlays/kind/devcontainer.patch.json +10 -0
- package/overlays/kind/overlay.yml +18 -0
- package/overlays/kind/setup.sh +43 -0
- package/overlays/kind/verify.sh +40 -0
- package/overlays/localstack/.env.example +6 -0
- package/overlays/localstack/README.md +188 -0
- package/overlays/localstack/devcontainer.patch.json +21 -0
- package/overlays/localstack/docker-compose.yml +25 -0
- package/overlays/localstack/overlay.yml +18 -0
- package/overlays/localstack/verify.sh +47 -0
- package/overlays/loki/overlay.yml +6 -1
- package/overlays/modern-cli-tools/overlay.yml +1 -0
- package/overlays/mongodb/overlay.yml +12 -2
- package/overlays/mysql/overlay.yml +12 -2
- package/overlays/nats/overlay.yml +12 -2
- package/overlays/openapi-tools/README.md +243 -0
- package/overlays/openapi-tools/devcontainer.patch.json +10 -0
- package/overlays/openapi-tools/overlay.yml +16 -0
- package/overlays/openapi-tools/setup.sh +45 -0
- package/overlays/openapi-tools/verify.sh +51 -0
- package/overlays/otel-collector/overlay.yml.example +26 -0
- package/overlays/postgres/overlay.yml +6 -1
- package/overlays/prometheus/overlay.yml +6 -1
- package/overlays/rabbitmq/overlay.yml +12 -2
- package/overlays/redis/overlay.yml +6 -1
- package/overlays/tilt/README.md +259 -0
- package/overlays/tilt/devcontainer.patch.json +17 -0
- package/overlays/tilt/overlay.yml +19 -0
- package/overlays/tilt/setup.sh +25 -0
- package/overlays/tilt/verify.sh +24 -0
- package/package.json +8 -6
- package/tool/README.md +12 -16
- package/tool/schema/overlay-manifest.schema.json +64 -4
- package/tool/schema/superposition-manifest.schema.json +104 -0
- /package/overlays/{presets → .presets}/docs-site.yml +0 -0
- /package/overlays/{presets → .presets}/fullstack.yml +0 -0
- /package/overlays/{presets → .presets}/microservice.yml +0 -0
- /package/overlays/{presets → .presets}/web-api.yml +0 -0
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
# DuckDB Overlay
|
|
2
|
+
|
|
3
|
+
In-process analytical database for OLAP workloads and data analysis.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **DuckDB CLI** - Command-line interface for interactive queries
|
|
8
|
+
- **In-process** - No separate server required, embedded database
|
|
9
|
+
- **OLAP optimized** - Columnar storage for analytical queries
|
|
10
|
+
- **SQL support** - Full ANSI SQL with extensions
|
|
11
|
+
- **Parquet/CSV support** - Direct querying of file formats
|
|
12
|
+
- **Python integration** - Works seamlessly with Python and pandas
|
|
13
|
+
|
|
14
|
+
## How It Works
|
|
15
|
+
|
|
16
|
+
This overlay installs the DuckDB CLI, an in-process analytical database designed for OLAP workloads. Unlike traditional databases, DuckDB runs embedded in your application without requiring a separate server.
|
|
17
|
+
|
|
18
|
+
**Suggested overlays:**
|
|
19
|
+
|
|
20
|
+
- `python` - For DuckDB Python API
|
|
21
|
+
- `jupyter` - Interactive data analysis
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
DuckDB CLI is installed automatically during devcontainer creation via `setup.sh`:
|
|
26
|
+
|
|
27
|
+
- Downloads DuckDB CLI for your architecture (amd64/aarch64)
|
|
28
|
+
- Installs to `/usr/local/bin/duckdb`
|
|
29
|
+
- Verifies installation with test query
|
|
30
|
+
|
|
31
|
+
## Common Commands
|
|
32
|
+
|
|
33
|
+
### Interactive Shell
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# Start DuckDB with in-memory database
|
|
37
|
+
duckdb
|
|
38
|
+
|
|
39
|
+
# Create/open persistent database
|
|
40
|
+
duckdb mydata.db
|
|
41
|
+
|
|
42
|
+
# Open database read-only
|
|
43
|
+
duckdb mydata.db -readonly
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Query Files
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# Query CSV file
|
|
50
|
+
duckdb -c "SELECT * FROM 'data.csv' LIMIT 10"
|
|
51
|
+
|
|
52
|
+
# Query Parquet file
|
|
53
|
+
duckdb -c "SELECT * FROM 'data.parquet' WHERE col > 100"
|
|
54
|
+
|
|
55
|
+
# Query JSON file
|
|
56
|
+
duckdb -c "SELECT * FROM read_json_auto('data.json')"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Create Tables
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# From CSV
|
|
63
|
+
CREATE TABLE sales AS SELECT * FROM 'sales.csv';
|
|
64
|
+
|
|
65
|
+
# From Parquet
|
|
66
|
+
CREATE TABLE events AS SELECT * FROM 'events.parquet';
|
|
67
|
+
|
|
68
|
+
# From query
|
|
69
|
+
CREATE TABLE summary AS
|
|
70
|
+
SELECT date, SUM(amount) as total
|
|
71
|
+
FROM sales
|
|
72
|
+
GROUP BY date;
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Export Results
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
# Export to CSV
|
|
79
|
+
COPY (SELECT * FROM sales) TO 'output.csv' (HEADER, DELIMITER ',');
|
|
80
|
+
|
|
81
|
+
# Export to Parquet
|
|
82
|
+
COPY sales TO 'output.parquet' (FORMAT PARQUET);
|
|
83
|
+
|
|
84
|
+
# Export to JSON
|
|
85
|
+
COPY (SELECT * FROM sales LIMIT 100) TO 'sample.json';
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Python Integration
|
|
89
|
+
|
|
90
|
+
Install DuckDB Python package:
|
|
91
|
+
|
|
92
|
+
```python
|
|
93
|
+
# In Python code or Jupyter notebook
|
|
94
|
+
!pip install duckdb
|
|
95
|
+
|
|
96
|
+
import duckdb
|
|
97
|
+
|
|
98
|
+
# Connect to database
|
|
99
|
+
con = duckdb.connect('mydata.db')
|
|
100
|
+
|
|
101
|
+
# Execute query
|
|
102
|
+
result = con.execute("SELECT * FROM sales WHERE amount > 100").fetchall()
|
|
103
|
+
|
|
104
|
+
# Query pandas DataFrame directly
|
|
105
|
+
import pandas as pd
|
|
106
|
+
df = pd.read_csv('data.csv')
|
|
107
|
+
result = con.execute("SELECT * FROM df WHERE col > 100").df()
|
|
108
|
+
|
|
109
|
+
# Close connection
|
|
110
|
+
con.close()
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Pandas Integration
|
|
114
|
+
|
|
115
|
+
```python
|
|
116
|
+
import duckdb
|
|
117
|
+
import pandas as pd
|
|
118
|
+
|
|
119
|
+
# Read CSV into DuckDB, query, get pandas DataFrame
|
|
120
|
+
df = duckdb.query("SELECT * FROM 'data.csv' WHERE col > 100").df()
|
|
121
|
+
|
|
122
|
+
# Query DataFrame with SQL
|
|
123
|
+
df2 = duckdb.query("SELECT col1, AVG(col2) FROM df GROUP BY col1").df()
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Use Cases
|
|
127
|
+
|
|
128
|
+
- **Data analysis** - Ad-hoc analysis of large datasets
|
|
129
|
+
- **ETL pipelines** - Transform data with SQL
|
|
130
|
+
- **Analytics** - OLAP queries on columnar data
|
|
131
|
+
- **Data science** - Integrate with Python/Jupyter workflows
|
|
132
|
+
- **Data exploration** - Quick insights from CSV/Parquet files
|
|
133
|
+
- **Embedded analytics** - In-app analytical queries
|
|
134
|
+
|
|
135
|
+
**Integrates well with:**
|
|
136
|
+
|
|
137
|
+
- `python` - DuckDB Python API (suggested)
|
|
138
|
+
- `jupyter` - Interactive data analysis (suggested)
|
|
139
|
+
- Node.js, .NET - DuckDB client libraries available
|
|
140
|
+
|
|
141
|
+
## SQL Examples
|
|
142
|
+
|
|
143
|
+
### Analytical Queries
|
|
144
|
+
|
|
145
|
+
```sql
|
|
146
|
+
-- Time series aggregation
|
|
147
|
+
SELECT
|
|
148
|
+
date_trunc('day', timestamp) as day,
|
|
149
|
+
COUNT(*) as events,
|
|
150
|
+
AVG(duration) as avg_duration
|
|
151
|
+
FROM events
|
|
152
|
+
WHERE timestamp > '2024-01-01'
|
|
153
|
+
GROUP BY day
|
|
154
|
+
ORDER BY day;
|
|
155
|
+
|
|
156
|
+
-- Window functions
|
|
157
|
+
SELECT
|
|
158
|
+
user_id,
|
|
159
|
+
event_time,
|
|
160
|
+
event_type,
|
|
161
|
+
ROW_NUMBER() OVER (PARTITION BY user_id ORDER BY event_time) as event_seq
|
|
162
|
+
FROM user_events;
|
|
163
|
+
|
|
164
|
+
-- Join multiple files
|
|
165
|
+
SELECT
|
|
166
|
+
u.name,
|
|
167
|
+
COUNT(o.id) as order_count,
|
|
168
|
+
SUM(o.amount) as total_spent
|
|
169
|
+
FROM 'users.csv' u
|
|
170
|
+
JOIN 'orders.parquet' o ON u.id = o.user_id
|
|
171
|
+
GROUP BY u.name
|
|
172
|
+
ORDER BY total_spent DESC;
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### File Formats
|
|
176
|
+
|
|
177
|
+
```sql
|
|
178
|
+
-- CSV with options
|
|
179
|
+
SELECT * FROM read_csv_auto('data.csv', header=true, delim='|');
|
|
180
|
+
|
|
181
|
+
-- Parquet with projection
|
|
182
|
+
SELECT col1, col2 FROM 'data.parquet' WHERE col3 > 100;
|
|
183
|
+
|
|
184
|
+
-- JSON with auto-detection
|
|
185
|
+
SELECT * FROM read_json_auto('data.json');
|
|
186
|
+
|
|
187
|
+
-- Excel files
|
|
188
|
+
INSTALL spatial;
|
|
189
|
+
LOAD spatial;
|
|
190
|
+
SELECT * FROM ST_Read('data.xlsx');
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Benefits vs PostgreSQL
|
|
194
|
+
|
|
195
|
+
| Feature | DuckDB | PostgreSQL |
|
|
196
|
+
| --------------------- | --------------------- | ----------------------- |
|
|
197
|
+
| **Use Case** | ✅ Analytics (OLAP) | ✅ Transactions (OLTP) |
|
|
198
|
+
| **Setup** | ✅ No server needed | ⚠️ Separate service |
|
|
199
|
+
| **File Queries** | ✅ Direct CSV/Parquet | ❌ Requires COPY |
|
|
200
|
+
| **Analytical Speed** | ✅ Very fast | ⚠️ Slower for analytics |
|
|
201
|
+
| **Concurrent Writes** | ⚠️ Limited | ✅ Excellent |
|
|
202
|
+
| **Data Size** | ✅ GBs-TBs | ✅ TBs+ |
|
|
203
|
+
|
|
204
|
+
**When to use DuckDB:**
|
|
205
|
+
|
|
206
|
+
- Analytical queries on read-heavy data
|
|
207
|
+
- Working with files (CSV, Parquet, JSON)
|
|
208
|
+
- Embedded analytics in applications
|
|
209
|
+
- Data science and exploration
|
|
210
|
+
|
|
211
|
+
**When to use PostgreSQL:**
|
|
212
|
+
|
|
213
|
+
- Transactional workloads (OLTP)
|
|
214
|
+
- Concurrent writes from multiple clients
|
|
215
|
+
- Need full ACID guarantees
|
|
216
|
+
- Large-scale production databases
|
|
217
|
+
|
|
218
|
+
## Troubleshooting
|
|
219
|
+
|
|
220
|
+
### Installation Fails
|
|
221
|
+
|
|
222
|
+
Check architecture is supported:
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
uname -m
|
|
226
|
+
# Should be x86_64 or aarch64/arm64
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### File Not Found
|
|
230
|
+
|
|
231
|
+
Ensure file paths are correct:
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
# Use absolute paths or paths relative to working directory
|
|
235
|
+
duckdb -c "SELECT * FROM '/absolute/path/data.csv'"
|
|
236
|
+
duckdb -c "SELECT * FROM './relative/path/data.csv'"
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Out of Memory
|
|
240
|
+
|
|
241
|
+
DuckDB uses memory-mapped files. For large datasets:
|
|
242
|
+
|
|
243
|
+
```sql
|
|
244
|
+
-- Limit memory usage
|
|
245
|
+
SET memory_limit='4GB';
|
|
246
|
+
|
|
247
|
+
-- Use temp directory
|
|
248
|
+
SET temp_directory='/tmp';
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### Slow Queries
|
|
252
|
+
|
|
253
|
+
DuckDB is optimized for analytics but:
|
|
254
|
+
|
|
255
|
+
```sql
|
|
256
|
+
-- Create indexes for point queries
|
|
257
|
+
CREATE INDEX idx_id ON sales(id);
|
|
258
|
+
|
|
259
|
+
-- Use columnar storage
|
|
260
|
+
COPY sales TO 'sales.parquet' (FORMAT PARQUET);
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
## References
|
|
264
|
+
|
|
265
|
+
- [DuckDB Documentation](https://duckdb.org/docs/)
|
|
266
|
+
- [DuckDB Python API](https://duckdb.org/docs/api/python/overview)
|
|
267
|
+
- [DuckDB SQL Reference](https://duckdb.org/docs/sql/introduction)
|
|
268
|
+
- [DuckDB File Formats](https://duckdb.org/docs/data/overview)
|
|
269
|
+
|
|
270
|
+
**Related Overlays:**
|
|
271
|
+
|
|
272
|
+
- `python` - DuckDB Python API (suggested)
|
|
273
|
+
- `jupyter` - Interactive analysis (suggested)
|
|
274
|
+
- `postgres` - Transactional database
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.base.schema.json",
|
|
3
|
+
"features": {
|
|
4
|
+
"./features/cross-distro-packages": {
|
|
5
|
+
"apt": "wget unzip",
|
|
6
|
+
"apk": "wget unzip"
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
"postCreateCommand": "bash .devcontainer/scripts/setup-duckdb.sh"
|
|
10
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
id: duckdb
|
|
2
|
+
name: DuckDB
|
|
3
|
+
description: In-process analytical database for OLAP workloads
|
|
4
|
+
category: database
|
|
5
|
+
supports: []
|
|
6
|
+
requires: []
|
|
7
|
+
suggests:
|
|
8
|
+
- python
|
|
9
|
+
- jupyter
|
|
10
|
+
conflicts: []
|
|
11
|
+
tags:
|
|
12
|
+
- database
|
|
13
|
+
- analytics
|
|
14
|
+
- sql
|
|
15
|
+
- duckdb
|
|
16
|
+
- olap
|
|
17
|
+
ports: []
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Setup script for DuckDB
|
|
3
|
+
|
|
4
|
+
set -e
|
|
5
|
+
|
|
6
|
+
echo "🔧 Setting up DuckDB..."
|
|
7
|
+
|
|
8
|
+
# Detect architecture
|
|
9
|
+
ARCH=$(uname -m)
|
|
10
|
+
case $ARCH in
|
|
11
|
+
x86_64)
|
|
12
|
+
DUCKDB_ARCH="amd64"
|
|
13
|
+
;;
|
|
14
|
+
aarch64|arm64)
|
|
15
|
+
DUCKDB_ARCH="aarch64"
|
|
16
|
+
;;
|
|
17
|
+
*)
|
|
18
|
+
echo "❌ Unsupported architecture: $ARCH"
|
|
19
|
+
exit 1
|
|
20
|
+
;;
|
|
21
|
+
esac
|
|
22
|
+
|
|
23
|
+
# Install DuckDB CLI
|
|
24
|
+
DUCKDB_VERSION="${DUCKDB_VERSION:-v1.0.0}"
|
|
25
|
+
echo "📦 Installing DuckDB CLI ${DUCKDB_VERSION}..."
|
|
26
|
+
|
|
27
|
+
wget -q "https://github.com/duckdb/duckdb/releases/download/${DUCKDB_VERSION}/duckdb_cli-linux-${DUCKDB_ARCH}.zip" -O /tmp/duckdb.zip
|
|
28
|
+
unzip -q /tmp/duckdb.zip -d /tmp/
|
|
29
|
+
chmod +x /tmp/duckdb
|
|
30
|
+
sudo mv /tmp/duckdb /usr/local/bin/duckdb
|
|
31
|
+
rm /tmp/duckdb.zip
|
|
32
|
+
|
|
33
|
+
# Verify installation
|
|
34
|
+
if command -v duckdb &> /dev/null; then
|
|
35
|
+
echo "✅ DuckDB CLI installed successfully"
|
|
36
|
+
duckdb --version
|
|
37
|
+
else
|
|
38
|
+
echo "❌ DuckDB CLI installation failed"
|
|
39
|
+
exit 1
|
|
40
|
+
fi
|
|
41
|
+
|
|
42
|
+
echo "✅ DuckDB setup complete"
|
|
43
|
+
echo ""
|
|
44
|
+
echo "ℹ️ To start DuckDB, run:"
|
|
45
|
+
echo " duckdb mydata.db"
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Verification script for DuckDB overlay
|
|
3
|
+
# Confirms DuckDB is installed
|
|
4
|
+
|
|
5
|
+
set -e
|
|
6
|
+
|
|
7
|
+
echo "🔍 Verifying DuckDB overlay..."
|
|
8
|
+
echo ""
|
|
9
|
+
|
|
10
|
+
# Check DuckDB CLI is installed
|
|
11
|
+
echo "1️⃣ Checking DuckDB CLI installation..."
|
|
12
|
+
if command -v duckdb &> /dev/null; then
|
|
13
|
+
duckdb --version
|
|
14
|
+
echo " ✅ DuckDB CLI is installed"
|
|
15
|
+
else
|
|
16
|
+
echo " ❌ DuckDB CLI is not installed"
|
|
17
|
+
exit 1
|
|
18
|
+
fi
|
|
19
|
+
|
|
20
|
+
# Test DuckDB with a simple query
|
|
21
|
+
echo ""
|
|
22
|
+
echo "2️⃣ Testing DuckDB with simple query..."
|
|
23
|
+
RESULT=$(echo "SELECT 'DuckDB is working!' as message;" | duckdb 2>&1 | grep -i "DuckDB is working" || true)
|
|
24
|
+
if [ -n "$RESULT" ]; then
|
|
25
|
+
echo " ✅ DuckDB query executed successfully"
|
|
26
|
+
else
|
|
27
|
+
echo " ❌ DuckDB query failed"
|
|
28
|
+
exit 1
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
echo ""
|
|
32
|
+
echo "✅ DuckDB overlay verification complete"
|
|
@@ -300,7 +300,7 @@ Access at: http://localhost:3000/dashboards
|
|
|
300
300
|
2. Click **Dashboard settings** (gear icon)
|
|
301
301
|
3. Click **JSON Model**
|
|
302
302
|
4. Copy JSON
|
|
303
|
-
5. Save to `.devcontainer/dashboards/my-dashboard.json`
|
|
303
|
+
5. Save to `.devcontainer/dashboards-grafana/my-dashboard.json`
|
|
304
304
|
6. Restart Grafana to load
|
|
305
305
|
|
|
306
306
|
**Option 2: Export from Grafana.com**
|
|
@@ -308,14 +308,14 @@ Access at: http://localhost:3000/dashboards
|
|
|
308
308
|
1. Browse https://grafana.com/grafana/dashboards/
|
|
309
309
|
2. Find dashboard (e.g., Node Exporter Full)
|
|
310
310
|
3. Download JSON
|
|
311
|
-
4. Save to `.devcontainer/dashboards/`
|
|
311
|
+
4. Save to `.devcontainer/dashboards-grafana/`
|
|
312
312
|
5. Restart Grafana
|
|
313
313
|
|
|
314
314
|
**Dashboard structure:**
|
|
315
315
|
|
|
316
316
|
```
|
|
317
317
|
.devcontainer/
|
|
318
|
-
├── dashboards/
|
|
318
|
+
├── dashboards-grafana/
|
|
319
319
|
│ ├── observability-overview.json
|
|
320
320
|
│ ├── my-custom-dashboard.json
|
|
321
321
|
│ └── node-exporter.json
|
|
@@ -376,13 +376,13 @@ docker exec tempo cat /etc/tempo/tempo-config.yaml
|
|
|
376
376
|
docker exec grafana ls /etc/grafana/provisioning/dashboards/
|
|
377
377
|
|
|
378
378
|
# Check dashboard files are present
|
|
379
|
-
docker exec grafana ls /etc/grafana/
|
|
379
|
+
docker exec grafana ls /etc/grafana/dashboards/*.json
|
|
380
380
|
|
|
381
381
|
# Check Grafana logs for errors
|
|
382
382
|
docker logs grafana | grep -i dashboard
|
|
383
383
|
|
|
384
384
|
# Validate JSON syntax
|
|
385
|
-
jq . .devcontainer/dashboards/my-dashboard.json
|
|
385
|
+
jq . .devcontainer/dashboards-grafana/my-dashboard.json
|
|
386
386
|
```
|
|
387
387
|
|
|
388
388
|
### Issue: Correlation Links Not Working
|
|
@@ -8,8 +8,8 @@ services:
|
|
|
8
8
|
- GF_USERS_ALLOW_SIGN_UP=false
|
|
9
9
|
volumes:
|
|
10
10
|
- ./grafana-datasources-grafana.yml:/etc/grafana/provisioning/datasources/datasources.yml
|
|
11
|
-
- ./dashboard-provider-grafana.yml:/etc/grafana/provisioning/dashboards/
|
|
12
|
-
- ./dashboards:/etc/grafana/
|
|
11
|
+
- ./dashboard-provider-grafana.yml:/etc/grafana/provisioning/dashboards/provider.yml
|
|
12
|
+
- ./dashboards-grafana:/etc/grafana/dashboards
|
|
13
13
|
- grafana_data:/var/lib/grafana
|
|
14
14
|
ports:
|
|
15
15
|
- '${GRAFANA_PORT:-3000}:3000'
|
|
@@ -13,7 +13,20 @@ tags:
|
|
|
13
13
|
- tracing
|
|
14
14
|
- jaeger
|
|
15
15
|
ports:
|
|
16
|
-
- 16686
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
- port: 16686
|
|
17
|
+
service: jaeger
|
|
18
|
+
protocol: http
|
|
19
|
+
description: Jaeger UI
|
|
20
|
+
path: /
|
|
21
|
+
onAutoForward: openBrowser
|
|
22
|
+
- port: 14250
|
|
23
|
+
service: jaeger
|
|
24
|
+
protocol: grpc
|
|
25
|
+
description: Jaeger gRPC receiver
|
|
26
|
+
onAutoForward: ignore
|
|
27
|
+
- port: 14268
|
|
28
|
+
service: jaeger
|
|
29
|
+
protocol: http
|
|
30
|
+
description: Jaeger HTTP receiver
|
|
31
|
+
onAutoForward: ignore
|
|
19
32
|
order: 1
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
# Jupyter Overlay
|
|
2
|
+
|
|
3
|
+
Jupyter notebook server for interactive computing and data science.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Jupyter Notebook/Lab** - Interactive computing environment
|
|
8
|
+
- **Python kernel** - Run Python code interactively
|
|
9
|
+
- **Persistent notebooks** - Work saved across container restarts
|
|
10
|
+
- **Volume mounting** - Access notebooks from host filesystem
|
|
11
|
+
- **No authentication** - Pre-configured for development use
|
|
12
|
+
- **Docker Compose service** - Runs as separate container
|
|
13
|
+
|
|
14
|
+
## How It Works
|
|
15
|
+
|
|
16
|
+
This overlay adds Jupyter as a Docker Compose service running in its own container. Jupyter is accessible from your development container and your browser via port 8888.
|
|
17
|
+
|
|
18
|
+
**Dependencies:**
|
|
19
|
+
|
|
20
|
+
- `python` (required) - Python runtime for notebooks
|
|
21
|
+
|
|
22
|
+
**Architecture:**
|
|
23
|
+
|
|
24
|
+
- Jupyter service runs on port 8888
|
|
25
|
+
- Notebooks stored in Docker volume (`jupyter-data`)
|
|
26
|
+
- Optional local directory mounting for notebooks
|
|
27
|
+
- JupyterLab interface enabled by default
|
|
28
|
+
|
|
29
|
+
## Configuration
|
|
30
|
+
|
|
31
|
+
### Environment Variables
|
|
32
|
+
|
|
33
|
+
The overlay includes a `.env.example` file. Copy it to `.env` and customize:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
cd .devcontainer
|
|
37
|
+
cp .env.example .env
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**Default values (.env.example):**
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# Jupyter Configuration
|
|
44
|
+
JUPYTER_VERSION=latest
|
|
45
|
+
JUPYTER_ENABLE_LAB=yes
|
|
46
|
+
JUPYTER_TOKEN=
|
|
47
|
+
JUPYTER_PORT=8888
|
|
48
|
+
JUPYTER_NOTEBOOKS_PATH=./notebooks
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Notebook Directory
|
|
52
|
+
|
|
53
|
+
By default, notebooks can be created in the Jupyter container. To use notebooks from your host:
|
|
54
|
+
|
|
55
|
+
1. Create a `notebooks` directory in your project root
|
|
56
|
+
2. Notebooks in this directory will be available at `/home/jovyan/notebooks` in Jupyter
|
|
57
|
+
|
|
58
|
+
### Authentication
|
|
59
|
+
|
|
60
|
+
By default, authentication is disabled for local development:
|
|
61
|
+
|
|
62
|
+
- No token required
|
|
63
|
+
- No password required
|
|
64
|
+
|
|
65
|
+
For production or shared environments, set `JUPYTER_TOKEN`:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
JUPYTER_TOKEN=your-secure-token
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Port Configuration
|
|
72
|
+
|
|
73
|
+
The default port (8888) can be changed via the `--port-offset` option:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
npm run init -- --port-offset 100 --stack compose --language python,jupyter
|
|
77
|
+
# Jupyter will be on port 8988
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Common Commands
|
|
81
|
+
|
|
82
|
+
### Accessing Jupyter
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
# Open in browser
|
|
86
|
+
http://localhost:8888
|
|
87
|
+
|
|
88
|
+
# Or use container hostname from dev container
|
|
89
|
+
curl http://jupyter:8888
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Notebook Management
|
|
93
|
+
|
|
94
|
+
Jupyter provides a web interface for all notebook operations:
|
|
95
|
+
|
|
96
|
+
- Create new notebooks
|
|
97
|
+
- Upload existing notebooks
|
|
98
|
+
- Download notebooks
|
|
99
|
+
- Organize in folders
|
|
100
|
+
- Run code cells
|
|
101
|
+
- Export to various formats (HTML, PDF, etc.)
|
|
102
|
+
|
|
103
|
+
### Using Python in Notebooks
|
|
104
|
+
|
|
105
|
+
```python
|
|
106
|
+
# Install packages
|
|
107
|
+
!pip install pandas numpy matplotlib seaborn
|
|
108
|
+
|
|
109
|
+
# Import and use
|
|
110
|
+
import pandas as pd
|
|
111
|
+
import numpy as np
|
|
112
|
+
import matplotlib.pyplot as plt
|
|
113
|
+
|
|
114
|
+
# Your analysis code
|
|
115
|
+
df = pd.read_csv('data.csv')
|
|
116
|
+
df.head()
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### JupyterLab Features
|
|
120
|
+
|
|
121
|
+
JupyterLab is enabled by default and provides:
|
|
122
|
+
|
|
123
|
+
- Multiple tabs
|
|
124
|
+
- File browser
|
|
125
|
+
- Terminal
|
|
126
|
+
- Text editor
|
|
127
|
+
- Markdown preview
|
|
128
|
+
- Extension manager
|
|
129
|
+
|
|
130
|
+
## Use Cases
|
|
131
|
+
|
|
132
|
+
- **Data analysis** - Explore and visualize datasets
|
|
133
|
+
- **Machine learning** - Develop and train models
|
|
134
|
+
- **Scientific computing** - Mathematical and statistical analysis
|
|
135
|
+
- **Documentation** - Create executable documentation
|
|
136
|
+
- **Teaching** - Interactive tutorials and examples
|
|
137
|
+
- **Prototyping** - Quick experimentation with code
|
|
138
|
+
|
|
139
|
+
**Integrates well with:**
|
|
140
|
+
|
|
141
|
+
- `python` - Python runtime (required)
|
|
142
|
+
- `postgres` - Database for data analysis
|
|
143
|
+
- `duckdb` - Analytics database
|
|
144
|
+
- `redis` - Caching and data structures
|
|
145
|
+
|
|
146
|
+
## Available Images
|
|
147
|
+
|
|
148
|
+
Jupyter provides different base images:
|
|
149
|
+
|
|
150
|
+
- `jupyter/minimal-notebook` - Minimal Jupyter with Python (default)
|
|
151
|
+
- `jupyter/scipy-notebook` - Scientific Python stack
|
|
152
|
+
- `jupyter/datascience-notebook` - Julia, Python, R
|
|
153
|
+
- `jupyter/tensorflow-notebook` - TensorFlow and Keras
|
|
154
|
+
- `jupyter/pyspark-notebook` - PySpark
|
|
155
|
+
|
|
156
|
+
Change via `JUPYTER_VERSION`:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
JUPYTER_VERSION=scipy-notebook
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Troubleshooting
|
|
163
|
+
|
|
164
|
+
### Jupyter Not Starting
|
|
165
|
+
|
|
166
|
+
Check service logs:
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
docker-compose logs jupyter
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Port Already in Use
|
|
173
|
+
|
|
174
|
+
Change the port in `.env`:
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
JUPYTER_PORT=8889
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Or use port offset when generating.
|
|
181
|
+
|
|
182
|
+
### Notebooks Not Persisting
|
|
183
|
+
|
|
184
|
+
Ensure you're saving notebooks to the mounted volume or directory:
|
|
185
|
+
|
|
186
|
+
- `/home/jovyan/work` - Persistent volume
|
|
187
|
+
- `/home/jovyan/notebooks` - Mounted from host
|
|
188
|
+
|
|
189
|
+
### Package Installation
|
|
190
|
+
|
|
191
|
+
Packages installed with `!pip install` are lost on container restart. To persist:
|
|
192
|
+
|
|
193
|
+
1. Create a `requirements.txt` in your notebooks directory
|
|
194
|
+
2. Install in a notebook: `!pip install -r /home/jovyan/notebooks/requirements.txt`
|
|
195
|
+
|
|
196
|
+
Or extend the Jupyter image with a custom Dockerfile.
|
|
197
|
+
|
|
198
|
+
## References
|
|
199
|
+
|
|
200
|
+
- [Jupyter Documentation](https://jupyter.org/documentation)
|
|
201
|
+
- [JupyterLab Documentation](https://jupyterlab.readthedocs.io/)
|
|
202
|
+
- [Jupyter Docker Stacks](https://jupyter-docker-stacks.readthedocs.io/)
|
|
203
|
+
- [Jupyter Notebook Basics](https://jupyter-notebook.readthedocs.io/en/stable/notebook.html)
|
|
204
|
+
|
|
205
|
+
**Related Overlays:**
|
|
206
|
+
|
|
207
|
+
- `python` - Python runtime (required)
|
|
208
|
+
- `postgres` - Database for analysis
|
|
209
|
+
- `duckdb` - Analytics database
|
|
210
|
+
- `redis` - Data structures
|