|
3 | 3 | This Repository will contain the basic scripts and files needed to setup Kubernetes cluster for running and working with Metaflow.
|
4 | 4 | It contains Kops setup and Kubernetes templates to deploy necessary services on kubernetes.
|
5 | 5 |
|
6 |
| -# Kops Guide. |
| 6 | +# Metaflow Kubernetes Plugin |
| 7 | + |
| 8 | +## Installing Plugin Metaflow Repo |
| 9 | +- ``pip install https://github.com/valayDave/metaflow/archive/kube_cpu_stable.zip`` |
| 10 | + |
| 11 | +## Using The Plugin |
| 12 | +- Usage is very similar to `@batch` decorator. |
| 13 | +- on top of any `@step` add the `@kube` decorator or use `--with kube:cpu=2,memory=4000,image=python:3.7` in the CLI args. |
| 14 | +- To run with Conda it will need `'python-kubernetes':'10.0.1'` in the libraries argument to `@conda_base` step decorator |
| 15 | +- Supports workflow orchestration within container and from local/remote machine. When Metaflow Runtime(workflow) within container, pass the `METAFLOW_RUNTIME_IN_CLUSTER=yes` environment variable to container. Check documentation in *Deploying Metaflow Job into Kubernetes* |
| 16 | + |
| 17 | +## CLI Operations Available with Kube: |
| 18 | +- ``python multi_step_mnist.py kube list`` : Show the currently running jobs of flow. |
| 19 | +- ``python multi_step_mnist.py kube kill`` : Kills all jobs on Kube. Any Metaflow Runtime accessing those jobs will be gracefully exited. |
| 20 | + |
| 21 | + |
| 22 | +# Kops Guide For Cluster Setup |
7 | 23 |
|
8 | 24 | ## Admin Guide
|
9 | 25 | This Involves the steps the admin needs to take to Setup cluster and some useful commands that will help maintain things around the cluster.
|
@@ -80,7 +96,7 @@ This involves using AWS Creds to set environment variables that give access to a
|
80 | 96 | # Deploying Metaflow Job into Kubernetes
|
81 | 97 |
|
82 | 98 | - Requirements:
|
83 |
| - - Create a Dockerfile which will build your metaflow Flow into an image |
| 99 | + - Create a Dockerfile which will build your metaflow Flow into an image. Include data if necessary, otherwise it should come from S3 in the flow. |
84 | 100 | ```dockerfile
|
85 | 101 | # this is an example Docker file of how to create and image of the Metaflow Run and Put it on Kubernetes.
|
86 | 102 | FROM python:3.7
|
|
0 commit comments