-
Notifications
You must be signed in to change notification settings - Fork 11
Moving away from dbt core operation blocks #231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
2ba8b45
new flows to run dbt tasks from the secret block using dbt runner
Ishankoradia b484c2e
updates
Ishankoradia bd2f9f7
updates
Ishankoradia 7f68bae
updates
Ishankoradia 8f329d9
updates
Ishankoradia 5e920d8
updates
Ishankoradia 0061878
updates; edr changes
Ishankoradia 2458d95
updates
Ishankoradia 215a95d
updates edr stuff
Ishankoradia ababda9
updates
Ishankoradia b0ad04b
updates
Ishankoradia 66733c1
updates
Ishankoradia 4af890a
updates
Ishankoradia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # Define version as build arg with default | ||
| ARG PREFECT_VERSION=3.6.29 | ||
|
|
||
| FROM prefecthq/prefect:${PREFECT_VERSION}-python3.10-kubernetes | ||
|
|
||
| # Shared volume mount point for client dbt project directories. | ||
| ARG CLIENTDBT_ROOT="/mnt/appdata/clientdbts" | ||
| ENV CLIENTDBT_ROOT=${CLIENTDBT_ROOT} | ||
|
|
||
| # System deps — git is needed for the prefect-airbyte git dep pinned in pyproject.toml. | ||
| RUN apt-get update && apt-get install -y \ | ||
| git \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # Install all runtime deps from prefect-proxy's pyproject.toml + uv.lock. Single | ||
| # source of truth — bumping dbt-core / prefect-dbt / adapters in pyproject flows | ||
| # into the image on the next build with no Dockerfile edit. uv exports the | ||
| # frozen lockfile to requirements.txt so pip installs the resolved-and-locked | ||
| # set into the base image's system Python. | ||
| # | ||
| # Build context is prefect-proxy/ (the parent of docker/) so pyproject.toml | ||
| # and uv.lock are reachable — see docker/README.md. | ||
| COPY pyproject.toml uv.lock ./ | ||
| RUN pip install --no-cache-dir uv \ | ||
| && uv export --no-dev --frozen --no-hashes --format requirements-txt --output-file /tmp/req.txt \ | ||
| && pip install --no-cache-dir -r /tmp/req.txt \ | ||
| && rm /tmp/req.txt pyproject.toml uv.lock | ||
|
|
||
| # Client dbt projects get mounted here at runtime. | ||
| RUN mkdir -p ${CLIENTDBT_ROOT} && mkdir -p /root/.dbt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| # Prefect Job Runner Docker Image | ||
|
|
||
| Docker image for running Dalgo Prefect flows in EKS. | ||
|
|
||
| ## What is this? | ||
|
|
||
| This image runs Dalgo Prefect flows on EKS. It installs all runtime deps | ||
| (prefect, prefect-dbt, prefect-shell, prefect-airbyte, dbt-core + adapters, | ||
| elementary-data, etc.) directly from `prefect-proxy/pyproject.toml` + `uv.lock` | ||
| — **single source of truth**. Bumping any dependency in pyproject flows into | ||
| the image on the next build with no Dockerfile edit. | ||
|
|
||
| `PrefectDbtRunner` uses `dbt-core` from the base env's Python — no per-version | ||
| dbt venvs baked into the image. | ||
|
|
||
| ## How to Build | ||
|
|
||
| ### Build Arguments | ||
|
|
||
| - `PREFECT_VERSION`: drives the base image tag (default: `3.6.29`). Must match | ||
| the `prefect==` pin in `pyproject.toml` — otherwise pip will upgrade prefect | ||
| on top of the base image. | ||
| - `CLIENTDBT_ROOT`: mount path for client dbt projects (default: | ||
| `/mnt/appdata/clientdbts`). | ||
|
|
||
| ### Image tags | ||
|
|
||
| Tags track the Prefect upgrade: | ||
|
|
||
| - `0.1` → Prefect 3.1.15 | ||
| - `0.2` → Prefect 3.6.29 | ||
|
|
||
| ### Environment-Specific Builds | ||
|
|
||
| Dalgo's EKS runs on ARM nodes — build for `linux/arm64` for prod, `linux/amd64` | ||
| for local x86 testing. | ||
|
|
||
| **Build context is `prefect-proxy/`** (the parent of `docker/`) so | ||
| `pyproject.toml` and `uv.lock` are reachable. | ||
|
|
||
| ```bash | ||
| # From the prefect-proxy directory | ||
| cd /path/to/prefect-proxy | ||
|
|
||
| # Prod build (EKS, ARM) | ||
| docker build --platform linux/arm64 -f docker/Dockerfile.job-runner \ | ||
| --build-arg PREFECT_VERSION=3.6.29 \ | ||
| -t tech4dev/prefect-eks-job-runner:0.2 . | ||
|
|
||
| # Local x86 test build | ||
| docker build --platform linux/amd64 -f docker/Dockerfile.job-runner \ | ||
| --build-arg PREFECT_VERSION=3.6.29 \ | ||
| -t tech4dev/prefect-eks-job-runner:0.2-amd64 . | ||
|
|
||
| # Multi-platform build + push (single tag, both arches) | ||
| docker buildx build --platform linux/arm64,linux/amd64 \ | ||
| -f docker/Dockerfile.job-runner \ | ||
| --build-arg PREFECT_VERSION=3.6.29 \ | ||
| -t tech4dev/prefect-eks-job-runner:0.2 \ | ||
| --push . | ||
|
|
||
| # Build with a custom shared-volume mount point | ||
| docker build --platform linux/arm64 -f docker/Dockerfile.job-runner \ | ||
| --build-arg PREFECT_VERSION=3.6.29 \ | ||
| --build-arg CLIENTDBT_ROOT=/dev/client/dbt \ | ||
| -t tech4dev/prefect-eks-job-runner:<tag> . | ||
| ``` | ||
|
|
||
| Sanity check the version pins inside a built image: | ||
| ```bash | ||
| docker run --rm --platform linux/arm64 tech4dev/prefect-eks-job-runner:0.2 python -c " | ||
| import dbt.version, importlib.metadata as m | ||
| print('dbt-core: ', dbt.version.__version__) | ||
| print('dbt-postgres: ', m.version('dbt-postgres')) | ||
| print('dbt-bigquery: ', m.version('dbt-bigquery')) | ||
| " | ||
| ``` | ||
| Values must match the pins in `prefect-proxy/pyproject.toml`. If they drift, | ||
| the lockfile export or install step isn't taking. | ||
|
|
||
| ## Usage | ||
|
|
||
| Set this image in your EKS work pool configuration. Existing deployment | ||
| parameters work unchanged since the directory structure | ||
| (`/mnt/appdata/clientdbts/`) is preserved. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Reject whitespace-only entrypoints.
A value such as
" "passes validation and overwrites a deployment with an unusable entrypoint.Proposed fix
entrypoint = payload.get("entrypoint") if isinstance(payload, dict) else None -if not isinstance(entrypoint, str) or not entrypoint: +if not isinstance(entrypoint, str) or not entrypoint.strip(): raise HTTPException(status_code=400, detail="entrypoint (string) is required") +entrypoint = entrypoint.strip()📝 Committable suggestion
🤖 Prompt for AI Agents