From commits-return-16286-archive-asf-public=cust-asf.ponee.io@airflow.incubator.apache.org Wed Jul 4 17:44:05 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id D21B8180608 for ; Wed, 4 Jul 2018 17:44:04 +0200 (CEST) Received: (qmail 71271 invoked by uid 500); 4 Jul 2018 15:44:03 -0000 Mailing-List: contact commits-help@airflow.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airflow.incubator.apache.org Delivered-To: mailing list commits@airflow.incubator.apache.org Received: (qmail 71262 invoked by uid 99); 4 Jul 2018 15:44:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Jul 2018 15:44:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 6864A1A4D43 for ; Wed, 4 Jul 2018 15:44:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.301 X-Spam-Level: X-Spam-Status: No, score=-110.301 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 7cyQ4P-k2DlR for ; Wed, 4 Jul 2018 15:44:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 9AE7F5F183 for ; Wed, 4 Jul 2018 15:44:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id AF903E00FF for ; Wed, 4 Jul 2018 15:44:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 4B09A27504 for ; Wed, 4 Jul 2018 15:44:00 +0000 (UTC) Date: Wed, 4 Jul 2018 15:44:00 +0000 (UTC) From: "Daniel Imberman (JIRA)" To: commits@airflow.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (AIRFLOW-2714) Kubernetes Deployment Operator MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Daniel Imberman created AIRFLOW-2714: ---------------------------------------- Summary: Kubernetes Deployment Operator Key: AIRFLOW-2714 URL: https://issues.apache.org/jira/browse/AIRFLOW-2714 Project: Apache Airflow Issue Type: New Feature Reporter: Daniel Imberman Assignee: Daniel Imberman =C2=A0*{color:#212121}What?{color}* {color:#212121}=C2=A0Add an operator that monitors a k8s deployment, declar= ing the task{color} {color:#212121}complete on proper deployment/accessibility of endpoint{colo= r} *{color:#212121}Why?{color}* {color:#212121}=C2=A0Not all tasks are single pods, sometimes you would wan= t to run one task{color} {color:#212121}that launches a service, and then a second task that smoke t= ests/stress{color} {color:#212121}tests/{color} {color:#212121}=C2=A0gives state to an application deployment. This would g= ive airflow extra{color} {color:#212121}functionality as a CI/CD tool in the k8s ecosystem.{color} {color:#212121}*Fix*:{color} {color:#212121}=C2=A0Create a modification (or extension) of the k8sPodOper= ator that can handle{color} {color:#212121}entire deployments (possibly using the k8s model API to ensu= re{color} {color:#212121}full flexibility of users). An example of creating a deployment using the k8s model architecture can be found here: [https://github.com/kubernetes-client/python/blob/master/examples/deploymen= t_examples.py] {color} {code:java} def create_deployment_object(): =C2=A0 =C2=A0 # Configureate Pod template container =C2=A0 =C2=A0 container =3D client.V1Container( =C2=A0 =C2=A0 =C2=A0 =C2=A0 name=3D"nginx", =C2=A0 =C2=A0 =C2=A0 =C2=A0 image=3D"nginx:1.7.9", =C2=A0 =C2=A0 =C2=A0 =C2=A0 ports=3D[client.V1ContainerPort(container_port= =3D80)]) =C2=A0 =C2=A0 # Create and configurate a spec section =C2=A0 =C2=A0 template =3D client.V1PodTemplateSpec( =C2=A0 =C2=A0 =C2=A0 =C2=A0 metadata=3Dclient.V1ObjectMeta(labels=3D{"app":= "nginx"}), =C2=A0 =C2=A0 =C2=A0 =C2=A0 spec=3Dclient.V1PodSpec(containers=3D[container= ])) =C2=A0 =C2=A0 # Create the specification of deployment =C2=A0 =C2=A0 spec =3D client.ExtensionsV1beta1DeploymentSpec( =C2=A0 =C2=A0 =C2=A0 =C2=A0 replicas=3D3, =C2=A0 =C2=A0 =C2=A0 =C2=A0 template=3Dtemplate) =C2=A0 =C2=A0 # Instantiate the deployment object =C2=A0 =C2=A0 deployment =3D client.ExtensionsV1beta1Deployment( =C2=A0 =C2=A0 =C2=A0 =C2=A0 api_version=3D"extensions/v1beta1", =C2=A0 =C2=A0 =C2=A0 =C2=A0 kind=3D"Deployment", =C2=A0 =C2=A0 =C2=A0 =C2=A0 metadata=3Dclient.V1ObjectMeta(name=3DDEPLOYMEN= T_NAME), =C2=A0 =C2=A0 =C2=A0 =C2=A0 spec=3Dspec) {code} {color:#212121} return deployment This would involve a more k8s knowledge from the user, but would have the massive benefit that we would not have to maintain new features as the k8s API updates (Would simply update version). A user would have to supply is a deployment object and possibly a "success criteria" (i.e. an endpoint to test). Conversely, we could make the API a bit easier by only requiring a spec and an optional metadata, after which we would handle a lot of the boilerplate. {color} -- This message was sent by Atlassian JIRA (v7.6.3#76005)