Skip to content

Commit 7583eb1

Browse files
authored
Feat/refine template (#13)
* feat: add dev mode * fix: proxy * feat: make secops nicer * prepare basics for components * k * feat: add components * k * k * k * k * k * k * k * k * kk * k * k * k * k * k * k * process_dbt_assets * k * k * k * k * k * k
1 parent c2f61f8 commit 7583eb1

39 files changed

Lines changed: 10380 additions & 11256 deletions

File tree

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Validation of template
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- 'pyproject.toml'
8+
- 'pixi.lock'
9+
- 'projects/**'
10+
pull_request:
11+
types: [opened, synchronize, reopened]
12+
branches: [ main ]
13+
paths:
14+
- 'pyproject.toml'
15+
- 'pixi.lock'
16+
- 'projects/**'
17+
workflow_dispatch:
18+
19+
concurrency:
20+
group: tutorial-main-${{ github.ref }}
21+
cancel-in-progress: true
22+
23+
jobs:
24+
validation:
25+
name: Validate tutorial
26+
runs-on: ubuntu-latest
27+
env:
28+
# dagster dbt needs to run in prepare_if_dev to parse the project
29+
DAGSTER_IS_DEV_CLI: "True"
30+
CATALOG_DB_USER: "dummy"
31+
CATALOG_DB_PASSWORD: "dummy"
32+
OBJECT_STORE_ROOT_USER: "dummy"
33+
OBJECT_STORE_ROOT_PASSWORD: "dummy"
34+
OBJECT_STORE_REGION: "dummy"
35+
OPENAI_API_KEY: "dummy"
36+
steps:
37+
- name: Checkout code
38+
uses: actions/checkout@v4
39+
40+
- uses: prefix-dev/setup-pixi@v0.9.0
41+
with:
42+
pixi-version: v0.55.0
43+
cache: true
44+
frozen: true
45+
46+
# Create an instance of the template
47+
- run: pixi run render-dev
48+
49+
# check the instance can start
50+
- run: cd rendered-template/local_data_stack/ && pixi run -e dev test
51+
52+
# possibly add further testing later

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.pixi/envs/
22
.pixi/solve-group-envs/
33
local_data_stack
4+
key.txt

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ Additionally included for secure handling of secrets:
3030
- sops
3131
- age
3232

33+
![](img/ducking-the-lake.png)
34+
3335
## usage
3436

3537
Prerequisites:
@@ -74,4 +76,11 @@ pixi run start-dev
7476
Post install:
7577
7678
- update the secrets in the `.env` files by executing: `openssl rand -base64 32` and setting a suitable secret
77-
- ensure the `.env.enc` can be created by following the instructions in [documentation/secops]
79+
- ensure the `.env.enc` can be created by following the instructions in [documentation/secops]
80+
81+
## Developing the template
82+
83+
To render an instance of the project:
84+
```bash
85+
pixi run render-dev
86+
```

img/ducking-the-lake.png

3.82 MB
Loading

pixi.lock

Lines changed: 1205 additions & 1489 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,10 @@ env = { RUST_LOG = "warn" }
3737
cmd = "pixi run -e template cruft create https://github.com/l-mds/local-data-stack.git"
3838
description = "Initialize template with cruft"
3939

40+
[tool.pixi.tasks.render-dev]
41+
cmd = "pixi run --frozen -e template cruft create . --no-input --overwrite-if-exists --output-dir rendered-template && ./scripts/handle-dev-secrets.sh"
42+
description = "locally render a development instance of the template"
43+
44+
[tool.pixi.tasks.render-dev-no-secrets]
45+
cmd = "pixi run --frozen -e template cruft create . --no-input --overwrite-if-exists --output-dir rendered-template"
46+
description = "locally render a development instance of the template; no secrets needed (for CI)"

scripts/handle-dev-secrets.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
cp key.txt rendered-template/local_data_stack/
4+
cd rendered-template/local_data_stack
5+
make secrets-decrypt
6+
cd ../../

{{ cookiecutter.project_slug }}/Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
# syntax=docker/dockerfile:1.10.0
2-
31
# for CUDA support ensure docker is nvidia-docker enabled!
4-
FROM ghcr.io/prefix-dev/pixi:0.41.1-bookworm AS builder_base
2+
FROM ghcr.io/prefix-dev/pixi:0.55.0-bookworm AS builder_base
53

64
FROM builder_base AS build
75
ENV DAGSTER_HOME=/opt/dagster/dagster_home/

{{ cookiecutter.project_slug }}/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ fmt-unsafe:
3535
.PHONY: lint
3636
## Ruff based flake8 style linting plus type checking via pyright
3737
lint:
38-
pixi run -e ci-validation lint
38+
pixi run -e dev lint
3939

4040

4141
.PHONY: test
4242
## Execute tests with coverage
4343
test:
44-
pixi run -e ci-validation test
44+
pixi run -e dev test
4545

4646

4747

{{ cookiecutter.project_slug }}/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pixi update
1212

1313

1414
# launch a shell
15-
pixi shell --frozen -e ci-validation
15+
pixi shell --frozen -e dev
1616
cd src/code_location_{{ cookiecutter.project_slug }}/code_location_{{ cookiecutter.project_slug }}_dbt/ && dbt deps
1717
cd ../../../
1818
```
@@ -23,11 +23,11 @@ set `DAGSTER_HOME` to have persistent logs
2323

2424
```bash
2525
# for a single code location
26-
pixi shell --frozen -e ci-validation
26+
pixi shell --frozen -e dev
2727

2828
dagster dev
2929
# alternatively:
30-
pixi run -e ci-validation start-dev
30+
pixi run -e dev start-dev
3131

3232

3333
dagster job list --location foo

0 commit comments

Comments
 (0)