|
6 | 6 | weight: 20 |
7 | 7 | --- |
8 | 8 |
|
9 | | -> Funnel on Kubernetes is in active development and may involve frequent updates |
| 9 | +!!! warning |
| 10 | + Funnel on Kubernetes is in active development and may involve frequent updates 🚧 |
10 | 11 |
|
11 | | -# Quick Start |
| 12 | +# Kubernetes |
12 | 13 |
|
13 | | -## 1. Deploying with Helm |
| 14 | +## 1. Add Helm Repo |
14 | 15 |
|
15 | | -```sh |
16 | | -helm repo add ohsu https://ohsu-comp-bio.github.io/helm-charts |
17 | | -helm repo update |
18 | | -helm upgrade --install ohsu funnel |
19 | | -``` |
20 | | - |
21 | | -## Alternative: Deploying with `kubectl` ⚙️" |
22 | | - |
23 | | -### 1. Create a Service: |
24 | | - |
25 | | -Deploy it: |
| 16 | +!!! note |
| 17 | + See Funnel's [Helm Charts](https://github.com/calypr/helm-charts/tree/main/charts/funnel) for the latest configuration options |
26 | 18 |
|
27 | 19 | ```sh |
28 | | -kubectl apply -f funnel-service.yml |
29 | | -``` |
30 | | - |
31 | | -### 2. Create Funnel config files |
32 | | - |
33 | | -> *[funnel-server.yaml](https://github.com/ohsu-comp-bio/funnel/blob/develop/deployments/kubernetes/funnel-server.yaml)* |
34 | | -
|
35 | | -> *[funnel-worker.yaml](https://github.com/ohsu-comp-bio/funnel/blob/develop/deployments/kubernetes/funnel-worker.yaml)* |
| 20 | +helm repo add calypr https://calypr.org/helm-charts |
36 | 21 |
|
37 | | -Get the clusterIP: |
| 22 | +helm repo update calypr |
38 | 23 |
|
39 | | -```sh |
40 | | -{% raw %} |
41 | | -export HOSTNAME=$(kubectl get services funnel --output=jsonpath='{.spec.clusterIP}') |
42 | | - |
43 | | -sed -i "s|\${HOSTNAME}|${HOSTNAME}|g" funnel-worker.yaml |
44 | | -{% endraw %} |
| 24 | +helm search repo calypr/funnel |
45 | 25 | ``` |
46 | 26 |
|
47 | | -### 3. Create a ConfigMap |
| 27 | +## 2. Deploy Funnel |
48 | 28 |
|
49 | 29 | ```sh |
50 | | -kubectl create configmap funnel-config --from-file=funnel-server.yaml --from-file=funnel-worker.yaml |
51 | | -``` |
52 | | - |
53 | | -### 4. Create a Service Account for Funnel |
54 | | - |
55 | | -Define a Role and RoleBinding: |
| 30 | +helm upgrade --install funnel calypr/funnel |
56 | 31 |
|
57 | | -> *[role.yml](https://github.com/ohsu-comp-bio/funnel/blob/develop/deployments/kubernetes/role.yml)* |
| 32 | +kubectl rollout status deployment/funnel-server |
58 | 33 |
|
59 | | -> *[role_binding.yml](https://github.com/ohsu-comp-bio/funnel/blob/develop/deployments/kubernetes/role_binding.yml)* |
60 | | -
|
61 | | -```sh |
62 | | -kubectl create serviceaccount funnel-sa --namespace default |
63 | | -kubectl apply -f role.yml |
64 | | -kubectl apply -f role_binding.yml |
| 34 | +kubectl get deployments |
| 35 | +# NAME READY STATUS |
| 36 | +# funnel-server 1/1 Running |
65 | 37 | ``` |
66 | 38 |
|
67 | | -### 5. Create a Persistent Volume Claim |
68 | | - |
69 | | -> *[funnel-storage-pvc.yml](https://github.com/ohsu-comp-bio/funnel/blob/develop/deployments/kubernetes/funnel-storage-pvc.yml)* |
| 39 | +## 4. Port-Forward for Local Access |
70 | 40 |
|
71 | 41 | ```sh |
72 | | -kubectl apply -f funnel-storage-pvc.yml |
73 | | -``` |
| 42 | +kubectl port-forward svc/funnel 8000:8000 |
74 | 43 |
|
75 | | -### 6. Create a Deployment |
76 | | - |
77 | | -> *[funnel-deployment.yml](https://github.com/ohsu-comp-bio/funnel/blob/develop/deployments/kubernetes/funnel-deployment.yml)* |
78 | | -
|
79 | | -```sh |
80 | | -kubectl apply -f funnel-deployment.yml |
81 | | -``` |
82 | | - |
83 | | -{% raw %}{{< /details >}}{% endraw %} |
84 | | - |
85 | | -# 2. Proxy the Service for local testing |
86 | | - |
87 | | -```sh |
88 | | -kubectl port-forward service/funnel 8000:8000 |
89 | | -``` |
90 | | - |
91 | | -Now the funnel server can be accessed as if it were running locally. This can be verified by listing all tasks, which will return an empty JSON list: |
92 | | - |
93 | | -```sh |
94 | 44 | funnel task list |
95 | 45 | # {} |
96 | 46 | ``` |
97 | 47 |
|
98 | | -A task can then be submitted following the [standard workflow](../tasks.md): |
| 48 | +## 4. Submit Example Task |
99 | 49 |
|
100 | 50 | ```sh |
101 | 51 | funnel examples hello-world > hello-world.json |
102 | 52 |
|
103 | 53 | funnel task create hello-world.json |
104 | 54 | # <Task ID> |
| 55 | + |
| 56 | +funnel task get <Task ID> --view MINIMAL |
| 57 | +# { "id": "...", "state": "COMPLETE" } |
105 | 58 | ``` |
106 | 59 |
|
107 | 60 | # Storage Architecture |
108 | 61 |
|
109 | | -<a href="https://www.figma.com/board/bzgv8kVL2QKESU3Sqn7S1a/Funnel-%2B-Gen3?node-id=2-1059&t=9bcuG0bMAcxBLcRD-1"> |
110 | | - <img title="K8s Storage" src="/img/k8s-pvc.png" /> |
111 | | -</a> |
| 62 | +Funnel uses the [AWS S3 CSI Driver](https://github.com/awslabs/mountpoint-s3-csi-driver) to provision a per-task PersistentVolume (PV) and PersistentVolumeClaim (PVC) backed by S3. This gives Worker and Executor pods `ReadWriteMany` access across nodes without requiring them to co-schedule. |
| 63 | + |
| 64 | +```mermaid |
| 65 | +sequenceDiagram |
| 66 | + participant Server as Funnel Server |
| 67 | + participant K8s as Kubernetes API |
| 68 | + participant CSI as S3 CSI Driver |
| 69 | + participant Worker as Worker Pod (Node A) |
| 70 | + participant Executor as Executor Pod (Node B) |
| 71 | + participant S3 as S3 Bucket |
| 72 | +
|
| 73 | + Server->>K8s: Create PV + PVC (s3://bucket/) |
| 74 | + K8s->>CSI: Mount bucket → funnel-worker-pv-<taskID> |
| 75 | + Server->>Worker: Launch Worker Job |
| 76 | + Worker->>S3: DownloadInputs (GenericS3) |
| 77 | + Worker->>Executor: Launch Executor Job (PVC subPath mount) |
| 78 | + Executor->>Executor: Run task command |
| 79 | + Executor-->>Worker: Task complete |
| 80 | + Worker->>S3: UploadOutputs (GenericS3) |
| 81 | + Worker->>K8s: Delete PVC + PV |
| 82 | + Worker->>Server: Report COMPLETE |
| 83 | +``` |
112 | 84 |
|
113 | 85 | # Additional Resources 📚 |
114 | 86 |
|
115 | | -- [Helm Repo](https://ohsu-comp-bio.github.io/helm-charts) |
116 | | - |
| 87 | +- [Helm Repo](https://calypr.org/helm-charts) |
117 | 88 | - [Helm Repo Source](https://github.com/ohsu-comp-bio/helm-charts) |
118 | | - |
119 | | -- [Helm Charts](https://github.com/ohsu-comp-bio/funnel/tree/develop/deployments/kubernetes/helm) |
120 | | - |
| 89 | +- [Helm Chart values reference](https://github.com/ohsu-comp-bio/helm-charts/tree/main/charts/funnel) |
| 90 | +- [AWS S3 CSI Driver](https://github.com/awslabs/mountpoint-s3-csi-driver) |
121 | 91 | - [The Chart Best Practices Guide](https://helm.sh/docs/chart_best_practices/) |
| 92 | +- [GitHub issue #1412 — S3 Working Directory Behavior](https://github.com/calypr/funnel/issues/1412) |
0 commit comments