<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: CitizenK</title>
    <description>The latest articles on DEV Community by CitizenK (@citizenkot).</description>
    <link>https://dev.to/citizenkot</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F371718%2F250a4838-640c-4f67-b0bc-fa76ca293ead.png</url>
      <title>DEV Community: CitizenK</title>
      <link>https://dev.to/citizenkot</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/citizenkot"/>
    <language>en</language>
    <item>
      <title>Airflow UI with Role-Based Access Control</title>
      <dc:creator>CitizenK</dc:creator>
      <pubDate>Thu, 23 Apr 2020 04:17:07 +0000</pubDate>
      <link>https://dev.to/citizenkot/airflow-ui-with-role-based-access-control-1hi7</link>
      <guid>https://dev.to/citizenkot/airflow-ui-with-role-based-access-control-1hi7</guid>
      <description>&lt;p&gt;This is the continuation to the previous article on the &lt;a href="https://dev.to/citizenkot/apache-airflow-installation-mysql-celery-4n76"&gt;Apache Airflow Installation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To set up the Access control on the Airflow UI:&lt;/p&gt;

&lt;p&gt;a. Update the Configuration file &lt;br&gt;
airflow.cfg file (should be available in ~/airflow/ directory) with the below entry. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;rbac = True&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;b. run the below on your terminal&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;airflow&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;the above step will create webserver_config.py file in your $AIRFLOW_HOME location.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;most probably, you do not have to make any changes to the webserver_config.py file. If you want to make changes, please refer &lt;a href="http://flask-appbuilder.readthedocs.io/en/latest/security.html#authentication-methods"&gt;Authentication section of FAB docs&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Now, run the below commands on the terminal&lt;/p&gt;

&lt;p&gt;c. run &lt;strong&gt;airflow initdb&lt;/strong&gt;&lt;br&gt;
d. run &lt;strong&gt;airflow create_user -r 'admin' -u '' -e '' -f '' -l ''&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;e. now this will prompt you to enter the password for the user.&lt;/p&gt;

&lt;p&gt;Start/Restart the airflow webserver, scheduler, worker.&lt;/p&gt;

&lt;p&gt;tattadaa...&lt;/p&gt;

&lt;p&gt;Launch the airflow UI url, you will see the Login Screen!&lt;/p&gt;

</description>
      <category>python</category>
      <category>apacheairflow</category>
      <category>dataengineering</category>
    </item>
    <item>
      <title>Apache Airflow Installation - mysql+celery</title>
      <dc:creator>CitizenK</dc:creator>
      <pubDate>Wed, 22 Apr 2020 13:36:08 +0000</pubDate>
      <link>https://dev.to/citizenkot/apache-airflow-installation-mysql-celery-4n76</link>
      <guid>https://dev.to/citizenkot/apache-airflow-installation-mysql-celery-4n76</guid>
      <description>&lt;p&gt;pre requisites: python 3.7 or greater&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Execute the below ones one after another&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;pip install apache-airflow==1.10.6&lt;br&gt;
pip install 'apache-airflow[celery]'&lt;br&gt;
pip install 'apache-airflow[mysql]'&lt;br&gt;
brew install rabbitmq&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;start the rabbitmq-server in the background&lt;/strong&gt;&lt;br&gt;
rabbitmq-server -detached&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;make the mysql config changes&lt;/strong&gt;&lt;br&gt;
sudo chown -R _mysql:mysql /usr/local/var/mysql&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;start the mysql server&lt;/strong&gt;&lt;br&gt;
sudo mysql.server start&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;mysql setup&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;mysql -uroot&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;set the password for the root user with the below&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;mysql&amp;gt;ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;create the DB, the user and grant the required privileges&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;mysql&amp;gt;CREATE DATABASE airflow CHARACTER SET utf8 COLLATE utf8_unicode_ci;&lt;br&gt;
mysql&amp;gt;create user ‘airflow’@’localhost’ identified by ‘airflow’;&lt;br&gt;
mysql&amp;gt;grant all privileges on * . * to 'airflow'@'localhost';&lt;br&gt;
mysql&amp;gt;flush privileges;&lt;br&gt;
mysql&amp;gt;quit&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;airflow initialization&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;airflow initdb&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;airflow config file update&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Update the airflow.cfg file (should be available in &lt;code&gt;~/airflow/&lt;/code&gt; directory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;sql connection as:&lt;/strong&gt;&lt;br&gt;
sql_alchemy_conn = mysql://root:airflow@localhost/airflow&lt;br&gt;
there should be a sql alchemy connection string and you can comment it and add the above&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;executor as:&lt;/strong&gt;&lt;br&gt;
CeleryExecutor&lt;/p&gt;

&lt;p&gt;Save the file and exit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;run the below on their separate windows&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;airflow webserver&lt;br&gt;
airflow scheduler&lt;br&gt;
airflow worker&lt;/p&gt;

&lt;p&gt;airflow webserver window will show you the url for airflow UI. &lt;/p&gt;

&lt;p&gt;note: airflow initialization (airflow initdb) should load the example dags. You can turn them off in your airflow.cfg file, if you don't want to. command: load_examples = False&lt;/p&gt;

</description>
      <category>python</category>
      <category>apacheairflow</category>
      <category>dataengineering</category>
    </item>
  </channel>
</rss>
