<?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 Kingsley Abru on Medium]]></title>
        <description><![CDATA[Stories by Kingsley Abru on Medium]]></description>
        <link>https://medium.com/@kingsabru?source=rss-1f298e3ae5e8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*aJiAnnUIRyOC6Fj1WY85Cw.jpeg</url>
            <title>Stories by Kingsley Abru on Medium</title>
            <link>https://medium.com/@kingsabru?source=rss-1f298e3ae5e8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 02:28:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kingsabru/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 Airflow with SQLite Backend in Docker]]></title>
            <link>https://medium.com/@kingsabru/running-airflow-with-sqlite-backend-in-docker-a06b71b3c2a7?source=rss-1f298e3ae5e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/a06b71b3c2a7</guid>
            <category><![CDATA[data-orchestration]]></category>
            <category><![CDATA[apache-airflow]]></category>
            <category><![CDATA[sqlite]]></category>
            <category><![CDATA[docker-compose]]></category>
            <category><![CDATA[data-engineering]]></category>
            <dc:creator><![CDATA[Kingsley Abru]]></dc:creator>
            <pubDate>Thu, 11 Jan 2024 12:03:36 GMT</pubDate>
            <atom:updated>2024-01-11T14:40:36.128Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dPYagbr2YdNjp4npDwycDw.png" /><figcaption>Apache Airflow, SQLite and Docker</figcaption></figure><h3>WARNING</h3><p><strong>Do not use this in production</strong>. This should only be used for development or testing purposes.</p><h3>Introduction</h3><h4>What is Apache Airflow?</h4><p>Apache Airflow is an open-source workflow management platform for data engineering pipelines. Created in 2014, Airflow has become one of the leading Data Orchestration tools for Data Engineering and ML.</p><h4>Running Airflow in Docker</h4><p>If you want to test-run Airflow, the official <a href="https://airflow.apache.org/docs/apache-airflow/2.8.0/docker-compose.yaml">docker-compose.yml</a> lets you spin up all the required resources in Docker. This spins up Airflow with the recommended Postgres metadata backend.</p><p>For our use case, however, we will use SQLite as a replacement for Postgres as the metadata backend. SQLite is a lightweight database that is the default metadata backend for Airflow. It is however not recommended for production purposes.</p><p>Our main goal is to modify the <a href="https://airflow.apache.org/docs/apache-airflow/2.8.0/docker-compose.yaml">docker-compose.yml</a> to use SQLite instead of Postgres. We achieve this by attaching a volume to the Airflow containers. The final result can be found in <a href="https://github.com/kingsabru/airflow-sqlite-docker-compose">this repo</a>.</p><h4>Notice</h4><ul><li>All instructions here are based on the official Airflow docs for <a href="https://airflow.apache.org/docs/apache-airflow/2.8.0/howto/docker-compose/index.html">Deploying Airflow in Docker</a>.</li><li>The instructions are based on <strong>Airflow version 2.8.0</strong>. However, the instructions can apply to all versions 2.x.x with minor modifications.</li></ul><h3>Pre-requisites</h3><ul><li><a href="https://docs.docker.com/engine/install/">Docker</a></li></ul><h3>Instructions</h3><p>There are two methods for running Airflow in Docker. Go with <em>Option 1</em> if you do not need a custom image or require custom Python packages. You should use <em>Option 2</em> to build a custom image or require custom Python packages.</p><h4>Clone Repository</h4><p>Clone <a href="https://github.com/kingsabru/airflow-sqlite-docker-compose.git">this repo</a>. This will give you the boilerplate to proceed. Note that the <strong>docker-compose.yml</strong> file is a modified version of the official Airflow <a href="https://airflow.apache.org/docs/apache-airflow/2.8.0/docker-compose.yaml">docker-compose.yml</a></p><pre>git clone https://github.com/kingsabru/airflow-sqlite-docker-compose.git</pre><h4>Initial Setup</h4><p>The init.sh script will create the supporting folders and .env file.</p><ul><li>Make init.sh executable: chmod +x init.sh</li><li>Run init.sh: ./init.sh</li></ul><p>Once done, your folder structure should look like this:</p><pre>├── config<br>├── dags<br>│   └── example_dag.py<br>├── db<br>├── logs<br>├── plugins<br>├── .env<br>├── .env.example<br>├── .gitignore<br>├── docker-compose.yml<br>├── Dockerfile<br>├── init.sh<br>├── README.md<br>└── requirements.txt</pre><h4>(Option 1) Airflow without Custom Image</h4><p>Step 1: Start docker containers: docker compose up -d</p><h4>(Option 2) Airflow with Custom Image</h4><p>Step 1: Update the docker-compose.yml. Comment the line image: ${AIRFLOW_IMAGE_NAME:-apache/airflow:2.8.0} and uncomment the line build: .</p><p>Step 2: (Optional) Update the Dockerfile as necessary. A common change you can make is to modify the Airflow version.</p><p>Step 3: (Optional) Add custom Python packages to the requirements.txt file. Airflow plugins hosted on Pypi can also be added here.</p><p>Step 4: Build a custom Docker image: docker compose build</p><p>Step 5: Start docker containers: docker compose up -d. Alternatively, you can build and start the container automatically using the command: docker compose up --build -d</p><h4>Login to Airflow UI</h4><p>Step 1: Go to <a href="http://localhost:8080/">http://localhost:8080</a></p><p>Step 2: Log in with the username and password. The default username and password are airflow and airflow, respectively.</p><h4>(Optional) Configure Connection on Airflow UI</h4><ul><li>Click on the + icon to add a new record.</li><li>For Connection Type, choose the type of connection from the drop-down.</li><li>Input a Connection Id value. This will be the name of the connection. Example: clickhouse_conn</li><li>Fill in the rest of the fields as necessary.</li></ul><h4>(Optional) Create DAG</h4><p>New DAGs should be created in the ./dags folder. Simply create a .py Python file and write the logic for the DAG. The result will be visible on the Airflow UI homepage when the file is saved.</p><h4>Tear down deployment</h4><ul><li>Destroy Docker container: docker compose down --volumes --remove-orphans</li><li>Delete the ./db/airflow.db file.</li></ul><h3>Limitations</h3><p>You can only use <strong>SequentialExecutor</strong> when using SQLite as a metadata backend for Airflow. If you need a different Executor, reference the official Airflow Docs for <a href="https://airflow.apache.org/docs/apache-airflow/2.8.0/howto/docker-compose/index.html">Running Airflow in Docker</a>.</p><h3>GitHub Repo</h3><p><a href="https://github.com/kingsabru/airflow-sqlite-docker-compose">GitHub - kingsabru/airflow-sqlite-docker-compose: Docker Compose for deploying Airflow with SQLite metadata backend</a></p><h3>References</h3><ul><li><a href="https://airflow.apache.org/docs/apache-airflow/2.8.0/howto/docker-compose/index.html">Running Airflow in Docker</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a06b71b3c2a7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Ingestion with PipelineWise and Airflow]]></title>
            <link>https://blog.devgenius.io/data-ingestion-with-pipelinewise-and-airflow-cdc69f72148f?source=rss-1f298e3ae5e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/cdc69f72148f</guid>
            <category><![CDATA[airflow]]></category>
            <category><![CDATA[data-pipeline]]></category>
            <category><![CDATA[data-ingestion]]></category>
            <category><![CDATA[data-extraction]]></category>
            <category><![CDATA[data-engineering]]></category>
            <dc:creator><![CDATA[Kingsley Abru]]></dc:creator>
            <pubDate>Mon, 12 Sep 2022 19:06:12 GMT</pubDate>
            <atom:updated>2022-10-07T10:45:10.389Z</atom:updated>
            <content:encoded><![CDATA[<p>Welcome to my first article! I guess you stumbled upon this guide because there are few resources of PipelineWise on the internet. I’m hoping this guide helps you achieve your goal with PipelineWise.</p><p>So let’s get right to the point!</p><h3>PipelineWise and Airflow</h3><figure><img alt="PipelineWise Connectors" src="https://cdn-images-1.medium.com/max/1024/1*CAmdJNjYiqdSuQXY_5gFBQ.png" /><figcaption>PipelineWise Connectors (source: PipelineWise Documentation)</figcaption></figure><p><a href="https://transferwise.github.io/pipelinewise/index.html">PipelineWise </a>is an open-source data ingestion tool created by <a href="https://wise.com/gb/blog/world-meet-wise">TransferWise (now called Wise)</a> in 2018. Built on top of the <a href="https://www.singer.io/">Singer.io</a> specification, PipelineWise allows you to configure pipelines as code in YAML files. In the ELT paradigm, PipelineWise plays a similar role to Airbyte, Meltano, and Stitch on the Extraction side of data pipelines.</p><p><a href="https://airflow.apache.org/">Airflow </a>is a popular scheduling and data orchestration tool for creating complex workflows as DAGs. Popular for Data Engineering pipelines, Airflow was created by AirBnB in 2014.</p><p>The goal of using these two tools in this guide is to:<br>1. Using PipelineWise, define data extraction configurations for moving data from a source DB to a destination DW. <br>2. Schedule the extraction pipelines to run based on an interval on Airflow.</p><h3>Assumptions</h3><p>Before proceeding with this guide, the author assumes the reader:<br>- Has basic knowledge of Unix/Linux Bash CLI commands. We will use Ubuntu for this guide.<br>- Has Airflow setup and is comfortable working with DAGs.<br>- Has basic understanding of Docker and containers.<br>- Understands data replication concepts such as full load, incremental load, and log-based load (CDC).</p><p>These concepts will be used in this guide. However, they are beyond the scope of this article if they are new to you. You can still proceed without facing many challenges. Do note that errors faced with the listed concepts will have to be resolved in their respective domains.</p><h3>Setting up Pipelinewise</h3><p>PipelineWise can be installed by building from source code or using Docker. For our use case, Docker is the simpler approach to installing PipelineWise.</p><p>First, verify if Docker is installed with the docker info command, or else <a href="https://docs.docker.com/engine/install/ubuntu/">install Docker Engine for Ubuntu</a>.</p><p>Second, run the following commands to clone the PipelineWise repo and build the docker image:</p><pre>$ git clone https://github.com/transferwise/pipelinewise.git<br>$ cd ./pipelinewise<br>$ docker build --no-cache -t pipelinewise:latest .</pre><p>Third, create an alias forthe pipelinewise-docker entrypoint. This will allow us to use the pipelinewise commands without specifying the full path. Add this line of code to your ~/.bashrc : alias pipelinewise=&#39;&lt;fullpath&gt;/bin/pipelinewise-docker&#39; . Replace &lt;fullpath&gt; with the full path to the cloned PipelineWise installation folder. You can source ~/.bashrc to effect your changes:</p><pre>$ vi ~\.bashrc<br>$ source ~\.bashrc</pre><p>Finally, verify that the installation is successful with the pipelinewise status command. If there is no error message, you will see an output about Tap ID, Tap Type, Target ID, and co:</p><pre>$ pipelinewise status</pre><h3>Creating a Pipeline</h3><p>A “pipeline” in PipelineWise is basically a configuration to load data from a “tap” or source to a “target” or destination. These configurations are defined in YAML templates.</p><p>Start by initializing a new project. This will create a folder containing sample config YAML files for all the supported connectors:</p><pre>$ pipelinewise init --name samples</pre><p>Next, you will copy a sample for your tap (same as source) and target (same as destination). For this demo, my taps will be <a href="https://transferwise.github.io/pipelinewise/connectors/taps/mysql.html">MySQL</a> and <a href="https://transferwise.github.io/pipelinewise/connectors/taps/postgres.html">PostgreSQL</a>, and my target will be <a href="https://transferwise.github.io/pipelinewise/connectors/targets/redshift.html">Redshift</a>:</p><pre>$ mv /samples/tap_mysql_mariadb.yml.sample tap_mysql_one.yml<br>$ mv /samples/tap_postgres.yml.sample tap_postgres_one.yml<br>$ mv /samples/target_redshift.yml.sample  target_redshift.yml</pre><p>Now you can modify the config YAML files with a text editor of choice. You can check the documentation for <a href="https://transferwise.github.io/pipelinewise/installation_guide/creating_pipelines.html#example-replication-mysql-to-snowflake">a real example</a>.</p><p>When done, your project structure should look like this:</p><pre>└── pipelinewise_samples<br>    ├── samples<br>    ├── .gitignore<br>    ├── README.md<br>    ├── tap_mysql_connectel.yml<br>    ├── tap_mysql_odoo_erp.yml<br>    ├── target_redshift.yml</pre><h4>Encrypting Passwords (Optional)</h4><p>PipelineWise uses the Ansible Vault python library for encrypting secrets used in the config YAML files. First, you will create a file containing the master password. You can then hash any secret string (e. g. DB password) with the master password file and add it to the config YAML file.</p><p>To create a master password file, use the command:</p><pre>$ echo &quot;M@st3rP@ssw0rd&quot; &gt; vault-password.txt</pre><p>To hash a secret string with the master password, use the command:</p><pre>$ pipelinewise encrypt_string --secret vault-password.txt --string &quot;D@t@baZEpassMord&quot;</pre><p>You can then copy and paste the encrypted secret into your config YAML file. Find more details about encrypting secrets in the documentation <a href="https://transferwise.github.io/pipelinewise/user_guide/encrypting_passwords.html">here</a>.</p><h3>Importing YAML Configurations</h3><p>Whenever a config YAML file is <strong>created or modified</strong>, it has to be imported before it can be used. The pipelinewise import command generates JSON files in the current user’s ~/.pipelinewise directory. The JSON files are used by the Singer component.</p><p>To import config YAML files in your current directory, use the . directory character. <em>This command should work for you if you’ve been following my approach so far.</em></p><pre>$ pipleinewise import --dir .</pre><p>To import config YAML files in a different directory, specify the path to that directory:</p><pre>$ pipleinewise import --dir ~/documents/pipelinewise_project/</pre><p><strong>If <em>any</em> of the config YAML files contains a hashed password</strong>, add the --secret argument to the command:</p><pre>$ pipleinewise import --dir . --secret vault-password.txt</pre><p>Once the config YAML files are imported, you can verify the pipelines with the pipelinewise status command.</p><h3>Running a Pipeline</h3><p>First, check the list of imported pipelines with the command:</p><pre>$ pipelinewise status</pre><p>You can trigger a pipeline to run with the pipelinewise run_tap command. You will have to specify a <strong>tap_id</strong> and a <strong>target_id</strong> and it follows this format:</p><pre>$ pipelinewise run_tap --tap &lt;TAP-ID&gt; --target &lt;TARGET-ID&gt;</pre><p>You can then trigger a pipeline with the example command:</p><pre>$ pipelinewise run_tap --tap mysql-one --target company-warehouse</pre><p>This will load your data based on the config YAML files imported. By default, PipelineWise will use the <a href="https://transferwise.github.io/pipelinewise/concept/fastsync.html#">FastSync</a> component for <em>faster </em>initial loads. Future loads based on your <a href="https://transferwise.github.io/pipelinewise/concept/replication_methods.html">replication method</a> will then use Singer component.</p><h3>Scheduling with Airflow</h3><p>The simplest way to orchestrate PipelineWise pipelines is with Unix Cron jobs. However, if you’re working in an enterprise setting with complex data workflows, you will need an orchestrator like Airflow.</p><p>To schedule PipelineWise pipelines in Airflow, you will need to:<br>- Specify the full path to the pipelinewise-docker entrypoint. This is because Airflow can’t recognize the pipelinewisecommand.<br>- Use the BashOperator</p><p>A sample DAG is shown in the Github Gist below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c2713977927d84c9e1645fc166dde99e/href">https://medium.com/media/c2713977927d84c9e1645fc166dde99e/href</a></iframe><p>Voila! Just refresh your Airflow UI and run the DAG as usual.</p><h3>PipelineWise Hiccups</h3><p>As of PipelineWise version 0.48.3, the FastSync component is not fully compatible with MySQL 8. Some of the issues I faced were DB connection issues, hashed password issues and unsuccessful data types resolution. This only affects initial loads, since FastSync is used.</p><p>This is currently being worked on and will possibly be fixed. The Singer component however works fine for subsequent loads.</p><h3>Conclusion</h3><p>I got to work with PipelineWise because my company has been using it for years and I had to start maintaining it. Initially, I wanted to switch to Airbyte, but I also wanted to understand how PipelineWise works. Between the two, however, I do like the point-blank YAML config files of PipelineWise.</p><p>For newbies to data extraction tools, Airbyte or Meltano are good alternatives. They are simpler to configure, offer more connectors, and have more maintainers. If you’re working with the common connectors and are comfortable with configuration code, then PipelineWise will serve you well.</p><p>Congratulations on coming this far, and good luck on your data journey!</p><h3>Documentation</h3><ul><li><a href="https://transferwise.github.io/pipelinewise/index.html">https://transferwise.github.io/pipelinewise/index.html</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cdc69f72148f" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/data-ingestion-with-pipelinewise-and-airflow-cdc69f72148f">Data Ingestion with PipelineWise and Airflow</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>