<?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 Shiv Deshmukh on Medium]]></title>
        <description><![CDATA[Stories by Shiv Deshmukh on Medium]]></description>
        <link>https://medium.com/@shivdesh?source=rss-f051667cf967------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*EO-frUOurGO-NYsVTr4SIQ.jpeg</url>
            <title>Stories by Shiv Deshmukh on Medium</title>
            <link>https://medium.com/@shivdesh?source=rss-f051667cf967------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 09:07:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shivdesh/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[5 Reasons DevOps Should Integrate Apache Airflow & Great Expectations]]></title>
            <link>https://medium.com/cisco-fpie/5-reasons-devops-should-integrate-apache-airflow-great-expectations-9427a177da7b?source=rss-f051667cf967------2</link>
            <guid isPermaLink="false">https://medium.com/p/9427a177da7b</guid>
            <category><![CDATA[great-expectations]]></category>
            <category><![CDATA[data-pipeline]]></category>
            <category><![CDATA[apache-airflow]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Shiv Deshmukh]]></dc:creator>
            <pubDate>Mon, 16 May 2022 22:20:20 GMT</pubDate>
            <atom:updated>2022-05-24T21:34:10.058Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*pwf48cKQ2coB_1Seb6Rs7A.png" /></figure><p>Data pipelines can present numerous challenges for DevOps. This is because the more data pipelines you work with, the higher the risk that your data will become difficult to manage.</p><p>As we know, data is not static. It changes constantly, and it must be validated continuously to ensure that data quality issues don’t destroy whichever pipelines you are feeding your data through. You must also be able to react quickly to problems with your data in order to avoid disrupting workflows.</p><h3>Introducing Great Expectations and Apache Airflow</h3><p>Fortunately, the open source community has built some great tools to solve this challenge.</p><p>One is <a href="https://greatexpectations.io/">Great Expectations</a>, an open-source software used for vetting data quality. Great Expectations data validation helps teams avoid bad data propagate in the pipeline through data testing, documentation and profiling.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/0*T14yB_c4Lg32Qy4n.png" /></figure><p>Great Expectations in a real-world data pipeline.</p><p>Another tool is <a href="https://airflow.apache.org/">Apache Airflow</a>, which lets you programmatically author, schedule and monitor data workflows. Airflow provides an orchestration and management framework for integrating data pipelines with DevOps tasks. It supports any type of mainstream environment — containers, public cloud, VMs and so on.</p><p>You can use Great Expectations and Airflow separately. But to maximize your ability to keep your data pipelines moving efficiently, you should integrate these tools together. Here are 5 reasons these tools should be integrated.</p><h3>Catch data issues early on</h3><p>The concept of <a href="https://devops.com/devops-shift-left-avoid-failure/">“shifting left”</a> — which means catching issues early, when they are easier to resolve — is central to the DevOps methodology.</p><p>Integrating Great Expectations and Airflow helps DevOps teams apply this principle to data pipelines. It lets you identify issues earlier in the pipeline, ensuring that only validated data is passed into the next stage of the workflow. Instead of waiting to discover that data quality issues have broken your workflow, you can detect and resolve them as early as possible, significantly increasing efficiency.</p><h3>Achieve greater precision</h3><p>By using Great Expectations and Airflow together, you can see exactly where in a workflow data issues lie. In turn, you can fix the data efficiently. Instead of having to guess how low-quality data impacts your workflow, you can pinpoint the relationship between problematic data and workflow tasks, then remedy it directly. This means that the workflow will proceed smoothly as planned without being impacted by data-quality issues.</p><h3>Avoid pipeline-wide searches</h3><p>The Airflow dashboard displays each particular task and task failure automatically. That means there is no need to search through your entire pipeline when troubleshooting workflow issues or understanding the state of data within your workflow. By automatically identifying exactly where the data issue lies, you can take the appropriate steps to remedy it in a timely manner.</p><h3>Minimize failure risks</h3><p>When you use Great Expectations and Airflow together, you can be confident that each new step in your workflow will be executed only after the data it depends on has been validated from a quality perspective.</p><p>This means you can limit the potential for failure and clean up errors that would result in incorrect data filtering through your directed acyclic graph (DAG).</p><h3>Create scalable pipelines</h3><p>Data pipelines built with Airflow are highly scalable, and Great Expectations data validation helps you double-down on scalability, no matter how much data you have to work with.</p><p>So, no matter the quantity of your data, Airflow and Great Expectations ensure that you can operate efficiently and at scale.</p><h3>Conclusion</h3><p>Although integration between Great Expectations data validation and Apache Airflow is relatively new, there are excellent reasons to use the tools in tandem. Doing so exponentially increases the value that you could achieve by using either tool on its own. By automatically validating data in your pipeline, you ensure that DevOps time is used more efficiently, rather than having to manually check for data quality issues. This allows you to focus more on development, rather than worrying about data quality in the pipelines.</p><p>Learn how to integrate the tools in this <a href="https://shivdesh.medium.com/optimize-your-data-pipeline-with-apache-airflow-and-great-expectations-8d378e70db6a?source=your_stories_page-------------------------------------">blog post</a>, which walks through the process step-by-step.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9427a177da7b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cisco-fpie/5-reasons-devops-should-integrate-apache-airflow-great-expectations-9427a177da7b">5 Reasons DevOps Should Integrate Apache Airflow &amp; Great Expectations</a> was originally published in <a href="https://medium.com/cisco-fpie">cisco-fpie</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Optimize Your Data Pipeline with Apache Airflow and Great Expectations]]></title>
            <link>https://medium.com/cisco-fpie/optimize-your-data-pipeline-with-apache-airflow-and-great-expectations-8d378e70db6a?source=rss-f051667cf967------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d378e70db6a</guid>
            <category><![CDATA[data-pipeline]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[apache-airflow]]></category>
            <category><![CDATA[great-expectations]]></category>
            <category><![CDATA[application]]></category>
            <dc:creator><![CDATA[Shiv Deshmukh]]></dc:creator>
            <pubDate>Mon, 16 May 2022 22:17:02 GMT</pubDate>
            <atom:updated>2022-05-17T14:16:40.603Z</atom:updated>
            <content:encoded><![CDATA[<p>If you build or maintain applications that rely on data, there’s a decent chance you’re familiar with both Apache Airflow and Great Expectations.</p><p><a href="https://airflow.apache.org/">Apache Airflow</a> is an open source tool that helps DevOps teams build and manage workflows programmatically. It can help drive data pipelines by using standard Python features to define complex workflow requirements as Directed Acyclic Graphs, or DAGs, then execute those workflows automatically.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/346/0*C-TCUhaFSHa1MTRO.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*GxS_J9X9NrZ8kKZr.png" /></figure><p><a href="https://greatexpectations.io/">Great Expectations</a>, which is also open source, is a data validation tool. Engineers can use it to define data testing, documentation and profiling requirements which data must pass before it is moved down the workflow pipeline. It also flags data quality errors so that teams can remedy them before progressing to the next step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*x46TIqsLF8d0dswe.png" /></figure><h3>Combining Apache Airflow with Great Expectations data</h3><p>You can use Airflow and Great Expectations separately. But wouldn’t it be great if you could integrate them in such a way that they work seamlessly in tandem, with Airflow defining data pipeline flows and Great Expectations automatically validating data as it moves according to those flows? Well, you can, and this blog shows you how.</p><p>By integrating Airflow and Great Expectations, you not only save time, but you can also validate data quality automatically within a database. You can find data errors faster, reduce the occurrence of data quality issues that may slow down your data pipeline, and minimize the manual effort that your engineers spend managing data quality and movement.</p><p>Keep reading for a step-by-step guide to using Airflow and Great Expectations in tandem.</p><h3>Step 1: Set up Great Expectations</h3><p>We’ll start by installing and configuring Great Expectations.</p><p>We will use simple MySQL DB “world_x” containing four tables country, city, countrylanguage, countryinfo listed here:</p><p><a href="https://dev.mysql.com/doc/world-x-setup/en/">https://dev.mysql.com/doc/world-x-setup/en/</a></p><p>Follow the instructions above to set it up on your local host and port 3306</p><p>With our MySQL database set up, let’s install Great Expectations. Here’s a Bash script (ge.sh) that will do everything you require.</p><pre><strong>#!/bin/bash</strong></pre><pre>## Database Credentials<br>world_db_host=&quot;localhost&quot;<br>port=&quot;3306&quot;<br>username=&quot;demo_user&quot;<br>password=&quot;demo_pass&quot;<br>world_db=&quot;world_x&quot;</pre><pre>printf &quot;Setting up Great Expectations for UMP...\n\n&quot;</pre><pre>printf &quot;Using following Database config:\n&quot;<br>printf &quot;HOST: %s\n&quot; &quot;$world_db_host&quot;<br>printf &quot;PORT: %s\n&quot; &quot;$port&quot;<br>printf &quot;USERNAME: %s\n&quot; &quot;$username&quot;<br>printf &quot;DATABASE: %s\n&quot; &quot;$world_db&quot;</pre><pre>printf &quot;Remove existing GE dirs, if exists...\n\n&quot;<br>rm -rf great_expectations</pre><pre>printf &quot;Setting up Python venv...\n\n&quot;<br>python3 -m venv venv<br>source ./venv/bin/activate</pre><pre>printf &quot;Installing required GE pip packages...\n\n&quot;<br>python3 -m pip install --upgrade pip<br>pip3 install great_expectations<br>pip3 install pymysql<br>pip3 install sqlalchemy<br>pip3 install jupyterlab<br>pip3 install notebook</pre><pre>printf &quot;\nGE is up with version:\n&quot;<br>great_expectations --version</pre><pre>printf &quot;Initializing GE and datasource...\n\n&quot;<br>/usr/bin/expect -c &#39;<br>spawn great_expectations --v3-api init<br>expect -re {OK to proceed?} {send &quot;Y\r&quot;}<br>send &quot;great_expectations --v3-api datasource new\n&quot;<br>expect -re &quot;:&quot;<br>send &quot;2\r&quot;<br>expect -re &quot;:&quot;<br>send &quot;1\r&quot;<br>&#39;<br>ls -l</pre><pre>printf &quot;Setting up MySQL Data Sources...\n\n&quot;<br>python3 setup_datasources.py world_db_datasource $world_db_host $port $username $password $world_db</pre><pre>printf &quot;Setting up Expectations Suites for world_x DB...\n\n&quot;<br>python3 setup_expectations.py world_db_city_expectation world_db_datasource city ID,Name,CountryCode,District,Info<br>python3 setup_expectations.py world_db_country_expectation world_db_datasource country Code,Name,Capital,Code2,Covid_Hotspot<br>python3 setup_expectations.py world_db_countryinfo_expectation world_db_datasource countryinfo doc,_id,_json_schema<br>python3 setup_expectations.py world_db_countrylanguage_expectation world_db_datasource countrylanguage CountryCode,Language,IsOfficial,Percentage</pre><pre>printf &quot;Setting up checkpoints for world_x DB...\n\n&quot;<br>python3 setup_checkpoints.py world_db_city_checkpoint world_db_city_expectation world_db_datasource city<br>python3 setup_checkpoints.py world_db_country_checkpoint world_db_country_expectation world_db_datasource country<br>python3 setup_checkpoints.py world_db_countryinfo_checkpoint world_db_countryinfo_expectation world_db_datasource countryinfo<br>python3 setup_checkpoints.py world_db_countrylanguage_checkpoint world_db_countrylanguage_expectation world_db_datasource countrylanguage</pre><pre>printf &quot;Setting up s3_site locations for GE...\n\n&quot;<br>sed -i &quot;&quot; &quot;/class_name: DefaultSiteIndexBuilder/r s3_site.txt&quot; great_expectations/great_expectations.yml<br>sed -i &quot;&quot; &quot;s/site_names: \[\]/site_names: \[\&quot;local_site\&quot;\, \&quot;s3_site\&quot;\]/g&quot; great_expectations/checkpoints/*.yml</pre><pre>printf &quot;Listing all checkpoints...\n\n&quot;<br>great_expectations checkpoint list</pre><p>Specifically, this script does the following:</p><ul><li>Install required packages.</li><li>Initialize great_expectations.</li><li>Creates new datasource for MySQL using python script setup_datasources.py</li><li>and locally hosted “world_x” DB .</li><li>Creates expectations for each table in the DB using python script setup_expectations.py</li><li>Create checkpoints for each table in the database using the setup_checkpoints.py script.</li></ul><p>You’ll notice that the script references a configuration file called S3_site.txt. This script stores the S3 bucket name where you’ll store Great Expectations data:</p><pre>s3_site:<br>  class_name: SiteBuilder<br>  store_backend:<br>    class_name: TupleS3StoreBackend<br>    bucket: greatexpectations-s3<br>  site_index_builder:<br>    class_name: DefaultSiteIndexBuilder</pre><p>Once setup is complete, you should see the following data_docs sites (local and s3) added in your great_expectations.yml file:</p><pre>data_docs_sites:<br>  local_site:<br>    class_name: SiteBuilder<br>    show_how_to_buttons: <strong>true</strong><br>    store_backend:<br>      class_name: TupleFilesystemStoreBackend<br>      base_directory: uncommitted/data_docs/local_site/<br>    site_index_builder:<br>      class_name: DefaultSiteIndexBuilder<br>  s3_site:<br>    class_name: SiteBuilder<br>    store_backend:<br>      class_name: TupleS3StoreBackend<br>      bucket: ump-greatexpectations-s3<br>    site_index_builder:<br>      class_name: DefaultSiteIndexBuilder</pre><p>Note that this ge.sh script calls additional Python scripts to complete installation. One is setup_datasources.py, which looks like this:</p><pre>import sys<br>import great_expectations as ge<br>from great_expectations.cli.datasource import sanitize_yaml_and_save_datasource, check_if_datasource_name_exists<br>context = ge.get_context()</pre><pre>print(sys.argv)<br>datasource_name = sys.argv[1]<br>host = sys.argv[2]<br>port = sys.argv[3]<br>username = sys.argv[4]<br>password = sys.argv[5]<br>database = sys.argv[6]</pre><pre>example_yaml = f&quot;&quot;&quot;<br>name: {datasource_name}<br>class_name: Datasource<br>execution_engine:<br>  class_name: SqlAlchemyExecutionEngine<br>  credentials:<br>    host: {host}<br>    port: &#39;{port}&#39;<br>    username: {username}<br>    password: {password}<br>    database: {database}<br>    drivername: mysql+pymysql<br>data_connectors:<br>  default_runtime_data_connector_name:<br>    class_name: RuntimeDataConnector<br>    batch_identifiers:<br>      - default_identifier_name<br>  default_inferred_data_connector_name:<br>    class_name: InferredAssetSqlDataConnector<br>    name: whole_table&quot;&quot;&quot;<br>print(example_yaml)</pre><pre>context.test_yaml_config(yaml_config=example_yaml)</pre><pre>sanitize_yaml_and_save_datasource(context, example_yaml, overwrite_existing=False)<br>context.list_datasources()</pre><p>Another is setup_expectations.py:</p><pre>import sys</pre><pre>from great_expectations.checkpoint import SimpleCheckpoint<br>from great_expectations.profile.user_configurable_profiler import UserConfigurableProfiler</pre><pre>import great_expectations as ge<br>from great_expectations.core.batch import BatchRequest<br>from great_expectations.data_context.types.resource_identifiers import ExpectationSuiteIdentifier<br>from great_expectations.exceptions import DataContextError</pre><pre>print(sys.argv)<br>expectation_suite_name = sys.argv[1]<br>datasource_name = sys.argv[2]<br>data_asset_name = sys.argv[3]<br>ignored_columns = sys.argv[4].split(&#39;,&#39;)<br>open_data_docs = sys.argv[5] if len(sys.argv) &gt;= 6 else &#39;false&#39;</pre><pre>context = ge.data_context.DataContext()</pre><pre>try:<br>    suite = context.get_expectation_suite(expectation_suite_name=expectation_suite_name)<br>    print(<br>        f&#39;Loaded ExpectationSuite &quot;{suite.expectation_suite_name}&quot; containing {len(suite.expectations)} expectations.&#39;)<br>except DataContextError:<br>    suite = context.create_expectation_suite(expectation_suite_name=expectation_suite_name)<br>    print(f&#39;Created ExpectationSuite &quot;{suite.expectation_suite_name}&quot;.&#39;)</pre><pre>print(context.get_expectation_suite(expectation_suite_name=expectation_suite_name))<br>context.save_expectation_suite(expectation_suite=suite, expectation_suite_name=expectation_suite_name)</pre><pre>suite_identifier = ExpectationSuiteIdentifier(expectation_suite_name=expectation_suite_name)<br>context.build_data_docs(resource_identifiers=[suite_identifier])</pre><pre>batch_request = {&#39;datasource_name&#39;: datasource_name, &#39;data_connector_name&#39;: &#39;default_inferred_data_connector_name&#39;,<br>                 &#39;data_asset_name&#39;: data_asset_name, &#39;limit&#39;: 1000}</pre><pre>validator = context.get_validator(<br>    batch_request=BatchRequest(**batch_request),<br>    expectation_suite_name=expectation_suite_name<br>)<br>column_names = [f&#39;&quot;{column_name}&quot;&#39; for column_name in validator.columns()]<br>print(f&quot;Columns: {&#39;, &#39;.join(column_names)}.&quot;)<br>validator.head(n_rows=5, fetch_all=False)</pre><pre>profiler = UserConfigurableProfiler(<br>    profile_dataset=validator,<br>    excluded_expectations=None,<br>    ignored_columns=ignored_columns,<br>    not_null_only=False,<br>    primary_or_compound_key=False,<br>    semantic_types_dict=None,<br>    table_expectations_only=False,<br>    value_set_threshold=&quot;MANY&quot;,<br>)<br>suite = profiler.build_suite()</pre><pre># Additional Expectations<br>for x in range(len(ignored_columns)):<br>    validator.expect_column_values_to_not_be_null(column=ignored_columns[x])</pre><pre>print(validator.get_expectation_suite(discard_failed_expectations=False))<br>validator.save_expectation_suite(discard_failed_expectations=False)</pre><pre>checkpoint_config = {<br>    &quot;class_name&quot;: &quot;SimpleCheckpoint&quot;,<br>    &quot;run_name_template&quot;: &quot;%Y%m%d-%H%M%S-&quot; + expectation_suite_name,<br>    &quot;validations&quot;: [<br>        {<br>            &quot;batch_request&quot;: batch_request,<br>            &quot;expectation_suite_name&quot;: expectation_suite_name<br>        }<br>    ]<br>}<br>checkpoint = SimpleCheckpoint(<br>    f&quot;_tmp_checkpoint_{expectation_suite_name}&quot;,<br>    context,<br>    **checkpoint_config<br>)<br>checkpoint_result = checkpoint.run()</pre><pre>context.build_data_docs()</pre><pre>validation_result_identifier = checkpoint_result.list_validation_result_identifiers()  # [0]<br>if open_data_docs == &#39;true&#39;:<br>    context.open_data_docs()</pre><p>Finally, we have setup_checkpoints.py:</p><pre>from ruamel.yaml import YAML<br>import great_expectations as ge<br>from pprint import pprint<br>import sys</pre><pre>yaml = YAML()<br>context = ge.get_context()</pre><pre>print(sys.argv)<br>my_checkpoint_name = sys.argv[1]<br>expectation_suite_name = sys.argv[2]<br>datasource_name = sys.argv[3]<br>data_asset_name = sys.argv[4]<br>open_data_docs = sys.argv[5] if len(sys.argv) &gt;= 6 else &#39;false&#39;</pre><pre>yaml_config = f&quot;&quot;&quot;<br>name: {my_checkpoint_name}<br>config_version: 1.0<br>class_name: SimpleCheckpoint<br>run_name_template: &quot;%Y%m%d-%H%M%S-{my_checkpoint_name}&quot;<br>validations:<br>  - batch_request:<br>      datasource_name: {datasource_name}<br>      data_connector_name: default_inferred_data_connector_name<br>      data_asset_name: {data_asset_name}<br>      data_connector_query:<br>        index: -1<br>    expectation_suite_name: {expectation_suite_name}<br>&quot;&quot;&quot;<br>print(yaml_config)</pre><pre># Run this cell to print out the names of your Data Sources, Data Connectors and Data Assets<br>pprint(context.get_available_data_asset_names())</pre><pre>context.list_expectation_suite_names()</pre><pre>my_checkpoint = context.test_yaml_config(yaml_config=yaml_config)</pre><pre>print(my_checkpoint.get_substituted_config().to_yaml_str())<br>context.add_checkpoint(**yaml.load(yaml_config))</pre><pre>context.run_checkpoint(checkpoint_name=my_checkpoint_name)</pre><pre>if open_data_docs == &#39;true&#39;:<br>    context.open_data_docs()</pre><p>How to Execute</p><ul><li>Copy all files (ge.sh, s3_site.txt, setup_datasources.py, setup_expectations.py, setup_checkpoints.py) in the same directory.</li><li>Execute ge.sh script which will do all the required setup and creates necessary great_expectation’s new Data Context to hold your project configuration.</li></ul><p>Great Expectations will create a new directory with the following structure:</p><pre>great_expectations<br>|-- great_expectations.yml<br>|-- expectations<br>|-- checkpoints<br>|-- plugins<br>|-- .gitignore<br>|-- uncommitted<br>    |-- config_variables.yml<br>    |-- data_docs<br>    |-- validations</pre><p>Note: Ensure path for above root directory for great_expectations is set to ENV variable “GE_ROOT_DIR” before proceeding with Airflow setup</p><h3>Step 2: Set up Apache Airflow</h3><p>Now that Great Expectations is installed, you can set up Apache Airflow and configure DAGs to integrate Airflow with Great Expectations.</p><p>Copy following two files airflowinstall.sh and airflow_greatexpectations.py in a directory</p><p>This script(airflowinstall.sh) will do basic setup required for Airflow on your machine</p><pre><strong>#! /bin/bash</strong></pre><pre># set airflow home as<br>export AIRFLOW_HOME=$(pwd)/air<br>export AIRFLOW__CORE__ENABLE_XCOM_PICKLING=True</pre><pre>printf $AIRFLOW_HOME</pre><pre>printf &quot;Installing required pip packages...\n\n&quot;<br>pip3 install apache-airflow<br>pip3 install great_expectations airflow-provider-great-expectations&gt;=0.1.0<br>pip3 install pymysql</pre><pre>printf &quot;Moving DAG file to airflow dir...\n\n&quot;<br>pwd<br>mkdir -p air/dags<br>cp airflow_greatexpectations.py air/dags/<br>ls -l air/dags/</pre><pre>printf &quot;Initialize and Start Airflow...\n\n&quot;<br>airflow dags list</pre><pre># initialize the database<br>airflow db init</pre><pre># provide your user login credentials and save<br>airflow users create \<br>    --username demo_user \<br>    --firstname airflowr \<br>    --password demo_pass \<br>    --lastname airflowr\<br>    --role Admin \<br>    --email demo123@gmail.com</pre><pre># start the web server and scheduler<br>airflow webserver --port 8080 -D<br>airflow scheduler</pre><p>This is a script (airflow_greatexpectations.py) to execute great_expectations checkpoints with Airflow DAGs using GreatExpectationsOperator:</p><pre>import datetime<br>import logging<br>import os</pre><pre>from airflow import DAG<br>from great_expectations_provider.operators.great_expectations import GreatExpectationsOperator</pre><pre># Set ENV variable(GE_ROOT_DIR) path to absolute path of great_expectations directory on your machine<br>ge_root_dir = os.environ.get(&#39;GE_ROOT_DIR&#39;)<br>print(&quot;GE_ROOT_DIR:&quot;, ge_root_dir)<br></pre><pre>def on_failure_func(context):<br>    &quot;&quot;&quot;Define custom failure notification behavior&quot;&quot;&quot;<br>    dag_run = context.get(&#39;dag_run&#39;)<br>    task_instances = dag_run.get_task_instances()<br>    print(&quot;WARNING: These task instances failed which can cause data consistencies&quot;, task_instances)<br>    logging.error(&#39;WARNING: These task instances failed which can cause data consistencies: {}&#39;.format(task_instances))<br></pre><pre>with DAG(<br>        dag_id=&quot;great_expectations_dag&quot;,<br>        start_date=datetime.datetime(2022, 1, 19),<br>        on_failure_callback=on_failure_func,<br>        catchup=False,<br>        schedule_interval=None<br>) as dag:<br>    ge_world_db_city_checkpoint_pass = GreatExpectationsOperator(<br>        task_id=&quot;task_world_db_city_checkpoint&quot;,<br>        data_context_root_dir=ge_root_dir,<br>        checkpoint_name=&quot;world_db_city_checkpoint&quot;<br>    )<br>    ge_world_db_country_checkpoint_pass = GreatExpectationsOperator(<br>        task_id=&quot;task_world_db_country_checkpoint&quot;,<br>        data_context_root_dir=ge_root_dir,<br>        checkpoint_name=&quot;world_db_country_checkpoint&quot;,<br>        trigger_rule=&quot;all_done&quot;<br>    )<br>    ge_world_db_countryinfo_checkpoint_pass = GreatExpectationsOperator(<br>        task_id=&quot;task_world_db_countryinfo_checkpoint&quot;,<br>        data_context_root_dir=ge_root_dir,<br>        checkpoint_name=&quot;world_db_countryinfo_checkpoint&quot;,<br>        trigger_rule=&quot;all_done&quot;<br>    )<br>    ge_world_db_countrylanguage_checkpoint_pass = GreatExpectationsOperator(<br>        task_id=&quot;task_world_db_countrylanguage_checkpoint&quot;,<br>        data_context_root_dir=ge_root_dir,<br>        checkpoint_name=&quot;world_db_countrylanguage_checkpoint&quot;,<br>        trigger_rule=&quot;all_done&quot;<br>    )</pre><pre>    ge_world_db_city_checkpoint_pass &gt;&gt; ge_world_db_country_checkpoint_pass &gt;&gt; ge_world_db_countryinfo_checkpoint_pass \<br>        &gt;&gt; ge_world_db_countrylanguage_checkpoint_pass</pre><p>Now, run the airflowinstall.sh script to complete Airflow setup.</p><h3>Step 3: View Apache Airflow &amp; Great Expectations in action</h3><p>With all the pieces in place, you can see your creation by opening a browser to <a href="http://localhost:8080/">http://localhost:8080/</a>.</p><p>Notice the Airflow dashboards and Great Expectations DAG. You can trigger the DAG and validate that all tasks have run successfully:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*hCbLssWmKc0U9Mgj.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*OpLYyqjPUfOrmkep.png" /></figure><p>Upon completion of this run, you’ll see all the Great Expectations results in the S3 bucket you defined earlier, and/or localhost based on data_docs_sites entries in great_expectations.yml:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*joyWCFcpDyaKQaFp.png" /></figure><p>You can also get detailed results on individual expectation suites by clicking on individual rows for specific tables:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*9v_3SuJWC-6RVId8.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*nVYm_PMUlT9iThUc.png" /></figure><p>Congratulations! Your data pipeline is now built, and you can automatically validate and monitor scheduled workflows.</p><h3>Conclusion</h3><p>Integrating Apache Airflow and Great Expectations helps engineers double down on the value of both tools. The ability to automate data validation within an automated data workflow saves time and adds efficiency.</p><p>Learn more by checking out the <a href="https://docs.greatexpectations.io/docs/">Great Expectations</a> and <a href="https://airflow.apache.org/docs/apache-airflow/stable/">Apache Airflow</a> documentation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d378e70db6a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cisco-fpie/optimize-your-data-pipeline-with-apache-airflow-and-great-expectations-8d378e70db6a">Optimize Your Data Pipeline with Apache Airflow and Great Expectations</a> was originally published in <a href="https://medium.com/cisco-fpie">cisco-fpie</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setup AQUA (Advanced Query Accelerator) for Amazon Redshift]]></title>
            <link>https://medium.com/cisco-fpie/setup-aqua-advanced-query-accelerator-for-amazon-redshift-74d734284c79?source=rss-f051667cf967------2</link>
            <guid isPermaLink="false">https://medium.com/p/74d734284c79</guid>
            <category><![CDATA[aqua]]></category>
            <category><![CDATA[redshift]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Shiv Deshmukh]]></dc:creator>
            <pubDate>Thu, 12 Aug 2021 23:02:11 GMT</pubDate>
            <atom:updated>2021-08-20T12:24:27.183Z</atom:updated>
            <content:encoded><![CDATA[<p>AQUA (Advanced Query Accelerator) is a new distributed and hardware-accelerated cache that enables Amazon Redshift to run up to ten times faster than other enterprise cloud data warehouses by automatically boosting certain types of queries. AQUA is included with the Redshift RA3 ra3.4xl and ra3.16xl node types at no additional cost.</p><p>This post will describe how to set up AQUA for Amazon Redshift. Note that AQUA executes on data in “regular” Redshift tables — i.e. data that is ingested into Redshift. It doesn’t support federated queries run from Redshift against databases like maria DB or aurora DB.</p><p>AQUA is designed to deliver up to 10 times the performance on queries that perform large scans, aggregates, and filtering, which is limited to LIKE and SIMILAR_TO predicates. Queries that perform writes, such as INSERT, UPDATE, DELETE, CREATE TABLE AS, COPY, and UNLOAD and SELECT (without a predicate) are not supported currently. Over time, AWS will be adding support for additional queries.</p><h3>Launch Redshift Cluster</h3><p>Go to Redshift Management Console and click on the “Create cluster” button. Select Production under “What are you planning to use this cluster for?” Then choose the RA3 ra3.4xl node type and turn on AQUA.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*83MFXTcZP3FfsCpZvFR48w.png" /></figure><p>Keep default database configurations, using a master username and master user password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*r1WIAwqkdMWQOVfJcTLvXg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*x7zGL04AfJctM1sL2wXGUA.png" /></figure><p>You’ll now see the cluster you’ve created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*Dh6r2VHKFm27HgHr_34mRA.png" /></figure><h3>Comparing <strong>queries run in Redshift against Aurora DB with and without AQUA cluster</strong></h3><p>To assess the improvement in performance from AQUA, let’s consider this largetest_2 table, which has 500,000,000 rows consisting of num1(int), num2 and num3 (double precision).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*hCBLsIBrUQ-A3WjbJZ_pRQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*NeB4Y3ayWnE_vFWcFdn6qQ.png" /></figure><p>We ran the following two queries for selecting num1, average of num3 and sum of num3, on the data shown in the table above:</p><p>Query #1</p><pre>SELECT num1, avg(num3) as num3_avg, sum(num2) as num2_sum<br>FROM dev.public.largetest_2<br>WHERE num2 LIKE ‘0.2%’<br>GROUP BY num1;</pre><p>Query #2</p><pre>SELECT num1, avg(num3) as num3_avg, sum(num2) as num2_sum<br>FROM dev.public.largetest_2<br>WHERE num3 LIKE ‘0.2%’<br>GROUP BY num1;</pre><p>The Query #1’s response time is 29s.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*rI7EZSwsleaYcdvPvARvgg.png" /></figure><p>The Query #2’s response time is 1m 1s.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*IG1GYG7rkfvqQKqKePYvaw.png" /></figure><p>We ran the same Query #1 in a non-AQUA (see above table) and got a response time of 57s.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*9ZIYhVQoVCl3fPaH-m2pAA.png" /></figure><p>Query #2’s response time is 2m 8s.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*zRixJFdKc_HHdE6ZFxy-Gg.png" /></figure><p>Next, we ran the same queries on the above table against Aurora DB in the Redshift AQUA cluster.</p><p>Query #1&#39;s response time was 47m 51s.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*Q864UkT47j3SCRPJWhy-bQ.png" /></figure><p>We then ran a query on the above table against Aurora DB in the Redshift non-AQUA cluster. Query #1&#39;s response time was 47m 52s.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*SvJe8EA3PMwdm3y28WuVYg.png" /></figure><h3>A Query Explanation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UybKsmqJXf8C6QVQ-zE5xg.png" /><figcaption>Table 1</figcaption></figure><pre>SELECT num1, sum(num2) as num2_sum, avg(num3) as num3_avg FROM largetest_3 GROUP BY num1;</pre><p>The above query will select rows (highlighted in green in Table 1 above), group by num1 column to calculate sum for num2 and the average for num3 columns. In other words, when grouping by value ‘3’ (from num1), the query will calculate sum for 0+1=1(from num2) and the average for (77+85)/2=81(from num3). We will get the following response for this query:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*9uADpFvw-tmt9h-9D0E9Xw.png" /><figcaption>Table 2</figcaption></figure><pre>SELECT num1, sum(num2) as num2_sum, avg(num3) as num3_avg<br>FROM largetest_3<br>WHERE num2 LIKE ‘1%’<br>GROUP BY num1;</pre><p>The above query will select rows (highlighted in orange in Table 1 above), only where num2 has ‘1%’ — i.e. the query will only return values that start with ‘1’ — and group by the num1 column to calculate the sum for num2 and the average for num3 columns.</p><p>In other words, when grouping by value ‘4’ (from num1), the query will calculate the sum for 1+1=2(from num2) and the average for (114+112)/2=113 (from num3). We will then get the following response for above query.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*2nBH5Kx_Lx2dWJSntLGpIQ.png" /><figcaption>Table 3</figcaption></figure><p><strong>Response Time Summary for different configurations</strong></p><p>The table below shows the comparison of queries run in Redshift (Local) and Aurora DB (Remote) with and without the AQUA cluster. These queries were run on a database table with 500,000,000 rows mix of integer and double precision data types.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mVCk1kYu277cDmDrHw11lA.png" /><figcaption>Table 4</figcaption></figure><p>The above table clearly shows the performance improvements in terms of response time with Redshift AQUA cluster as compared to non-AQUA cluster.</p><p><strong>RedShift Cost Analysis</strong></p><p>The cost of using Redshift can be broken into the following high-level categories:</p><p>1. <strong>Redshift managed storage associated with nodes in a cluster</strong> — Pay for data stored in managed storage at a fixed GB-month rate for your region.</p><p>2. <strong>Data scanned while running queries </strong>— With Redshift Spectrum, you are billed per terabyte of data scanned, rounded up to the next megabyte, with a 10-megabyte minimum per query.</p><p>3. <strong>Redshift Compute Node Usage</strong> — hourly rate based on the type and number of nodes in your cluster.</p><p>For more about Redshift pricing, visit this link: <a href="https://aws.amazon.com/redshift/pricing/">https://aws.amazon.com/redshift/pricing/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=74d734284c79" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cisco-fpie/setup-aqua-advanced-query-accelerator-for-amazon-redshift-74d734284c79">Setup AQUA (Advanced Query Accelerator) for Amazon Redshift</a> was originally published in <a href="https://medium.com/cisco-fpie">cisco-fpie</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Migration from MariaDB to Redshift using AWS Data Migration Service (DMS)]]></title>
            <link>https://medium.com/cisco-fpie/data-migration-from-mariadb-to-redshift-using-aws-data-migration-service-dms-b9d6b820e640?source=rss-f051667cf967------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9d6b820e640</guid>
            <category><![CDATA[data-migration-service]]></category>
            <category><![CDATA[mariadb]]></category>
            <category><![CDATA[redshift]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Shiv Deshmukh]]></dc:creator>
            <pubDate>Thu, 24 Jun 2021 20:13:03 GMT</pubDate>
            <atom:updated>2021-07-07T18:49:05.064Z</atom:updated>
            <content:encoded><![CDATA[<p>The AWS Database Migration Service (DMS) helps you migrate databases to AWS quickly and securely. The source database remains fully operational during the migration, minimizing downtime to applications that rely on the database. With the AWS Database Migration Service, you can migrate your data to and from most widely used commercial and open-source databases.</p><p>The following steps explain how to migrate a database from the AWS MariaDB to AWS Redshift using DMS.</p><p><strong>Step 1: Create DMS replication instance</strong></p><p>From the DMS console, select “Replication instances” and then “Create replication instance.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*QRuNDKLKmjuuaHLLiAH43g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*vW1edzKImj_0BBPlnkxKVA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*9O3An3X75r4W7W30L60B-g.png" /></figure><p><strong>Step 2: Create DMS Source Endpoint</strong></p><p>From DMS console, select “Endpoints: and then “Create endpoint.” Select the respective ARN under Server name, port and credentials for the MariaDB instance to be connected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*um7puKy_mStqDAjBasRSzw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*ZmYhksuEcdDtKvjSU18PBQ.png" /></figure><p><strong>Step 3: Create DMS Target Endpoint</strong></p><p>In order to create a target endpoint for your Redshift cluster, we need the following IAM role associated with a Redshift cluster for DMS to access it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*NstGaQ3iFVjmI2iy9r6ZyA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*U2_39byhBv2k8yu-W4Y-wQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*J82zDlYcDhnyQqNR1D58gQ.png" /></figure><p>Now from the DMS console, select “Endpoints” and then “Create endpoint.” Select respective ARN under Server name, port, credentials and database name to connect the Redshift cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*m9Ap9nnTVgiDdMID0-lMrA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*6em1OYHLUCd52qbzyQ34Ow.png" /></figure><p><strong>Step 4: Create Database Migration Task</strong></p><p>Now from the DMS console, select “Database migration tasks” and “Create task.”</p><p>Select the respective replication instance, source and target endpoints created above from the dropdown list and other specifications as needed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*hKJHpNBBvl5WHAuhHewVPg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/702/1*Z63-DY0wp1fopxkW88kACg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*NME9B3RWA6aHT8jQeBx6gw.png" /></figure><p>Based on the option selected above, the database migration task is automatically started after creating the task. This task can be executed periodically on a specified schedule using a Lambda function.</p><p>Once the task is completed (you’ll see “Load complete”), we should see the db, schema and tables in your target Redshift cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/324/1*Z5-BzCX3NltpZNniich7Zg.png" /></figure><p>The above screenshot shows the schema with “countrydata” and table. “countrycaps” is migrated from MariaDB in Redshift.</p><p>Once these tables are available, we can execute queries in Redshift on this DB as well as across other DBs within the Redshift cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*Bbrh-qjGgt58Ysl_lKrKnA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*2mlSk97_1aaRpQ50BguQEQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9d6b820e640" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cisco-fpie/data-migration-from-mariadb-to-redshift-using-aws-data-migration-service-dms-b9d6b820e640">Data Migration from MariaDB to Redshift using AWS Data Migration Service (DMS)</a> was originally published in <a href="https://medium.com/cisco-fpie">cisco-fpie</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Access S3 Data in Amazon Redshift using Redshift Spectrum]]></title>
            <link>https://medium.com/cisco-fpie/access-s3-data-in-amazon-redshift-using-redshift-spectrum-4481e13bd273?source=rss-f051667cf967------2</link>
            <guid isPermaLink="false">https://medium.com/p/4481e13bd273</guid>
            <category><![CDATA[redshift]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[redshift-spectrum]]></category>
            <dc:creator><![CDATA[Shiv Deshmukh]]></dc:creator>
            <pubDate>Mon, 21 Jun 2021 17:43:27 GMT</pubDate>
            <atom:updated>2021-06-24T16:35:49.458Z</atom:updated>
            <content:encoded><![CDATA[<p>As the cloud data warehouse in AWS, Amazon Redshift provides seamless integration with other storages, such as Amazon S3. It enables a very cost-effective data warehouse solution, where the user can keep warm data in Amazon Redshift storage and cold data in S3 storage. The user can access the S3 data from Redshift in the same way, retrieving data from the Redshift storage itself. This blog post explains the process for doing just that.</p><h3>Step 1: Pre-Requisite</h3><p>You need to have an AWS account with administrative access.</p><h3>Step 2: Create S3 Bucket and Upload Sample .csv File</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*EJJDmLGUNd8_WCykQL18Mg.png" /></figure><p>In this example, I uploaded a .csv file with data about specific countries. The “countrydata.csv” file looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*z2Bll8PDn9XnSrLByN7R0w.png" /></figure><h3>Step 3: Create IAM Role</h3><p>Your IAM Role for the Redshift cluster will be used to provide access to the data in the S3 bucket. Under “Create Role” in the IAM console, select “AWS service”. Under “Choose a use case,” select “Redshift.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*l3K2j-IWC9N3uemYSjcFWw.png" /></figure><p>Next, under “Select your use case,” choose “Redshift — Customizable.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*cmTSFyT1to0i4dNuq4lR0g.png" /></figure><p>Under “Attach permissions policies” select <strong>PowerUserAccess</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*UzXha4U1mLMyBiIiYRhCtw.png" /></figure><p>Next, create a role name and description.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*I2YZXJcMhCIasaGEqnvreQ.png" /></figure><p>At the end of all four steps, the summary page will show the details of the role created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*S0sZu6otS48R2qsh158iwA.png" /></figure><h3>Step 4: Launch Redshift Cluster</h3><p>In this step, you’ll launch a Redshift cluster, which will be used to query the S3-based data.</p><ol><li>Go to Redshift Management Console and click on the “<strong>Create cluster”</strong> button.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*O0PiWy5nHEgoojmYENMpjQ.png" /></figure><p>Select an identifier for the cluster and select “Free trial.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*R-NvT_u9JWN975VEhouZ5w.png" /></figure><p><strong><em>Note: </em></strong><em>Free trial (dc2.large) doesn’t allow cross-dBs queries. For initiating cross-dBs queries, the minimum requirement is to use paid instances of the ra3.xlplus node type.</em></p><p>Keep default database configurations, using a master username and master user password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*VJOh33fDtV-eNx31LnuYhw.png" /></figure><p>You’ll now see the cluster you’ve created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*uWYgqj9cmMTYsCsU4AezYg.png" /></figure><p>Associate cluster with the role created in step 3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*hpm-aMt73Xui5v0JWFrNbA.png" /></figure><p>You’ll see a summary of what you’ve created in the view shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*5OOTSUqlTmAkHDuWkdgH_Q.png" /></figure><p>On the left-hand menu, select “Editor” using the options in the screenshot below to connect your cluster to the database you just created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*N0mE6uwIyjQFDdC29JwTfg.png" /></figure><p><strong>Step 5: Insert Data in Redshift Database</strong></p><p>In this step, you’ll create a new schema in the Redshift cluster database and then create a table in the schema using the S3-based data. This table will be used to access data from the S3 bucket.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*4fQ2z-Tzc6XRRWXntHLfRw.png" /></figure><p>In the Editor view, enter the following code in the query editor:</p><pre>create external schema trellisdataschema<br>from data catalog<br>database ‘dev’<br>iam_role ‘arn:aws:iam::YYYYYYYYYYYY:role/trellis-yyyyyy-role’<br>create external database if not exists;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*hr09q52KC4nwp_vT4PpFXQ.png" /></figure><p>Next, enter code to create a table for that schema using the data from your .csv file stored in the S3 bucket:</p><pre>create external table trellisdataschema.countrycapitals(</pre><pre>country nvarchar(100),</pre><pre>capital nvarchar(100)</pre><pre>)</pre><pre>row format delimited</pre><pre>fields terminated by ‘,’</pre><pre>stored as textfile</pre><pre>location ‘s3://trellis-redshift-s3’;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*wKHpFoemvFrSq-v2xXwHKQ.png" /></figure><p>The newly-created schema and table will now show up in the Resources view:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/386/1*CeFwHZq8BIsBn7d1iIM6fQ.png" /></figure><p>Now whenever you run a SQL query, you’ll fetch data from the table that you created, which fetches from the S3 bucket:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*NpYvcifjaAjtmwPA0IFDdA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*bAlOvwdBnqrqFbgMoOU6KA.png" /></figure><p><strong>Running Cross-Database Queries</strong></p><p>In order to execute a cross-database query, you need to upgrade your node type to ra3.xlplus:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*8LOSajyU-2P0z6QnFXPGjw.png" /></figure><p>Next, create the database “dev1” :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*HjG5wr6SjDaQylLuAgAAKg.png" /></figure><p>Now create the table — “population”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*uNOnjdHxhzz5EJXhEAz0Qw.png" /></figure><p>Create a respective schema for db ‘dev1’:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*QITCssZ2ZmLYuApWV9oSqQ.png" /></figure><p>Insert data into this table:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*fciIIZcdXXiiWIDWIi-Zxg.png" /></figure><p>Run the query to display your inserted data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*lltSId6iGMtgZZmNmCucOA.png" /></figure><p>Create a second database and table, following the steps above.</p><p>Create the database “dev2”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*L_S6N1vWTZhCkGg8qvLf0Q.png" /></figure><p>Create the table “currency”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*0GCeXrioc58dKG8Hwr3vsw.png" /></figure><p>Create respective schema for db ‘dev2’:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*DEvs9ZdsMocUrmX-sKiyjw.png" /></figure><p>Insert your data:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*8uhGb7ZIU_S_AOjnzyOPvQ.png" /></figure><p>Run your query to display your data:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*vCn8Hgqraycipl8PWkej2Q.png" /></figure><p>Now that we have three DBs created (“dev,” “dev1,” and “dev2”) with their respective schemas in Redshift, we can run cross-database queries between these three databases:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*EWdooJZ03_h6K6810_Jlbg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*VX4cuRxshg1pO-I2sdb15g.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4481e13bd273" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cisco-fpie/access-s3-data-in-amazon-redshift-using-redshift-spectrum-4481e13bd273">Access S3 Data in Amazon Redshift using Redshift Spectrum</a> was originally published in <a href="https://medium.com/cisco-fpie">cisco-fpie</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Transferring Data with AWS Data Sync]]></title>
            <link>https://medium.com/cisco-fpie/transferring-data-with-aws-data-sync-e3d8e2a4e307?source=rss-f051667cf967------2</link>
            <guid isPermaLink="false">https://medium.com/p/e3d8e2a4e307</guid>
            <category><![CDATA[data-sync]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-datasync]]></category>
            <dc:creator><![CDATA[Shiv Deshmukh]]></dc:creator>
            <pubDate>Tue, 11 May 2021 18:56:46 GMT</pubDate>
            <atom:updated>2021-07-19T20:12:41.694Z</atom:updated>
            <content:encoded><![CDATA[<p>AWS DataSync is an online data transfer service that simplifies, automates, and accelerates the process of copying large amounts of data to and from AWS storage services over the Internet or AWS Direct Connect. DataSync can be particularly useful when migrating large amounts of data between clouds or from on-premises systems to the cloud.</p><p>With DataSync, you can copy data between Network File System (NFS) or Server Message block (SMB) file servers, Amazon Simple Storage Service (S3), Amazon Elastic File System (EFS) and Amazon FSx for Windows File Servers.</p><p>I’ll describe the steps you need to take next in two scenarios: the first will describe what to do if you’re transferring data between AWS accounts, and the second will describe what to do if you’re transferring data from on-premises to AWS S3. For an in-depth look at using AWS Data Sync, check out this <a href="https://docs.aws.amazon.com/datasync/latest/userguide/what-is-datasync.html">user guide</a>.</p><p>No matter which scenario applies to you, start with these initial steps:</p><p>1. Deploy an agent, which can be an on-premises VM or an EC2 instance deployed on the source to access NFS/SMB to read and write data.</p><p>2. Create a data transfer task specifying required data source and destination locations. Configure options for your data, such as file patterns and scheduling.</p><p>3. Start and monitor your task in the AWS management console or Cloudwatch.</p><p><strong>Scenario 1: Data Transfer between AWS accounts with S3 as source and destination locations</strong></p><p>The following diagram provides a high-level view of the DataSync architecture for transferring data between AWS services within the same account. This architecture applies to both in-region and cross-region transfers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*en9-cCxEngr96QR3mZRHRA.png" /></figure><p>A DataSync agent is not required when executing S3-to-S3 transfers across accounts and regions. This is internally handled by AWS’ DataSync architecture. For other storage resources — such as EFS and FSx — you can execute DataSync without an agent when transferring within the same account, but you need to use an agent when transferring data across accounts.</p><p>When transferring data between accounts, make sure that your destination account has IAM credentials for accessing your source S3 location data. It is recommended that you run the DataSync service in the destination AWS account to avoid any issues.</p><p>Your source account will contain the source S3 bucket and your destination account will contain the destination S3 bucket and run the DataSync service.</p><p><strong>Setup in source account</strong></p><p>1. Create a S3 bucket(“trellis-datasync-src1”) in the source account/region with default attributes.</p><p>2. On the bucket’s “Permissions” tab, click “Bucket policy.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*8Lz4pot9eStJpqgsAKhkSw.png" /></figure><p>3. Click “Edit” and add the following:</p><pre>{<br>  &quot;Version&quot;: &quot;2012–10–17&quot;,<br>  &quot;Id&quot;: &quot;Policy1616194240988&quot;,<br>  &quot;Statement&quot;: [<br>    {<br>      &quot;Sid&quot;: &quot;Stmt1616194236908&quot;,<br>      &quot;Effect&quot;: &quot;Allow&quot;,<br>      &quot;Principal&quot;: {<br>        &quot;AWS&quot;: [<br>          &quot;arn:aws:iam::1111111111111:user/username&quot;,<br>          &quot;arn:aws:iam::1111111111111:role/CrossAccountAccess&quot;<br>        ]<br>      },<br>      &quot;Action&quot;: &quot;s3:*&quot;,<br>      &quot;Resource&quot;: [<br>        &quot;arn:aws:s3:::trellis-datasync-src1&quot;,<br>        &quot;arn:aws:s3:::trellis-datasync-src1/*&quot;<br>      ]<br>    }<br>  ]<br>}</pre><p>4. Get destination account details by running the following command for AWS destination, to be used in above policy:</p><pre>❯ aws sts get-caller-identity<br>{<br>  &quot;UserId&quot;: &quot;ABCDEFGHIJKLMNOP5555&quot;,<br>  &quot;Account&quot;: &quot;555555555555&quot;,<br>  &quot;Arn&quot;: &quot;arn:aws:iam::55555555555:user/username&quot;<br>}</pre><p><strong>Setup in destination account</strong></p><p>1. Setup a IAM Role “CrossAccountAccess” for S3 access from the source. For simplicity, I’ve used the “AmazonS3FullAccess” policy below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*5b5LqpRCspTS55yDZVUNEw.png" /></figure><p>2. Click on the “Trust relationships” tab, where you’ll see the following view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*-c1TQ-6MAHMyf3eAw7Uylg.png" /></figure><p>3. Click “Edit trust relationship” and add the following Trust Policy, which will show up under “Trusted entities”:</p><pre>{<br>  &quot;Version&quot;: &quot;2012–10–17&quot;,<br>  &quot;Statement&quot;: [<br>    {<br>      &quot;Effect&quot;: &quot;Allow&quot;,<br>      &quot;Principal&quot;: {<br>        &quot;Service&quot;: &quot;datasync.amazonaws.com&quot;<br>      },<br>      &quot;Action&quot;: &quot;sts:AssumeRole&quot;<br>    }<br>  ]<br>}</pre><p>4. Next, create a S3 bucket (“trellis-datasync-dst1”) in the destination account/region with default attributes. Create the cross account s3 location (for source A), from destination B using the AWS CLI below:</p><pre>❯ aws datasync create-location-s3 — s3-bucket-arn arn:aws:s3:::trellis-datasync-src1 — s3-config ‘{“BucketAccessRoleArn”:”arn:aws:iam::5555555555:role/CrossAccountAccess”}’ — region eu-west-1</pre><p>If the command works, below output will be displayed:</p><pre>{<br>  &quot;LocationArn&quot;: &quot;arn:aws:datasync:eu-west-1:5555555555:location/loc-054160bbd934e32c9&quot;<br>}</pre><p>Now, the source S3 location should show up in the destination view, and we can set up both source and destination locations for the DataSync service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*XQVx90qDXWok0i5W8po8LQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*U0w3sHYSpBoe_OMeMtK_5A.png" /></figure><p>5. In either the DataSync source or destination view, click “Create task” to initiate a data transfer with specified parameters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*VmyePqkWRwT5LW_3BGPL_g.png" /></figure><p>6. Next, configure your source location by selecting “Choose an existing location.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*OaYq0eXFR2ZivfChKT_IYg.png" /></figure><p>7. Next, configure your destination location by selecting your destination bucket.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*h-72L4oRa48QjuhfBKIvvg.png" /></figure><p>8. Next, configure your settings, specifying your Task Name, Task execution configuration, Data transfer configuration, Filtering configuration, and Task logging:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*Q0Kzc4an7TwBrtxJxK7bIw.png" /></figure><p>When you’ve completed configuration, you’ll see details about your task in the following dashboard:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*io8eqBOqlcLqRubMZKq1zw.png" /></figure><p>9. As the data transfers, you can check your DataSync task execution status by clicking the “History” tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*SaviaROdydLNdjg2mbagVg.png" /></figure><p><strong>Scenario 2: Data Transfer between on-premises (NFS) as source to AWS S3 as destination</strong></p><p>The diagram below depicts the process of transferring data between on-premises servers to AWS S3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*I831mWFrVi6Y6YyYkZ31cg.png" /></figure><p>The same dynamics apply when the source (NFS, SMB) is deployed in AWS, as the diagram below shows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*kXymhIfdcLpPvjPHS0q6AA.png" /></figure><p>To execute this transfer, follow these steps:</p><p>1. Ensure that your Security Group rules match the requirements for deploying DataSync agent on the source, as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*AMBDJB4iQ3EtH9raQP-clw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*yxZbajHLu0Xvvy6r4XxRhg.png" /></figure><p>2. Simulate on-premises NFS server by deploying an EC2 instance with an EBS/EFS storage system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*fil-7CIAIorkFdxbrSmRDQ.png" /></figure><p>3. Mount EBS volume on the E2 instance. For more on this process, consult <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/add-instance-store-volumes.html">the user guide</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*I0FDftEAeVewOdEAWdiaqA.png" /></figure><p>4. Ensure that the nfs service is enabled and the nfs path is exported correctly:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*p4Nncbxb4G5ggxZT-1LOfg.png" /></figure><p>You’ll need CLIs to enable NFS service and export the NFS path:</p><pre>sudo apt-get update &amp;&amp; sudo apt-get install nfs-kernel-server</pre><pre>sudo vi /etc/exports</pre><p>Add /home/ubuntu/data *(rw,fsid=1,no_subtree_check,sync,insecure)</p><pre>sudo service nfs-kernel-server reload</pre><pre>systemctl status nfs-server.service</pre><p><strong>Set up and activate DataSync agent, locations, and task</strong></p><p>Whether you’re in scenario 1 or 2, take the steps below if you’re deploying the EC2 instance as a DataSync agent in an AWS region close to your source location. For the steps you need to take if you’re pursuing other deployment options, see this <a href="https://docs.aws.amazon.com/datasync/latest/userguide/deploy-agents.html">document</a>.</p><p>1. Create EC2 instance to be used as DataSync agent on the source account. Amazon recommends using one of the following EC2 instance types:</p><p>· m5.2xlarge — For tasks to transfer up to 20 million files.</p><p>· m5.4xlarge — For tasks to transfer more than 20 million files.</p><p>First get AMI for the DataSync agent required for your region using the following command:</p><pre>❯ aws ssm get-parameter — name /aws/service/datasync/ami — region eu-west-1</pre><pre>{<br>  &quot;Parameter&quot;: {<br>    &quot;Name&quot;: &quot;/aws/service/datasync/ami&quot;,<br>    &quot;Type&quot;: &quot;String&quot;,<br>    &quot;Value&quot;: &quot;ami-024d0f6d9d751d0a1&quot;,<br>    &quot;Version&quot;: 20,<br>    &quot;LastModifiedDate&quot;: &quot;2021–03–02T07:50:22.419000–08:00&quot;,<br>    &quot;ARN&quot;: &quot;arn:aws:ssm:eu-west-1::parameter/aws/service/datasync/ami&quot;,<br>    &quot;DataType&quot;: &quot;text&quot;<br>  }<br>}</pre><p>Using the AMI value from the output above, launch the EC2 instance (m5.2xlarge or m5.4xlarge) using the following URL, substituting region and ami-id:</p><p><a href="https://console.aws.amazon.com/ec2/v2/home?region=source-file-system-region#LaunchInstanceWizard:ami=ami-id">https://console.aws.amazon.com/ec2/v2/home?region=source-file-system-region#LaunchInstanceWizard:ami=ami-id</a></p><p>If using a security group, assign the above security-group or ensure desired inbound/outbound rules are applicable for this instance.</p><p>For more on executing this process consult AWS <a href="https://docs.aws.amazon.com/datasync/latest/userguide/deploy-agents.html#ec2-deploy-agent">user guide</a>.</p><p>2. Once the EC2 instance (DataSync agent) is deployed, log in to your console to get the activation key with your required method using public or VPC endpoints.</p><p>Note that you’ll need to set Private DNS names to “False” (unchecked) in VPC endpoints if you’re using the DataSync agent as a public endpoint. If you have agents activated with public rather than private endpoints within the same VPC, if the private DNS option is checked, the agent with public endpoint activation will not be able to resolve the service endpoints. This will cause communication failure that leads to the agent going offline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*8ZPfrWJLehEDfPuM2SWh8g.png" /></figure><p><strong>Setup on destination account</strong></p><ol><li>Go to DataSync service in AWS management console on destination account and select “Create Agent”:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*3mCDHQEpGspbkg_H84T3Fw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*pW2HuJKTApP8NSrmi1yRhQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*zpqlrtVd11lqEToz4VkloA.png" /></figure><p>2. Create an S3 bucket (“trellis-nfs-dst”) in the destination account/region with default attributes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*FE2u9RqhlynqoNBpz4fZ8w.png" /></figure><p>3. Set up a DataSync source location (NFS server) on the destination account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*mk1mY4Qr1x_3dfUqt9eO-A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*w9K7x85kGPemrC645_jMrg.png" /></figure><p>4. Create a DataSync task to initiate data transfer with specified parameters for source location, destination location, settings and task logging:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*Vd8OmKZkQPkgKXggXyLsyA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*NYojFJwE7DkubRWfLsj8UQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*XVAluinYVJuG26Q0omTc7g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*89DWsGDlDdxtj07SDZ9xKw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*3cke9r9ZFaLEn8mqHtEpnQ.png" /></figure><p>5. Once on your DataSync dashboard view (see above), click “History” to check your DataSync task execution status.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*22vF99wfHU9q7h5Vb1rSeA.png" /></figure><h3>Transferring file data across AWS regions and accounts using VPC peering</h3><p>For more on how to transfer file data across AWS regions and accounts using VPC peering, see AWS’ documentation titled “<a href="https://docs.aws.amazon.com/vpc/latest/peering/create-vpc-peering-connection.html">Creating and accepting a VPC peering connection</a>” and “<a href="https://aws.amazon.com/blogs/storage/transferring-file-data-across-aws-regions-and-accounts-using-aws-datasync/">Transferring file data across AWS Regions and accounts using AWS DataSync</a>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BGF1tKCdO-KA0amaJ4MPDA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e3d8e2a4e307" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cisco-fpie/transferring-data-with-aws-data-sync-e3d8e2a4e307">Transferring Data with AWS Data Sync</a> was originally published in <a href="https://medium.com/cisco-fpie">cisco-fpie</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Quality into Agile]]></title>
            <link>https://medium.com/cisco-fpie/building-quality-into-agile-3e96cff1bd1f?source=rss-f051667cf967------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e96cff1bd1f</guid>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[quality-assurance]]></category>
            <category><![CDATA[agile]]></category>
            <category><![CDATA[sdlc]]></category>
            <dc:creator><![CDATA[Shiv Deshmukh]]></dc:creator>
            <pubDate>Thu, 18 Mar 2021 15:58:26 GMT</pubDate>
            <atom:updated>2021-03-18T16:25:12.071Z</atom:updated>
            <content:encoded><![CDATA[<p>In the age-old waterfall model, discrete amounts of time and resources were allocated for quality testing after a product was stabilized and the majority of the development process was completed. As we adopt agile methodologies, the software development life cycle (SDLC) can make it challenging to fit quality testing and its expectations into the overall process. Additionally, today’s continuous improvement methodology — where development, DevOps and QA collaborate closely — calls for better “lines of demarcation” between the deliverables, expectations and outcomes expected of each role. Oftentimes, however, those lines are still blurred, which makes it critical to put a quality process in place that ensures efficiency, accountability and, ultimately, the delivery of a superior product to market.</p><p>Broadly speaking, we can categorize each role as follows:</p><ul><li><strong>Development</strong> — provides individual and integrated components</li><li><strong>DevOps</strong> — provides all the infrastructure needed for integrating various components, deploying builds and initiating test suites on top</li><li><strong>QA</strong> — provides various test suites, its execution and respective reports</li></ul><p>Let’s consider the following release process, in an iterative model of continuous integration and development cycle:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*HX7L7t5jrYtQQPJch2atQA.png" /></figure><p>Here, we are establishing two environments:</p><ul><li><strong>goldenDev</strong> — an environment for active development (both dev and QA), integrating components, fixing all bugs, running test suites</li><li><strong>goldenQA</strong> — a more stable environment where extensive testing is done; only blocker issues are fixed here</li></ul><p>Only when certain stability and quality is achieved in goldenQA is the go-ahead given to deploy to production.</p><p>Drilling down more on the quality process in this cycle, we can categorize various test suites as follows:</p><ul><li><strong>Unit tests: </strong>usually defined by dev and triggered as part of each deployment</li><li><strong>Build Acceptance tests (BAT):</strong> defined by QA; includes basic sanity tests and is triggered after deployment to qualify a specific build</li><li><strong>Functional &amp; System tests (FAST):</strong> defined by QA and triggered after BAT. Runs all functional and end-to-end tests (new features and regression).</li><li><strong>Performance &amp; Stress tests (PAST): </strong>defined by QA and triggered after FAST. Runs benchmarking tests to establish the metric in terms of performance and stress on the system.</li><li><strong>Longevity tests (runs only on goldenQA): </strong>defined by QA. Runs use scenarios to gauge the stability of the overall product, over extended periods of time.</li><li><strong>Code Coverage: </strong>codebase can be instrumented, to check the code coverage being achieved with all test suites. These test suites can be continuously enhanced, based on the gaps identified to achieve more coverage.</li></ul><p>As we move through different testing phases throughout the release cycle, we need a clear definition to quantify the overall quality of the product so a better judgement call can be made on the release decision. Based on the above test suites, the following criteria can give us good data points:</p><p><strong>Release Exit Criteria</strong></p><p>All the planned test execution should be completed with the following criteria:</p><ul><li>100% pass rate for unit and BAT tests</li><li>100% pass rate for regression tests (FAST)</li><li>New feature run to plan (RTP) — 100% executed (FAST)</li><li>New feature pass to plan (PTP) — 80–90% executed (FAST) and no critical and blocker bugs in open state</li></ul><p>Performance &amp; stress testing (PAST) should be completed — with acceptable metrics (agreed based on previous baseline) and no degradation</p><p>Longevity tests should be completed — system uptime of 7–10 days with no downtime and degradation</p><p>Automation achieved</p><ul><li>Identified high priority tests should be automated</li></ul><p>Code coverage — 60–80% achieved</p><p>In conclusion, both product and test development efforts happen in parallel, while DevOps provides necessary machinery and each role focuses on their respective areas, churning out code and testing it thoroughly on the goldenDev environment. Only reliable and stable code is tested on goldenQA, with minimum development effort. Once the exit criteria are achieved, we should be ready to deploy the respective code base to production.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e96cff1bd1f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cisco-fpie/building-quality-into-agile-3e96cff1bd1f">Building Quality into Agile</a> was originally published in <a href="https://medium.com/cisco-fpie">cisco-fpie</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>