Repository navigation
Dask Distributed: Basic remoting / serverless function example - #1676
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: Turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 👉 Get your free trial and get 200 agent minutes per Slack user (a $50 value). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ab575d7 to
734bc4b
Compare
6bcf8cc to
ca2a929
Compare
| # Pre-flight requests to fix Dask accounting. | ||
| docker compose run --rm --quiet-build --env="mode=ping" verify |
There was a problem hiding this comment.
Problem: When not invoking a request to this API first, the first task submitted is not recorded.
Action: Report this to Dask?
There was a problem hiding this comment.
We've reported the observation to the upstream project.
e6556e0 to
3e42a75
Compare
| export-to-deltalake: | ||
| build: | ||
| context: . | ||
| command: > | ||
| ctk --debug save | ||
| "crate://crate:crate@cratedb/sys/summits" | ||
| "file+deltalake:///var/delta/summits?mode=overwrite" | ||
| environment: | ||
| DASK_SCHEDULER_ADDRESS: "tcp://dask-scheduler:8786" | ||
| profiles: | ||
| - tasks |
There was a problem hiding this comment.
While everything else is merely boilerplate, this is the actual Python workload that is diverted to the Dask compute cluster within this demonstration scenario. The task is submitted to the Dask scheduler, which will schedule it onto a worker.
Of course, that will not work magically, but relevant preparations aren't big either:
| dask-scheduler: | ||
| build: | ||
| context: . | ||
| command: dask scheduler --dashboard | ||
| ports: | ||
| - "8786:8786" | ||
| - "8787:8787" | ||
| healthcheck: | ||
| test: ["CMD", "wget", "--quiet", "-O", "-", "http://localhost:8787/health"] | ||
| start_period: 3s | ||
| interval: 1.5s | ||
| retries: 30 | ||
| timeout: 30s | ||
|
|
||
| dask-worker: | ||
| build: | ||
| context: . | ||
| command: dask worker --dashboard --dashboard-address ":8789" | ||
| environment: | ||
| DASK_SCHEDULER_ADDRESS: "tcp://dask-scheduler:8786" | ||
| depends_on: | ||
| dask-scheduler: | ||
| condition: service_healthy | ||
| healthcheck: | ||
| test: ["CMD", "wget", "--quiet", "-O", "-", "http://localhost:8789/health"] | ||
| start_period: 3s | ||
| interval: 1.5s | ||
| retries: 30 | ||
| timeout: 30s |
There was a problem hiding this comment.
The Dask scheduler will receive tasks submitted by clients, and will schedule them onto Dask workers. That's it.
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
framework/dask-distributed/Dockerfile (1)
20-20:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winUse
COPYinstead ofADDforrequirements.txt.Line 20 should use
COPY;ADDis unnecessary here and triggers DL3020.Proposed fix
-ADD requirements.txt / +COPY requirements.txt /
🧹 Nitpick comments (2)
framework/dask-distributed/compose.yml (1)
55-56: ⚡ Quick winAvoid hardcoding credentials in the command URI.
Embedding credentials in-line creates secret-scanner noise and encourages insecure copy/paste patterns. Prefer injecting the source DSN via environment variable.
Proposed refactor
command: > ctk --debug save - "crate://crate:crate@cratedb/sys/summits" + "${CRATE_SOURCE_DSN:-crate://crate:crate@cratedb/sys/summits}" "file+deltalake:///var/delta/summits?mode=overwrite"framework/dask-distributed/Dockerfile (1)
1-3: Pin image digests to ensure reproducible builds across CI runs and architectures.Both
docker.io/daskdev/dask:latest-py3.13(line 3) andghcr.io/astral-sh/uv:latest(line 14) use floating tags that can resolve to different images over time. Use the formatIMAGE:TAG@sha256:MANIFEST_DIGESTinstead—obtain the digest viadocker manifest inspect IMAGE:TAG. This pins the exact multi-platform manifest, preventing unexpected behavior changes.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 2e216f55-c3ec-4623-a8ec-9642a12dc9d6
📒 Files selected for processing (7)
.github/dependabot.yml.github/workflows/framework-dask-distributed.ymlframework/dask-distributed/Dockerfileframework/dask-distributed/README.mdframework/dask-distributed/compose.ymlframework/dask-distributed/requirements.txtframework/dask-distributed/test.sh
✅ Files skipped from review due to trivial changes (4)
- framework/dask-distributed/requirements.txt
- framework/dask-distributed/README.md
- framework/dask-distributed/test.sh
- .github/dependabot.yml
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/workflows/framework-dask-distributed.yml
About
Demonstrate scheduling CTK I/O routines on Dask clusters, effectively including important details of remoting and serverless.
References