|
| 1 | +services: |
| 2 | + |
| 3 | + cratedb: |
| 4 | + image: docker.io/crate/crate:${CRATEDB_VERSION:-latest} |
| 5 | + command: > |
| 6 | + crate |
| 7 | + '-Cdiscovery.type=single-node' |
| 8 | + '-Cstats.enabled=true' |
| 9 | + '-Ccluster.routing.allocation.disk.threshold_enabled=false' |
| 10 | + ports: |
| 11 | + - "4200:4200" |
| 12 | + - "5432:5432" |
| 13 | + healthcheck: |
| 14 | + test: ["CMD", "curl", "--fail", "http://localhost:4200"] |
| 15 | + start_period: 3s |
| 16 | + interval: 1.5s |
| 17 | + retries: 30 |
| 18 | + timeout: 30s |
| 19 | + |
| 20 | + dask-scheduler: |
| 21 | + build: |
| 22 | + context: . |
| 23 | + command: dask scheduler --dashboard |
| 24 | + ports: |
| 25 | + - "8786:8786" |
| 26 | + - "8787:8787" |
| 27 | + healthcheck: |
| 28 | + test: ["CMD", "wget", "--quiet", "-O", "-", "http://localhost:8787/health"] |
| 29 | + start_period: 3s |
| 30 | + interval: 1.5s |
| 31 | + retries: 30 |
| 32 | + timeout: 30s |
| 33 | + |
| 34 | + dask-worker: |
| 35 | + build: |
| 36 | + context: . |
| 37 | + command: dask worker --dashboard --dashboard-address ":8789" |
| 38 | + environment: |
| 39 | + - DASK_SCHEDULER_ADDRESS=tcp://dask-scheduler:8786 |
| 40 | + depends_on: |
| 41 | + - dask-scheduler |
| 42 | + healthcheck: |
| 43 | + test: ["CMD", "wget", "--quiet", "-O", "-", "http://localhost:8789/health"] |
| 44 | + start_period: 3s |
| 45 | + interval: 1.5s |
| 46 | + retries: 30 |
| 47 | + timeout: 30s |
| 48 | + |
| 49 | + export-to-deltalake: |
| 50 | + build: |
| 51 | + context: . |
| 52 | + command: > |
| 53 | + ctk --debug save |
| 54 | + "crate://crate:crate@cratedb/sys/summits" |
| 55 | + "file+deltalake:///var/delta/summits?mode=overwrite" |
| 56 | + environment: |
| 57 | + - DASK_SCHEDULER_ADDRESS=tcp://dask-scheduler:8786 |
| 58 | + depends_on: |
| 59 | + cratedb: |
| 60 | + condition: service_healthy |
| 61 | + dask-scheduler: |
| 62 | + condition: service_healthy |
| 63 | + dask-worker: |
| 64 | + condition: service_healthy |
| 65 | + profiles: |
| 66 | + - tasks |
| 67 | + |
| 68 | + verify: |
| 69 | + build: |
| 70 | + context: . |
| 71 | + entrypoint: |
| 72 | + - /bin/sh |
| 73 | + - '-c' |
| 74 | + command: |
| 75 | + - | |
| 76 | + python - <<EOF |
| 77 | + import os |
| 78 | + import sys |
| 79 | + from dask.distributed import Client |
| 80 | + with Client() as client: |
| 81 | + tasks = client.get_task_stream() |
| 82 | + if not tasks: |
| 83 | + if os.getenv("mode") == "ignore-empty": |
| 84 | + sys.exit(0) |
| 85 | + raise RuntimeError("No tasks have been submitted") |
| 86 | + task = tasks[-1] |
| 87 | + assert task["key"].startswith("save_table"), f"Task has wrong key: {task['key']}" |
| 88 | + assert task["status"] == "OK", f"Task status not OK: {task['status']}" |
| 89 | + print("SUCCESS") |
| 90 | + EOF |
| 91 | + environment: |
| 92 | + - DASK_SCHEDULER_ADDRESS=tcp://dask-scheduler:8786 |
| 93 | + profiles: |
| 94 | + - tasks |
0 commit comments