metaflow icon indicating copy to clipboard operation
metaflow copied to clipboard

Support for Airflow and Kubernetes

Open JoshZastrow opened this issue 4 years ago • 18 comments

An open-source version of issue #2 -- would love to be able to have Metaflow plugins that support Airflow and Kubernetes!

We currently deploy our machine learning models to Kubernetes as restful API-wrapped microservices, then create Airflow dags to orchestrate and schedule the execution of all the model components.

Admittedly not entirely familiar with what all Metaflow offers just yet, but would love to see seamless integrations with these other awesome open-source tools!

JoshZastrow avatar Dec 04 '19 18:12 JoshZastrow

@JoshZastrow I thought that MetaFlow could integrate with kubeflow, which is the machine learning toolkit for Kubernetes.

SteNicholas avatar Dec 05 '19 03:12 SteNicholas

@JoshZastrow Thanks for opening the issue! Yes, we are evaluating and prioritizing our roadmap currently.

savingoyal avatar Dec 05 '19 17:12 savingoyal

And what about using argo instead of airflow ? (https://github.com/argoproj/argo) Can it be included in this issue or should it be another one ?

nlaille avatar Dec 11 '19 10:12 nlaille

@nlaille Let's track that as a separate issue so that people can vote and weigh in with their opinions.

savingoyal avatar Dec 11 '19 20:12 savingoyal

IMHO this issue is too broad. Let me separate the use of Airflow with and without Kubernetes. You probably don't need Metaflow if you're using Airflow with Kubernetes. You may need Metaflow as an Airflow executor and an Airflow operator if you're using Airflow without Kubernetes.

Admittedly not entirely familiar with what all Metaflow offers just yet

I love open source software and solutions including Airflow which I use, but I believe this issue should be closed unless the o.p. can substantiate what Metaflow would meaningfully add to the Airflow with Kubernetes combo.

impredicative avatar Dec 26 '19 16:12 impredicative

Orchestration part could be cloud solutions like AWS Step Function or container based orchestration solutions like argo or other orchestrations like Airflow.

One reasonable option is to map metaflow DAG to step function/ARGO/Airflow DAG and execute remotely. Computing resources need to be changed correspondingly. Totally agree on @impredicative 's point, unless users have clear requirements, otherwise, it's not that meaningful to do this integration.

Jeffwan avatar Dec 28 '19 19:12 Jeffwan

I would second @impredicative 's comment that this is probably too broad.

In particular, I think there's potential, independent value of having a plugin implementation of a k8s cli, compute environment, and decorator. Based on a quick scan, it doesn't seem like there's too much functionality there to implement -- just make a kube job definition, come up with an annotation scheme (probably can do something similar to what airflow does), and handle cleanup. Drop in some example RBAC templates and you're probably good to go.

I think it would probably be fine to stop at container/job orchestration, and leave things like cluster autoscaling to pointers to existing k8s docs and tools.

The scheduler (i.e Airflow or AWS Step Function or Argo) seems like a separate discussion that's out of scope of a question of Kubernetes.

danieltahara avatar Feb 28 '20 07:02 danieltahara

Why not compile to Kubeflow Pipelines via an intermediate representation (IR) [1]?

[1] https://github.com/kubeflow/pipelines/issues/3703

talebzeghmi avatar May 19 '20 17:05 talebzeghmi

@talebzeghmi Yes, an IR for KfP would be great. Is there an RFC for it? We are happy to contribute our thoughts.

savingoyal avatar May 19 '20 18:05 savingoyal

For folks following this thread, we recently announced an equivalent support for AWS Step Functions. Here is an article with more details.

savingoyal avatar Aug 01 '20 16:08 savingoyal

There are existing mechanisms for triggering workflows based on external events.

For clarity, what are these? What if I want to trigger it on a schedule like Airflow allows me to do?

impredicative avatar Aug 01 '20 16:08 impredicative

For AWS Step Functions, we provide time-based triggers out of the box right now. You can very easily configure other triggers (say data availability in S3 using Amazon EventBridge).

savingoyal avatar Aug 01 '20 16:08 savingoyal

@savingoyal is there any support for event-based triggers? (e.g. REST API)

lucianoviola avatar Jan 26 '21 00:01 lucianoviola

https://github.com/Netflix/metaflow/issues/50#issuecomment-946254343 If you would like to try out and give feedback on our Kubernetes integration, please reach out at http://slack.outerbounds.co

savingoyal avatar Oct 18 '21 23:10 savingoyal

#992 provides GA support for Kubernetes. https://github.com/outerbounds/metaflow/tree/airflow is tracking the Airflow integration on top of Kubernetes.

savingoyal avatar Apr 22 '22 16:04 savingoyal

Kubernetes support was done via supporting the Argo-Workflows, great! https://github.com/Netflix/metaflow/pull/992 (Dispatch Metaflow flows to Argo Workflows)

wanghong230 avatar Apr 26 '22 16:04 wanghong230

This branch tracks the work for this issue.

savingoyal avatar May 30 '22 17:05 savingoyal

#1256 adds formal support for Airflow in Metaflow. Docs & release announcement to follow soon!

savingoyal avatar Jan 31 '23 16:01 savingoyal

https://outerbounds.com/blog/better-airflow-with-metaflow/

savingoyal avatar Feb 21 '23 17:02 savingoyal