<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ignacio Peluffo on Medium]]></title>
        <description><![CDATA[Stories by Ignacio Peluffo on Medium]]></description>
        <link>https://medium.com/@ipeluffo?source=rss-977222ad3baa------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*jBcVsTAEUWy66gcw.jpg</url>
            <title>Stories by Ignacio Peluffo on Medium</title>
            <link>https://medium.com/@ipeluffo?source=rss-977222ad3baa------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 05:06:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ipeluffo/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Running Apache Airflow locally on Kubernetes (minikube)]]></title>
            <link>https://medium.com/@ipeluffo/running-apache-airflow-locally-on-kubernetes-minikube-31f308e3247a?source=rss-977222ad3baa------2</link>
            <guid isPermaLink="false">https://medium.com/p/31f308e3247a</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[k8s]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[airflow]]></category>
            <dc:creator><![CDATA[Ignacio Peluffo]]></dc:creator>
            <pubDate>Wed, 22 Apr 2020 22:57:40 GMT</pubDate>
            <atom:updated>2020-04-22T22:57:40.879Z</atom:updated>
            <content:encoded><![CDATA[<p>The goal of this guide is to show how to run Airflow entirely on a Kubernetes cluster. This means that all Airflow componentes (i.e. webserver, scheduler and workers) would run within the cluster.</p><h3>Before we begin…</h3><p>What does this article cover?</p><ul><li>How to define Kubernetes components to run Airflow and why we need them</li><li>Deploy Airflow components and run a DAG</li><li>Explain necessary K8s components like their definitions and learn why we need them</li></ul><p>What doesn’t this article cover?</p><ul><li>Doesn’t explain Airflow in detail</li><li>Doesn’t explain Kubernetes in detail</li></ul><p>Important: this deployment guide is not suitable for production environments</p><p>Source code can be found in: <a href="https://github.com/ipeluffo/airflow-on-kubernetes">https://github.com/ipeluffo/airflow-on-kubernetes</a>.</p><h3>Prerequisites</h3><ul><li><a href="https://kubernetes.io/docs/tasks/tools/install-minikube/">minikube</a></li><li><a href="https://kubernetes.io/docs/tasks/tools/install-kubectl/">kubectl</a></li></ul><p>At the moment of writing, I’m using the following versions on macOS 10.14.6:</p><pre>➜ minikube version<br>minikube version: v1.8.2<br>commit: eb13446e786c9ef70cb0a9f85a633194e62396a1</pre><pre>➜ kubectl version<br>Client Version: version.Info{Major:&quot;1&quot;, Minor:&quot;17&quot;, GitVersion:&quot;v1.17.4&quot;, GitCommit:&quot;8d8aa39598534325ad77120c120a22b3a990b5ea&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2020-03-12T23:40:44Z&quot;, GoVersion:&quot;go1.14&quot;, Compiler:&quot;gc&quot;, Platform:&quot;darwin/amd64&quot;}</pre><h3>Introduction</h3><p><a href="https://airflow.apache.org/">Airflow</a> is described on its website as:</p><blockquote>Airflow is a platform created by the community to programmatically author, schedule and monitor workflows.</blockquote><p><a href="https://kubernetes.io/">Kubernetes</a> is described on its website as:</p><blockquote>Kubernetes (K8s) is an open-source system for automating deployment, scaling, and management of containerized applications.</blockquote><h4>What are we going to build?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*EPY8uVP99swCYkR5zSp2kA.png" /><figcaption>Diagram of Pods running in the cluster</figcaption></figure><h4>Why Airflow on Kubernetes?</h4><p>Airflow offers a very flexible toolset to programmatically create workflows of any complexity. In order to run the individual tasks Airflow uses an executor to run them in different ways like locally or using Celery.</p><p>In version 1.10.0, Airflow introduced a new executor called <a href="https://airflow.apache.org/docs/stable/executor/kubernetes.html">KubernetesExecutor</a> to dynamically run tasks on <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod/">Kubernetes pods</a>. In this way, Airlfow is able to run tasks creating Pods on demand without wasting resources with idle workers as it would happen with other executors.</p><h3>Docker image</h3><p>In order to run Airflow’s components, we need a Docker image that Kubernetes will use in order to run pods inside the cluster.</p><p>For this tutorial we’ll use the image <a href="https://hub.docker.com/r/puckel/docker-airflow">puckel/docker-airflow</a> (Github: <a href="https://github.com/puckel/docker-airflow">https://github.com/puckel/docker-airflow</a>), more specifically image’s tag 1.10.9 which provides a flexible Airflow configuration image using the last version of Airflow at the moment of writing (1.10.9).</p><p>The only issue is that docker-airflow image doesn’t provide support for KubernetesExecutor: <a href="https://github.com/puckel/docker-airflow/blob/1.10.9/README.md#usage](https://github.com/puckel/docker-airflow/blob/1.10.9/README.md#usage)">https://github.com/puckel/docker-airflow/blob/1.10.9/README.md#usage</a></p><p>However, we can take advantage of some flexibilities of the image definition that will allow us to use KubernetesExecutor.</p><h4>Customizations</h4><h4>Airflow dependency</h4><p>One key thing that is not present in the image is the extra Kubernetes dependencies from Airflow: <a href="https://github.com/puckel/docker-airflow/blob/1.10.9/Dockerfile#L62">https://github.com/puckel/docker-airflow/blob/1.10.9/Dockerfile#L62</a></p><p>Despite the Dockerimage allows us to add more dependencies setting the AIRFLOW_DEPS argument, in this tutorial we’re not going to create our own custom docker image, so we’re using another customization available in the entry point script of the image: <a href="https://github.com/puckel/docker-airflow/blob/1.10.9/script/entrypoint.sh#L26-L29">https://github.com/puckel/docker-airflow/blob/1.10.9/script/entrypoint.sh#L26-L29</a></p><p>Thanks to that part of the entry point script, we’re able to add a requirements.txt file that will be used dynamically by the entry point when starting the container. The downside of this is that any new pod will need to install this dependency before starting it, making the startup time slower. A better solution would be to design a custom and optimal Docker image for our purposes that it’s out of the scope of this guide.</p><h4>Environment variables</h4><p>Related to the need of a customised docker image, we should also customise Airflow’s configuration in order to use the executor.</p><p>Similar to what was described above, we have the option to create our own configuration file and load it in our custom image or we can override configuration’s setting by <a href="https://airflow.apache.org/docs/1.10.9/howto/set-config.html#setting-configuration-options">using environment variables</a>.</p><h3>Kubernetes objects</h3><h4>ConfigMap</h4><p>From <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/">Kubernetes site</a>:</p><blockquote>ConfigMaps allow you to decouple configuration artifacts from image content to keep containerized applications portable.</blockquote><p>In our case, we’re going to create two ConfigMap objects described below.</p><h4>`ConfigMap`: `requirements.txt`</h4><p>As described above, we need to add a requirements file in order to install Airflow’s Kubernetes dependency (i.e. apache-airflow[kubernetes]).</p><p>Kubernetes provides different alternatives to create the file, in this case we’ll use a ConfigMap that will be later mounted as a Volume in order to create the necessary file in the pod’s file system. The objective of this guide is not only to show Airflow running on Kubernetes but use and learn different tools that the latter provides us.</p><p>Below is the ConfigMap definition:</p><pre>apiVersion: v1<br>kind: ConfigMap<br>metadata:<br>  name: requirements-configmap<br>data:<br>  requirements.txt: |<br>  apache-airflow[kubernetes]==1.10.9</pre><h4>`ConfigMap`: environment variables</h4><p>To customise Airflow’s configuration, we’ll set environment variables that override the file configuration. To achieve this, we can define the env vars within the Kubernetes object definition or we can also create a ConfigMap and just configure the object to set the env vars from it.</p><p>Below is the ConfigMap for our custom environment variables:</p><pre>apiVersion: v1<br>kind: ConfigMap<br>metadata:<br>  name: airflow-envvars-configmap<br>data:<br>  EXECUTOR: Kubernetes<br>  POSTGRES_HOST: postgres<br>  POSTGRES_USER: airflow<br>  POSTGRES_PASSWORD: airflow<br>  POSTGRES_DB: airflow<br>  POSTGRES_PORT: “5432”<br>  LOAD_EX: “y”<br>  AIRFLOW__KUBERNETES__KUBE_CLIENT_REQUEST_ARGS: ‘{“_request_timeout”: [60,60]}’<br>  AIRFLOW__KUBERNETES__WORKER_CONTAINER_REPOSITORY: puckel/docker-airflow<br>  AIRFLOW__KUBERNETES__WORKER_CONTAINER_TAG: “1.10.9”<br>  AIRFLOW__KUBERNETES__DAGS_VOLUME_HOST: /mnt/airflow/dags<br>  AIRFLOW__KUBERNETES__LOGS_VOLUME_CLAIM: airflow-logs-pvc<br>  AIRFLOW__KUBERNETES__ENV_FROM_CONFIGMAP_REF: airflow-envvars-configmap</pre><p>Following is the explanation for each of the env vars:</p><ul><li>EXECUTOR: we need this one to dynamically set the Airflow’s executor. The <a href="https://github.com/puckel/docker-airflow/blob/1.10.9/script/entrypoint.sh#L13">docker image entrypoint script uses this env var </a><br>to set the Airflow executor configuration.</li><li>POSTGRES_: these env vars are needed since our deployment needs a Postgres server running to which our Airflow components will connect to store information about DAGs and Airflow such as <a href="https://airflow.apache.org/docs/stable/concepts.html#connections">connections</a>, <a href="https://airflow.apache.org/docs/stable/concepts.html#variables">variables</a> and DAGs’ information such as tasks’ state.</li><li>LOAD_EX: this env var is used to load Airflow’s example DAGs. Feel free to disable it if you don’t want to see or use default DAGs.</li><li>AIRFLOW__KUBERNETES__KUBE_CLIENT_REQUEST_ARGS: when developing this guide, I found that Airflow failed to parse the configuration file and this value was causing some issues because of the double brackets in the <a href="https://github.com/puckel/docker-airflow/blob/1.10.9/config/airflow.cfg#L934">configuration value in the docker image</a>.</li><li>AIRFLOW__KUBERNETES__WORKER_CONTAINER_REPOSITORY: all env vars with the prefix AIRFLOW__KUBERNETES__ are specifically for Kubernetes integration on Airflow. As the name suggests, this env var is to specify the docker image to be used for workers. In the context of Kubernetes, workers will be run on a Pod.</li><li>AIRFLOW__KUBERNETES__WORKER_CONTAINER_TAG: this env var is used to specify the docker image tag.</li><li>AIRFLOW__KUBERNETES__DAGS_VOLUME_HOST: we’ll see this in more detail later. For now, this specifies the path of the volume in the host (i.e. cluster node) where DAGs files are stored.</li><li>AIRFLOW__KUBERNETES__LOGS_VOLUME_CLAIM: this env var specifies the Kubernetes volume claim to use to store and read logs. We’ll talk about this in more detail later.</li><li>AIRFLOW__KUBERNETES__ENV_FROM_CONFIGMAP_REF: this specifies the name of the ConfigMap that stores the env vars (i.e. this one). This will allow workers to load env vars from this ConfigMap when running.</li></ul><h4>Volumes</h4><p>For each Airflow component (i.e. Kubernetes pod) we’re going to set up three volumes for different purposes using multiple Kubernetes tools:</p><ol><li>Volume for Logs</li><li>Volume for requirements file</li><li>Volume for DAGs</li></ol><h4>Volume: Logs</h4><p>There are multiple alternatives to save Airflow’s logs on a Kubernetes deployment. In this guide, we’ll define a Volume that will allow us to persist logs from all Airflow’s components. If we decide to not set a volume, then Airflow’s workers’ logs would be lost after they finish.</p><p>To achieve this, we need to create a PersistenVolumeClaim object:</p><pre>apiVersion: v1<br>kind: PersistentVolumeClaim<br>metadata:<br>  name: airflow-logs-pvc<br>  labels:<br>    app: airflow-k8s<br>spec:<br>  accessModes:<br>    — ReadWriteMany<br>  resources:<br>    requests:<br>      storage: 512Mi</pre><p>This volume claim will allow pods to create a volume that will be attached to this volume claim. For more information about to PersistentVolume and PersistentVolumeClaim: <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/">https://kubernetes.io/docs/concepts/storage/persistent-volumes/</a>.</p><p>Important things about this object:</p><ul><li>metadata.name: this is the value used in the env var used to set the name of the persistent volume claim to be used by Airflow’s workers.</li><li>accessModes: since the volume claim will be read and write by multiple pods, we need to set a proper access mode to allow them to use it.</li></ul><h4>Volume: requirements file</h4><p>As mentioned in the section of ConfigMaps, the requirements file is declared as a ConfigMap which will be mounted as a file using a volume. This volume is defined within a Kubernetes object and looks like:</p><pre>- name: requirements-configmap<br>  configMap:<br>    name: requirements-configmap</pre><p>We need to set configMap.name the same value that we use in the config map definition.</p><h4>Volume: DAGs directory</h4><p>For the DAGs directory, we’ll use a tool that is only suitable for a local deployment that gives us a lot of flexibility when doing tests when we need to test changes on DAGs.</p><p>Below is the definition of this volume:</p><pre>- name: dags-host-volume<br>  hostPath:<br>    path: /mnt/airflow/dags<br>    type: Directory</pre><p>In this case we mount a volume of type <a href="https://kubernetes.io/docs/concepts/storage/volumes/#hostpath">hostPath</a>.<br>This means that the pod’s volume is attached to a path (could be a file or a directory) within the cluster node. This last point is very important, <strong><em>the path should exist in the cluster node and not in the host machine</em></strong>.</p><p>Then, to make this work we can put the files into a directory in the host machine or mount a host directory into the Kubernetes node (in our case the minikube cluster).</p><p>Since this a test environment where we’d like to easily change DAGs and run tests, we’ll mount a host folder into the minikube cluster running the following command:</p><pre>minikube mount ./dags/:/mnt/airflow/dags</pre><p>When running this command you should see an output like this:</p><pre>➜ minikube mount ./dags/:/mnt/airflow/dags<br>📁  Mounting host path ./dags/ into VM as /mnt/airflow/dags ...<br>    ▪ Mount type:   &lt;no value&gt;<br>    ▪ User ID:      docker<br>    ▪ Group ID:     docker<br>    ▪ Version:      9p2000.L<br>    ▪ Message Size: 262144<br>    ▪ Permissions:  755 (-rwxr-xr-x)<br>    ▪ Options:      map[]<br>    ▪ Bind Address: 192.168.64.1:50240<br>🚀  Userspace file server: ufs starting<br>✅  Successfully mounted ./dags/ to /mnt/airflow/dags</pre><pre>📌  NOTE: This process must stay alive for the mount to be accessible ...</pre><p>Finally, having the mount running, pods will be able to mount the cluster node’s folder where they’ll be able to read and write files which will be written into our host machine.</p><h4>PostgreSQL</h4><p>In this and the following sections, we’ll define the necessary Kubernetes objects to run the pods that we need to run Airflow.</p><p>First, we’ll define a `Deployment` and a `Service` to run a PostgreSQL instance that Airflow will use. We can also define a `Pod` object, but in this case, they’ll be automatically created when we create the `Deployment`.</p><p>If you’re not familiar with these Kubernetes concepts, I recommend having a quick read to the links below:</p><ul><li>Deployment: <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/">https://kubernetes.io/docs/concepts/workloads/controllers/deployment/</a></li><li>Service: <a href="https://kubernetes.io/docs/concepts/services-networking/service/](https://kubernetes.io/docs/concepts/services-networking/service/)">https://kubernetes.io/docs/concepts/services-networking/service/</a></li></ul><p>Service definition:</p><pre>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: postgres<br>spec:<br>  selector:<br>    app: postgres<br>  ports:<br>  - port: 5432<br>    targetPort: 5432</pre><p>This Service object will allow us to expose the pod port to be able to connect to the PostgreSQL instance. Kubernetes cluster runs a DNS service that will allow other pods to connect to this service using its name (i.e. postgres).</p><p>Deployment definition:</p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: postgres<br>spec:<br>  selector:<br>    matchLabels:<br>      app: postgres<br>  replicas: 1<br>  template:<br>    metadata:<br>      labels:<br>        app: postgres<br>    spec:<br>      containers:<br>      - name: postgres<br>        image: postgres:12<br>        resources:<br>          limits:<br>            memory: 128Mi<br>            cpu: 500m<br>        ports:<br>        - containerPort: 5432        <br>        env:<br>        - name: POSTGRES_PASSWORD<br>          value: airflow<br>        - name: POSTGRES_USER<br>          value: airflow<br>        - name: POSTGRES_DB<br>          value: airflow</pre><p>For the deployment, we specify that the number of replicas should be one and the necessary env vars to set up the default user and database to be created when the container starts.</p><h4>Airflow webserver</h4><p>Now, we’re going to go through the definition of the Service and Deployment objects for the Airflow webserver. In this case, we need a Service since we need to connect to the webserver from our machine and for that we’ll need to expose the port from the cluster.</p><p>Service definition:</p><pre>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: airflow-webserver<br>  labels:<br>    app: airflow-k8s<br>spec:<br>  type: NodePort<br>  selector:<br>    app: airflow-webserver<br>  ports:<br>  - port: 8080</pre><p>Most important things from the definition:</p><ul><li>selector: this will be used by the service to identify which pods should receive traffic sent to the service.</li><li>type: NodePort: this will allow us to expose the service port so we’re able to connect to the service from our machine. For more info: <a href="https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types)">https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types</a></li><li>port: port to expose to connect to the webserver.</li></ul><p>Deployment full definition:</p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: airflow-webserver<br>  labels:<br>    app: airflow-k8s<br>spec:<br>  selector:<br>    matchLabels:<br>      app: airflow-webserver<br>  replicas: 1<br>  template:<br>    metadata:<br>      labels:<br>        app: airflow-webserver<br>    spec:<br>      containers:<br>      - name: airflow-webserver<br>        image: puckel/docker-airflow:1.10.9<br>        envFrom:<br>          - configMapRef:<br>              name: airflow-envvars-configmap<br>        resources:<br>          limits:<br>            memory: &quot;2Gi&quot;<br>        ports:<br>          - containerPort: 8080<br>        volumeMounts:<br>          - name: requirements-configmap<br>            subPath: &quot;requirements.txt&quot;<br>            mountPath: &quot;/requirements.txt&quot;<br>          - name: dags-host-volume<br>            mountPath: /usr/local/airflow/dags<br>          - name: logs-persistent-storage<br>            mountPath: /usr/local/airflow/logs<br>      volumes:<br>        - name: requirements-configmap<br>          configMap:<br>            name: requirements-configmap<br>        - name: dags-host-volume<br>          hostPath:<br>            path: /mnt/airflow/dags<br>            type: Directory<br>        - name: logs-persistent-storage<br>          persistentVolumeClaim:<br>              claimName: airflow-logs-pvc</pre><p>Few comments about this definition:</p><ul><li>volumes section: as mentioned on the Volumes section of this guide, we need to define the volumes to be used by the pods. So, in this case, we define one volume for the logs, one for the requirements file and one for the logs persistent volume claim.</li><li>volumeMounts: to be able to use the volumes, we need to specify how they should be mounted on within the pod and this section is used for that.</li><li>ports: define the pod’s port to expose.</li><li>resources: in this example, we just specified the maximum amount of memory allowed to be used by the pod.</li></ul><h4>Airflow scheduler</h4><p>In the case of the scheduler, we only need to create a deployment since it doesn’t expose any service that other workers need to connect to. However, the scheduler is responsible of creating workers (i.e. pods) to run Airflow’s tasks so we need to give the needed permissions to the scheduler to be able to manage pods on the cluster like creating and deleting them. To achieve this, we need to define a `ClusterRole` and `ClusterRoleBinding` Kubernetes objects.</p><p>Deployment definition:</p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: airflow-scheduler<br>  labels:<br>    app: airflow-k8s<br>spec:<br>  selector:<br>    matchLabels:<br>      app: airflow-scheduler<br>  replicas: 1<br>  template:<br>    metadata:<br>      labels:<br>        app: airflow-scheduler<br>    spec:<br>      containers:<br>      - name: airflow-scheduler<br>        image: puckel/docker-airflow:1.10.9<br>        args: [&quot;scheduler&quot;]<br>        envFrom:<br>          - configMapRef:<br>              name: airflow-envvars-configmap<br>        resources:<br>          limits:<br>            memory: &quot;512Mi&quot;<br>        volumeMounts:<br>          - name: requirements-configmap<br>            subPath: &quot;requirements.txt&quot;<br>            mountPath: &quot;/requirements.txt&quot;<br>          - name: dags-host-volume<br>            mountPath: /usr/local/airflow/dags<br>          - name: logs-persistent-storage<br>            mountPath: /usr/local/airflow/logs<br>      volumes:<br>        - name: requirements-configmap<br>          configMap:<br>            name: requirements-configmap<br>        - name: dags-host-volume<br>          hostPath:<br>            path: /mnt/airflow/dags<br>            type: Directory<br>        - name: logs-persistent-storage<br>          persistentVolumeClaim:<br>              claimName: airflow-logs-pvc</pre><p>The only difference with the definition of the webserver deployment is the args setting which overrides the Docker image command that will be run on from the <a href="https://github.com/puckel/docker-airflow/blob/1.10.9/script/entrypoint.sh#L119-L122">entrypoint script</a>.</p><p>Airflow scheduler permissions:</p><pre>kind: ClusterRole<br>apiVersion: rbac.authorization.k8s.io/v1<br>metadata:<br>  name: pods-permissions<br>rules:<br>  - apiGroups: [&quot;&quot;]<br>    resources: [&quot;pods&quot;]<br>    verbs: [&quot;get&quot;, &quot;list&quot;, &quot;watch&quot;, &quot;create&quot;, &quot;delete&quot;]</pre><pre>---</pre><pre>kind: ClusterRoleBinding<br>apiVersion: rbac.authorization.k8s.io/v1<br>metadata:<br>  name: pods-permissions<br>subjects:<br>  - kind: ServiceAccount<br>    name: default<br>    namespace: default<br>roleRef:<br>  kind: ClusterRole<br>  name: pods-permissions<br>  apiGroup: rbac.authorization.k8s.io</pre><p>It’s easy to see that the `ClusterRole` gives specific permissions to manage pods.</p><h3>Running Airflow in Kubernetes</h3><p>To make it easier to create and delete all resources from the Kubernetes cluster, I created two scripts:</p><ul><li>script-apply.sh: creates all Kubernetes objects.</li><li>script-delete.sh: deletes all objects, it can take some time to delete the persistent volume claim.</li></ul><p>After starting minikube, if we’re not running anything in the cluster, we should see something like this:</p><pre>➜ kubectl get pods,deploy,svc,pv,pvc<br>NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE<br>service/kubernetes   ClusterIP   10.96.0.1    &lt;none&gt;        443/TCP   25d</pre><p>If we run script-apply.sh script:</p><pre>➜ ./script-apply.sh<br>persistentvolumeclaim/airflow-logs-pvc created<br>clusterrole.rbac.authorization.k8s.io/pods-permissions created<br>clusterrolebinding.rbac.authorization.k8s.io/pods-permissions created<br>service/postgres created<br>deployment.apps/postgres created<br>configmap/requirements-configmap created<br>configmap/airflow-envvars-configmap created<br>service/airflow-webserver created<br>deployment.apps/airflow-webserver created<br>deployment.apps/airflow-scheduler created</pre><p>Then, we should be able all objects created by the script:</p><pre>➜ kubectl get pods,deploy,svc,pv,pvc<br>NAME                                     READY   STATUS    RESTARTS   AGE<br>pod/airflow-scheduler-5c85cb5c9c-qmz4x   1/1     Running   0          7s<br>pod/airflow-webserver-744ddfcf6-4gfgc    1/1     Running   0          7s<br>pod/postgres-58fb56c4cb-tcdx8            1/1     Running   0          7s</pre><pre>NAME                                READY   UP-TO-DATE   AVAILABLE   AGE<br>deployment.apps/airflow-scheduler   1/1     1            1           9s<br>deployment.apps/airflow-webserver   1/1     1            1           9s<br>deployment.apps/postgres            1/1     1            1           9s</pre><pre>NAME                        TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)          AGE<br>service/airflow-webserver   NodePort    10.100.119.225   &lt;none&gt;        8080:32044/TCP   9s<br>service/kubernetes          ClusterIP   10.96.0.1        &lt;none&gt;        443/TCP          25d<br>service/postgres            ClusterIP   10.106.95.57     &lt;none&gt;        5432/TCP         10s</pre><pre>NAME                                                        CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                      STORAGECLASS   REASON   AGE<br>persistentvolume/pvc-830cbd78-8603-44cf-8f59-56e1fe16ec73   512Mi      RWX            Delete           Bound    default/airflow-logs-pvc   standard                10s</pre><pre>NAME                                     STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE<br>persistentvolumeclaim/airflow-logs-pvc   Bound    pvc-830cbd78-8603-44cf-8f59-56e1fe16ec73   512Mi      RWX            standard       10s</pre><p>To access Airflow webserver:</p><pre>➜ minikube service airflow-webserver<br>|-----------|-------------------|-------------|---------------------------|<br>| NAMESPACE |       NAME        | TARGET PORT |            URL            |<br>|-----------|-------------------|-------------|---------------------------|<br>| default   | airflow-webserver |             | <a href="http://192.168.64.4:32044/">http://192.168.64.4:32044</a> |<br>|-----------|-------------------|-------------|---------------------------|<br>🎉  Opening service default/airflow-webserver in default browser...</pre><p>And we should see Airflow UI homepage:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZM3SqXsZ_9G3ecM5BRrwkA.png" /><figcaption>Airflow up and running!</figcaption></figure><p>Let’s try running a DAG:</p><pre>➜ kubectl get pods<br>NAME                                 READY   STATUS    RESTARTS   AGE<br>airflow-scheduler-5c85cb5c9c-qmz4x   1/1     Running   0          4m17s<br>airflow-webserver-744ddfcf6-4gfgc    1/1     Running   0          4m17s<br>postgres-58fb56c4cb-tcdx8            1/1     Running   0          4m17s</pre><p>If we run example_complex DAG and we wait a few seconds, we should see the DAG tasks start to be run:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8_J6BtOKsKj-ZuEq8hVVIw.png" /><figcaption>example_complex DAG running</figcaption></figure><p>And if we check the pods on Kubernetes:</p><pre>➜ kubectl get pods<br>NAME                                                                     READY   STATUS              RESTARTS   AGE<br>airflow-scheduler-5c85cb5c9c-qmz4x                                       1/1     Running             0          6m26s<br>airflow-webserver-744ddfcf6-4gfgc                                        1/1     Running             0          6m26s<br>examplecomplexcreateentrygcs-a66431daa1c646e3a22ae7da97371047            1/1     Running             0          6s<br>examplecomplexcreateentrygroupresult-11450ba8cbd04e93b8d89f75b256b232    1/1     Running             0          2s<br>examplecomplexcreateentrygroupresult2-52663896be3c4bcc9e0d5f7293525d4d   0/1     ContainerCreating   0          0s<br>examplecomplexgetentrygroup-2243f00d53e44d75b6f511e8bfc272da             1/1     Running             0          4s<br>postgres-58fb56c4cb-tcdx8                                                1/1     Running             0          6m26s</pre><p>Let’s check the logs of one successful task:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HoOgXbKxS-rf36kyqkFPYw.png" /><figcaption>Task logs</figcaption></figure><p>However, if we wait the DAG to finish, we’ll see that it fails:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yK-zjLu5v-bQa8Ywpc0lHg.png" /><figcaption>DAG failed</figcaption></figure><p>And we can check why the task failed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_4o6-iSe-N4d9kTPaLetZA.png" /><figcaption>Failed task logs</figcaption></figure><p>If we check pods in the cluster:</p><pre>➜ kubectl get pods<br>NAME                                 READY   STATUS    RESTARTS   AGE<br>airflow-scheduler-5c85cb5c9c-qmz4x   1/1     Running   0          10m<br>airflow-webserver-744ddfcf6-4gfgc    1/1     Running   0          10m<br>postgres-58fb56c4cb-tcdx8            1/1     Running   0          10m</pre><p>We can see that all pods running Airflow’s tasks have finished and were removed.</p><p>Lastly, we can clean the Kubernetes cluster removing all objects:</p><pre>➜ ./script-delete.sh<br>clusterrole.rbac.authorization.k8s.io &quot;pods-permissions&quot; deleted<br>clusterrolebinding.rbac.authorization.k8s.io &quot;pods-permissions&quot; deleted<br>service &quot;postgres&quot; deleted<br>deployment.apps &quot;postgres&quot; deleted<br>configmap &quot;requirements-configmap&quot; deleted<br>configmap &quot;airflow-envvars-configmap&quot; deleted<br>service &quot;airflow-webserver&quot; deleted<br>deployment.apps &quot;airflow-webserver&quot; deleted<br>deployment.apps &quot;airflow-scheduler&quot; deleted<br>persistentvolumeclaim &quot;airflow-logs-pvc&quot; deleted</pre><p>We check pods, services and other:</p><pre>➜ kubectl get pods,deploy,svc,pv,pvc<br>NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE<br>service/kubernetes   ClusterIP   10.96.0.1    &lt;none&gt;        443/TCP   25d</pre><h3>Conclusion</h3><p>We reached the end of this guide where we saw that running a whole Airflow deployment on a local Kubernetes cluster is straightforward.</p><p>As mentioned at the beginning, the objective of this guide is to use several tools from Kubernetes and many things should be changed for a deployment in a production environment. This deployment allows developers to quickly do tests, if you have a DAG you should be able to put it in the dags folder and immediately see it on the UI.</p><p>So that’s it for the guide, I hope it was useful and help you to continue learning about Kubernetes and Apache Airflow.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=31f308e3247a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tweets hashtags real-time processing with Faust]]></title>
            <link>https://medium.com/@ipeluffo/tweets-hashtags-real-time-processing-with-faust-1102a03ed86c?source=rss-977222ad3baa------2</link>
            <guid isPermaLink="false">https://medium.com/p/1102a03ed86c</guid>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[streaming]]></category>
            <category><![CDATA[faust]]></category>
            <category><![CDATA[real-time-analytics]]></category>
            <dc:creator><![CDATA[Ignacio Peluffo]]></dc:creator>
            <pubDate>Wed, 03 Jul 2019 21:29:32 GMT</pubDate>
            <atom:updated>2019-07-03T21:29:32.315Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is Faust?</h3><p><a href="https://faust.readthedocs.io/en/latest/">Faust</a> is described in a short and simple way by its creators as:</p><blockquote>Faust is a stream processing library, porting the ideas from Kafka Streams to Python.</blockquote><p>And the best part:</p><blockquote>It does not use a DSL, it’s just Python! This means you can use all your favorite Python libraries when stream processing: NumPy, PyTorch, Pandas, NLTK, Django, Flask, SQLAlchemy, ++</blockquote><p><a href="https://robinhood.com/">Robinhood</a>, the company behind Faust, are using Faust in production and they have open sourced the library making public its repo in Github: <a href="https://github.com/robinhood/faust">https://github.com/robinhood/faust</a>.</p><p>Faust is an incredibly easy and powerful tool to process streams in real-time allowing to process millions or even billions events per day thanks to its implementation using <a href="https://docs.python.org/3/library/asyncio.html">Python asyncio</a> and <a href="http://kafka.apache.org/">Apache Kafka</a> as the message broker.</p><p>In this post, we’ll build a simple app to process tweets in real-time from a Twitter stream, filtering it by a specific criteria, in order to count the hashtags found in them. The objective is to show how easy and quick is to build a stream processing project made purely in Python.</p><h3>What are we building?</h3><p>The idea of this project is simple: read tweets from a Twitter stream, send their hashtags as events and count them using Faust agents.</p><p>What are we going to do? Build the following:</p><ol><li>Custom Faust CLI command</li><li>Faust agent to process events</li><li>Faust views</li></ol><p>Here is a simple diagram that shows how the different components interact between each other:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BPPkLTqcrd3FMobZNPAhCA.png" /></figure><p><strong>Note</strong>: the purpose of this article is not to explain in detail the Faust library and its components, but give an idea of how easy is to build a stream processor with it.</p><h3>Custom Faust CLI command</h3><p>Faust provides very handy tools to build our own <a href="https://faust.readthedocs.io/en/latest/userguide/tasks.html#custom-cli-commands">custom CLI commands</a> with parameters.</p><p>For this project, we’re going to build a CLI command to read tweets from the Twitter real-time stream, process them and generate one event per hashtag taken from them.</p><p>Since Faust uses <a href="https://docs.python.org/3/library/asyncio.html">asyncio</a> and its new <em>async/await</em> syntax, we require to use a Twitter client that supports the same. For this project I’ve chosen <a href="https://github.com/odrling/peony-twitter">peony-twitter</a> which is an asynchronous Twitter client made in Python.</p><p>Below is the command’s code where all the logic is split in function for better readability and make it simpler to understand the idea:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d9a11897601ff16ebd32122b4ee5236d/href">https://medium.com/media/d9a11897601ff16ebd32122b4ee5236d/href</a></iframe><p>The command hashtags_events_generator is responsible for filtering the Twitter stream using the value of the parameter track that is sent to it.</p><p>Then, it processes all the tweets that match with the filter and sends one event per hashtag found. This point is very important since Faust currently uses Kafka as the main broker for sending messages.</p><h3>Faust agent to process events</h3><p>The second step is to build a <a href="https://faust.readthedocs.io/en/latest/userguide/agents.html">Faust agent</a>, which is one of the most important concepts in the framework, to process the Kafka events and count the hashtags.</p><p>Also, for this implementation, we use <a href="https://faust.readthedocs.io/en/latest/userguide/tables.html#tables">Faust tables</a> which is another crucial concept that provides a great flexibility to store data and share it across multiple workers running in parallel. I encourage you to read the documentation to understand all the details and potential of Tables.</p><p>A code snippet that shows how the agent could be implemented is shown below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/84e9759176d871869a2ff46b58b95aed/href">https://medium.com/media/84e9759176d871869a2ff46b58b95aed/href</a></iframe><p>In this piece of code I included the agent, the topic and table definitions. Their definitions should be done in different modules for a better code organisation.</p><p>From this code it’s simple to see how easy is to build the Kafka topic consumer which requires the following:</p><ol><li>Use a decorator that specifies the topic that the agent should consume from</li><li>Iterate over the stream (i.e. hashtags )</li><li>Process the event, in this I’m counting the hashtags, which is the event’s body, and storing the total count in the table hashtags_counts_table</li></ol><p>The best part is that this can scale really easily running multiple workers at the same time and it took only a few lines of code.</p><p>It’s important to note two details that make the implementation simpler:</p><ul><li>The table has a default so we don’t need to check the existence of the key in it</li><li>We set a function to automatically parse the messages’ value received from the topic</li></ul><h3>Faust views</h3><p>Up to this point, we’ve been sending events and processing them but we couldn’t get any information like which hashtags the agent has processed.</p><p>For this reason, we build a tiny API that exposes two endpoints using <a href="https://faust.readthedocs.io/en/latest/userguide/tasks.html#web-views">Faust Views</a>, another useful tool provided by Faust to build APIs in a few lines of code that could be helpful for some specific use cases:</p><ol><li>/hashtags : returns all hashtags processed at the moment</li><li>/{hashtag}/count : returns the current count for the hashtag sent in the path parameter</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4bd01627d2165be3a53f24f8bed9026c/href">https://medium.com/media/4bd01627d2165be3a53f24f8bed9026c/href</a></iframe><p>Example response from /hashtags :</p><pre>{<br>    &quot;hashtags&quot;: [<br>        &quot;python&quot;,<br>        &quot;ilovepythonmore&quot;,<br>        &quot;programming&quot;<br>    ]<br>}</pre><p>Example response from /hashtags/python/count :</p><pre>{<br>    &quot;hashtag&quot;: &quot;python&quot;,<br>    &quot;count&quot;: 7<br>}</pre><h3>Demo</h3><p>Below is a screen capture showing workers processing events in real-time:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RTkvew0H_Dm3hFtEqirjLg.gif" /></figure><h3>Source code</h3><p>You can find the source code for this project in the Github repo: <a href="https://github.com/ipeluffo/faust-hashtags-counter">https://github.com/ipeluffo/faust-hashtags-counter</a></p><p>In the repo’s readme you’ll find all the instructions to run the workers and setup the whole environment. Also, I’ve provided two docker-compose files so you can run Kafka with Zookeeper locally.</p><h3>Conclusions</h3><p>As mentioned at the beginning of this article, Faust has a lot of potential providing a vast amount of tools for Python developers to build real-time stream processing applications with a clean and simple API.</p><p>One of the best things is that it’s really <a href="https://faust.readthedocs.io/en/latest/faq.html#can-i-use-faust-with-django-flask-etc">easy to integrate Faust with very-well known tools</a> such as Django or Flask.</p><p>I hope you enjoyed the article and thanks for reading.</p><h3>Links</h3><ul><li><a href="https://faust.readthedocs.io/en/latest/index.html">https://faust.readthedocs.io/en/latest/index.html</a></li><li><a href="https://peony-twitter.readthedocs.io/">https://peony-twitter.readthedocs.io</a></li><li><a href="https://kafka.apache.org/">https://kafka.apache.org</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1102a03ed86c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Yoyo moves to Python 3]]></title>
            <link>https://medium.com/yoyo-engineering/yoyo-moves-to-python-3-df1d1692e694?source=rss-977222ad3baa------2</link>
            <guid isPermaLink="false">https://medium.com/p/df1d1692e694</guid>
            <category><![CDATA[yoyowallet]]></category>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[platform]]></category>
            <category><![CDATA[python-migration]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Ignacio Peluffo]]></dc:creator>
            <pubDate>Fri, 07 Jun 2019 10:02:19 GMT</pubDate>
            <atom:updated>2019-06-07T10:02:19.094Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*4f7o3_X0JRlYJ_DgCG7Ttg.png" /></figure><p>At Yoyo Wallet we build and power payment, loyalty, and marketing tools to provide best-in-class results for retailers and beautiful experiences for their customers.</p><p>We use Python as our main programming language for all our backend services using well-known tools like Django and Celery. Thanks to our distributed infrastructure, we can move faster with quick deploys having robust and very responsive services.</p><p>Also, we have a strong culture to use data as a driver so we’re continuously analysing our data with scientific tools like scikit-learn, Pandas, NumPy and other more specific tools for visualisation and data processing.</p><h3>Why did we decide to migrate?</h3><p>It was August of 2018 and many Yoyo services were still using Python 2.7. We knew that we needed to think of a good strategy to migrate to Python 3 since Python 2 was going to be deprecated at the end of 2019.</p><p>Also there are other important changes which require special planning for doing the migration, to name a few:</p><ul><li>Python 3 is backwards-incompatible</li><li>Integers division result type is float</li><li>Implied relative imports are invalid</li><li>Exception no longer have a message attribute</li></ul><p>We started discussing and comparing strategies for migrating our services. We immediately defined the most important requirement; to be able to write code that would be compatible with both versions of Python. This was critical since we knew only code written before the new forward-compatible code would require updates.</p><h3>Strategy</h3><p>After discussing some proposals, we agreed on a good strategy to do the migration which could be summarised in the following clear steps:</p><p>1. Upgrade dependencies to be compatible with Python 3</p><p>2. Migrate individual Django apps or modules using Modernize. We discarded the idea of using tools like 2to3 since they can potentially migrate code to be compatible only with Python 3.</p><p>Following is an example of how we used to do migrations of individual modules:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2a38f1f164e2601718448eb4d43ea7ad/href">https://medium.com/media/2a38f1f164e2601718448eb4d43ea7ad/href</a></iframe><p>3. Enable CI step to run linters to check code incompatible with Python 3 and make this step required just for the app or module migrated, this would guarantee that all new code would be forward compatible.</p><p>Example of how we setup the CI process to check for incompatible Python 3 code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9ae2822dbff996d8eeb0114261dd72b8/href">https://medium.com/media/9ae2822dbff996d8eeb0114261dd72b8/href</a></iframe><p>This configuration was updated for each module that was migrated.</p><p>4. Repeat steps 2 and 3 until the whole codebase is migrated.</p><p>5. Test services using Python 3.</p><p>6. Fix code incompatible with Python 3.</p><p>7. Deploy to pre-production environment.</p><p>8. Deploy to production.</p><p>The main advantage of this strategy was that the migration was mostly transparent to the team who could continue writing code compatible with Python 2 and 3 at the same time. This meant that the transition to Python 3 was never a blocker for our daily work and allowing us to write code in a good maintainable way.</p><p>Sometimes migrating code wasn’t easy as existing tests would fail. We needed to update the code to pass existing tests and add extra coverage for special cases around some of the major changes in Python 3. Examples of this include the use of unicode vs strings and object serialisation using pickle which is extensively used on Celery.</p><p>It is worth mentioning that the <a href="https://docs.python.org/3/howto/pyporting.html">official documentation</a> was very helpful and fundamental on taking decisions around which tools and how to do the transition.</p><p>Lastly, it is important to mention that having all our services running on Docker containers gave us great flexibility and made the transition and testing of Python 3 straightforward. We had the opportunity to replicate our production environment and do intensive testing before deploying the new version of Python.</p><h3>Lessons learned, problems and solutions</h3><p>Although the migration strategy worked very well and the transition to Python 3 was almost painless, there were some breaking changes that broke some of our services and dependencies (some could be updated but others needed to be replaced or removed completely), to name a few of the issues:</p><ul><li>Unicode vs string/bytes</li><li>Relative imports</li><li>Use of round</li><li>Celery and pickle different between Python 2 and 3</li></ul><p>The communication within the Engineering team was very important. First we communicated to everyone the importance and benefits of the migration and why everyone should focus on writing Python 3 compatible code. We also wrote handy documentation for everyone as a guide of advice on decisions when writing using Python 3 which ultimately allowed software developers to work more independently following conventions that we agreed on.</p><p>Having a good suite of tests is a key element on doing migration of this magnitude. At Yoyo, we encourage developers to make testable and reliable code writing unit and functional tests which gave us the confidence that the migration was going well and was going to work on production.</p><p>The deployment plan for the migration was simple since all the services were tested before moving to Python 3 in production. Having proper monitoring tools for all our services allowed us to track key metrics so we knew that everything was going well. One of the main difficulties we found was the change on serialisation using pickle and the incompatibility on Celery which led to some tasks failing. This required manual intervention where we replicated the failed tasks using the same data. Although the solution wasn’t straightforward, thanks to having an error tracking system in place that helped us to find issues in real time it was easier to monitor and get all the required information to replicate the tasks.</p><p>As an example of our monitoring, we expected to see an improvement on workers’ memory consumption, however the immediate effect was incredibly good and the long-term consumption was reduced by approximately 10% as shown in the following graph:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/0*ZPg_L_ktoxIO638F" /><figcaption>Memory consumption drop after migration to Python 3</figcaption></figure><p>Since we used Modernize, the tool added many references to the <a href="https://pypi.org/project/six/">six</a> library to make code Python 2/3 compatible. For this reason, after migrating our services to use the new version, we needed to do a cleanup of the code to replace the use of six by the native tools from the language.</p><p>Finally, our original plan was to migrate all projects to the last stable version available which at that moment was Python 3.7, however some libraries supported only up to Python 3.6. In the case of our main platform, we tried to use 3.7 but there were too many issues from dependencies or even non-working functionalities so we didn’t have any other option than sticking with version 3.6. On the other hand, we encourage to start new projects and migrate as much as possible to the last one.</p><h3>Resources</h3><p>Following are some important resources that we used in the process of migration that were very useful during the migration process:</p><ul><li><a href="https://docs.python.org/3/howto/pyporting.html">https://docs.python.org/3/howto/pyporting.html</a></li><li><a href="https://python-future.org/index.html">https://python-future.org/index.html</a></li><li><a href="https://portingguide.readthedocs.io/en/latest/">https://portingguide.readthedocs.io/en/latest/</a></li></ul><h3>Summary</h3><p>In summary, Yoyo developed software for three years using mostly Python 2 and thanks to the simple, clear migration steps and a lot of effort the main platform and some other projects were migrated 100% to Python 3 in approximately two months. I also want to highlight that the migration did not require downtime of our services and the idea of doing a migration in steps by migrating small parts of the code compatible with the new version and a crucial team effort were key for this to work.</p><p>Special thanks to <a href="https://medium.com/u/6ed57703a35e">Gary Evans</a>, <a href="https://medium.com/u/4e62ad3e2324">jianyuan</a> and <a href="https://medium.com/u/88edb565bb4">Mehdi Shahinmehr</a> for reviewing and giving feedback for this article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df1d1692e694" width="1" height="1" alt=""><hr><p><a href="https://medium.com/yoyo-engineering/yoyo-moves-to-python-3-df1d1692e694">Yoyo moves to Python 3</a> was originally published in <a href="https://medium.com/yoyo-engineering">Yoyo Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>