Continuous Integration and the Data Warehouse Dr. John Tunnicliffe Decision Analytics Independent BI Architect & Hands-On Developer Mobile: 07771 818770.

Slides:



Advertisements
Similar presentations
AXC01 DIXF: The Microsoft Dynamics AX Data Import and Export Framework
Advertisements

Test Case Management and Results Tracking System October 2008 D E L I V E R I N G Q U A L I T Y (Short Version)
BizTalk Deployment using Visual Studio Release Management
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
René Balzano Technology Solution Professional Data Platform Microsoft Switzerland Database Development with SQL Server Data Tools (SSDT)
Slide 1 of 9 Presenting 24x7 Scheduler The art of computer automation Press PageDown key or click to advance.
Virtual techdays INDIA │ august 2010 Building ASP.NET applications using SQL Server Compact Chaitanya Solapurkar │ Partner Technical Consultant,
Deploying Dynamics Applications Thomas Hansen – Director, appSolutions a|s
BUSINESS INTELLIGENCE/DATA INTEGRATION/ETL/INTEGRATION AN INTRODUCTION Presented by: Gautam Sinha.
Introduction to SharePoint Development with VS2010 Paul Yuknewicz Lead Program Manager
CONTINUOUS INTEGRATION, DELIVERY & DEPLOYMENT ONE CLICK DELIVERY.
Migration XenDesktop 7. © 2013 Citrix | Confidential – Do Not Distribute Migration prerequisites Set up a XenDesktop 7 Site, including the site database.
11 Games and Content Session 4.1. Session Overview  Show how games are made up of program code and content  Find out about the content management system.
Linux Operations and Administration
SSIS Over DTS Sagayaraj Putti (139460). 5 September What is DTS?  Data Transformation Services (DTS)  DTS is a set of objects and utilities that.
SQL Server Integration Services (SSIS) Presented by Tarek Ghazali IT Technical Specialist Microsoft SQL Server (MVP) Microsoft Certified Technology Specialist.
Terry Henry IS System Manager, SharePoint SME Micron Technology Inc.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Module 19 Managing Multiple Servers. Module Overview Working with Multiple Servers Virtualizing SQL Server Deploying and Upgrading Data-Tier Applications.
SQL Server 2008 R2 for the DBA Patrick LeBlanc. Objectives  New Editions  Datacenter  Parallel Data Warehouse  Multi-server management  Utility Control.
HDNUG 27-March-2007 SQL Server 2005 Suite as a Business Intelligence Solution.
Microsoft SharePoint Server 2010 for the Microsoft ASP.NET Developer Yaroslav Pentsarskyy
Microsoft Ignite /23/2017 3:56 PM Advanced SSDT and DACFx Practical techniques for real world database development and deployment Darren Hall M359.
SQL Server User Group Meeting Reporting Services Tips & Tricks Presented by Jason Buck of Custom Business Solutions.
IT 456 Seminar 5 Dr Jeffrey A Robinson. Overview of Course Week 1 – Introduction Week 2 – Installation of SQL and management Tools Week 3 - Creating and.
FORUM II Best Practices in Data Warehousing in Higher Education: A Framework for Higher Education Reporting April 18, 2005 Slide 1 Cornell University’s.
ADAPTING YOUR ETL SOLUTION TO USE SSIS 2012 Presentation by Devin Knight
Database Projects in Visual Studio Improving Reliability & Productivity.
Adxstudio Portals Training
Cognos 8 BI Configuration, Administration, and Upgrade Cognos 8 BI.
Continuous Integration for Databases Steve Jones SQLServerCentral Red Gate Software.
Entity Framework Database Connection with ASP Notes from started/getting-started-with-ef-using-mvc/creating-an-
Continuous Deployments using SSDT
Integrating and Extending Workflow 8 AA301 Carl Sykes Ed Heaney.
Explore engage elevate Data Migration Without Tears Mike Feingold Empoint Ltd Tuesday 10th November 2015.
#SQLSAT454 Using Power BI in Enterprise Andrea
Easy ETL with Andrzej Kukuła – Marcin Szeliga –
Copyright 2015 Varigence, Inc. Unit and Integration Testing in SSIS A New Approach Scott @varigence.
Continuous Integration and the Data Warehouse Dr. John Tunnicliffe Independent BI Architect & Hands-On Developer Mobile:
SSIS 2012: The Quiet Revolution Presented by Bryan Cafferky Business Intelligence Consultant BPC Global Solutions LLC
9 Copyright © 2004, Oracle. All rights reserved. Getting Started with Oracle Migration Workbench.
Building Your ETL Framework with Biml Meagan Longoria March 19, 2016.
Others Talk, We Listen. Managing Database Projects in Visual Studio 2013.
Continuous Integration and the Data Warehouse Dr. John Tunnicliffe Decision Analytics Independent BI Architect & Hands-On Developer
Automated Build and Test
Stress Free Deployments with Octopus Deploy
What Is The SSIS Catalog and Why Do I Care?
Agile Analytics: Automated Builds and Deployments
SQL Server deployments
Continuous Integration and the Data Warehouse
Continuous Deployments using SSDT
Deploying and Configuring SSIS Packages
Implementing a Continuous Integration strategy for Dynamics CRM
Continuous Integration For Databases
X in [Integration, Delivery, Deployment]
Populating a Data Warehouse
Populating a Data Warehouse
Populating a Data Warehouse
Populating a Data Warehouse
Populating a Data Warehouse
Populating a Data Warehouse
Continuous Deployments using SSDT
Continuous Deployments using SSDT
Course: Module: Lesson # & Name Instructional Material 1 of 32 Lesson Delivery Mode: Lesson Duration: Document Name: 1. Professional Diploma in ERP Systems.
Continuous Deployments using SSDT
Presented by : Chirag Dani & Dhaval Shah
SSDT and Database Project Basics
SSIS Data Integration Data Warehouse Acceleration
SSIS Data Integration Data Warehouse Acceleration
SSIS Data Integration Data Warehouse Acceleration
Presentation transcript:

Continuous Integration and the Data Warehouse Dr. John Tunnicliffe Decision Analytics Independent BI Architect & Hands-On Developer Mobile: Blog:

Agenda Introduction What is CI? Tools and techniques for CI Source Code Control (SCC) SQL Server Data Tools (SSDT) PowerShell and psake build tools TeamCity Build Server Deployment Tips Test frameworks SSDT and T4 Templates

Different approaches to SQL data warehouse development Migration Scripts Manually prepare upgrade scripts Must be run in correct order Scripts are combination of DDL and data fixes Manual deployments Declarative Model Define what we want Tool creates migration scripts Still need data fixes Automated deployments

Hands up Who has entire BI solution under source code control? Including SQL databases, all SSIS packages, all SSAS cubes SSDT and the declarative model approach? Who already uses CI in a data warehouse context? Does CI also deploy & test your code?

What is Continuous Integration? Continuous Integration is a development practice that requires developers to integrate code into a shared repository several times a day. Each check-in is verified by an automated build, deploy and test cycle which allows errors to be detected and thereby corrected quickly.

Benefits of Continuous Integration Eradication of manual integrations and deployments Catches issues fast Reduces production & staging errors Automated testing provides quality assurance CI allows developers to proceed with confidence CI provides reporting on quality of the code base

Applying CI to Data Warehousing Why is it so difficult? BI developers are not familiar with CI Never seen it in action in a DWH context Not familiar with the tools and techniques Cannot comprehend how it can be applied Data is a BIG barrier PROD data is different to DEV Problems often only manifest themselves in PROD data Time taken to load data

Data Warehouse DWH project started 2010 SQL 2008 R2 – tools & techniques have remained static Various “initiatives” have resulted in a confused data architecture Three competing data streams and lots of data marts Data Warehouse consists of 14 database, 200 SSIS packages, 4 multidimensional cubes 7 developers, 4 testers, 3 BAs, 1 S2T, 1 DBA, 1 PM Code-base contained over 100,000 files! One database had 3 VSDT projects – split storage, code and a schema! Configuration scattered across code base Manual build and very manual deploy – 1 guy, 4 days per month!  Each production release was getting longer, more complex and error prone

Tools and techniques for CI Key considerations Deployable artifacts What is generated from the code that I can deploy? Deployment How do I deploy the artifact? Configuration How can I set up the environment so that everything works?

Tools and techniques for CI Source Code Control (SCC) ALL code MUST be under Source Code Control SQL Server, SSIS, BIML, SSAS, SSRS, Test Suites etc. etc. Recommend Using Three Branches 1. Development branch 2. Release branch 3. Prod branch SCC Locking strategy: Use optimistic locking for SQL, C# Use pessimistic locking for SSIS, SSAS and SSRS

Tools and techniques for CI SQL Server Data Tools Declarative model design environment for SQL Server Requires Visual Studio Supports SQL Server Very easy to import an existing database Must replace hard-coded database names with variables Add references to other databases and setup SQLCmd variables Don’t upgrade VSDT projects Instead start a new SSDT project and import a deployed database instance Then transfer over pre- and post-deploy scripts

Tools and techniques for CI SQL Server Data Tools

SQL Server Data Tools Adding a Database Reference

SQL Server Data Tools Publishing your database

SQL Server Data Tools DAC Publish Profile

Tools and techniques for CI SQL Server Data Tools Build generates a DACPAC => “deployable artifact” Contains entire database model Conforms to Open Packaging Convention = ZIP file! Use MsBuild to create DACPAC from solutions Use SQLPackage.exe to deploy DACPAC

The many actions of SQLPackage.exe Publish Deploys a DACPAC Script Generates a T-SQL deployment script from a DACPAC Extract Creates a DACPAC from a database Export Creates a BACPAC Import Imports a BACPAC DeployReport List of changes new deploy will make DriftReport List of changes since last deploy

Tools and techniques for CI PowerShell PowerShell is the “glue” for your CI project Part of Windows Management Framework 4.0 built into Windows Server 2012 R2 and Windows 8.1 Download and install WMF 4.0 for prior OS versions Advanced scripting Proper error handling Try-Catch Easy to read/write XML Ideal for dynamically generation of config files CmdLets Invoke-SQLCmd Invoke-ASCmd & SQLAS

Tools and techniques for CI psake Task-orientated build tool written in PowerShell Uses a dependency pattern similar to MSBuild or Make Download from Build script consist of Tasks Each task can depend on other tasks

Tools and techniques for CI psake

PowerShell Where to Start Create a DeployConfig.xml file Describes your server environment Maps databases to servers, solutions to databases Develop PowerShell functions to read config file Dynamically build SQLCmd variables to pass into: DAC Publish profiles Invoke-SQLCmd Post-Load Data Fix Scripts User permission scripts SSIS Configurations / SQL Agent Jobs Dynamically create Nuget spec XML Package your build

Tools and techniques for CI TeamCity Architecture

Tools and techniques for CI TeamCity

Build Log

Build Configuration

Build Step

Version Control Settings

Tools and techniques for CI TeamCity Notifier Tray icon Notifies developers of broken builds Pops up dialog Links to TeamCity web site

Tools and techniques for CI TeamCity Workflow 1. Build Release Pack – Nuget package containing SQL databases, SSIS packages, SSAS cubes, etc. 2. Deploy Release Pack to Build Server Run post-deployment tests Unit tests on stored procs, functions, triggers Check database model, cube model, defaults 3. Restore Cut-Down dataset and Load Execute SSIS Packages / Load Cube Run Post-Load Tests Reconcile SSAS cube with SQL database Regression tests Fixed data set data checks

Tools and techniques for CI SSIS Artifacts File Mode Deployment (pre-2012) Build does nothing useful! SSIS package => “deployable artifact” Deployment simply copies packages into target location File Mode Configuration Update Package Configurations using PowerShell to: Update XML config Set SQLCmd variables and run a SQLCmd script which updates the SSIS configuration table

Tools and techniques for CI SSIS Artifacts Project Mode Deployment (SQL Server 2012+) Build generates an ISPAC => “deployable artifact” Use IsDeploymentWizard.exe to deploy the packages Project Mode Configuration Use SSISDB catalog stored procedures to: Create Projects & Folders Create Environments & Variables etc. Run as SQLCmd script from PowerShell

Tools and techniques for CI Top tips to using SSDT & CI No User Permissions Database roles only Assign Windows Groups to Roles in a post-deploy script Don’t deploy SQL Agent Jobs to CI server Use PowerShell to call the commands instead Hold SSIS configuration scripts outside SSDT Hold pre- and post-deploy data fix scripts external to SSDT in a “release” folder

Tools and techniques for CI SSAS Artifacts Build Cannot be done with MsBuild! Must invoke Visual Studio (devenv.exe) to perform build Windows EXE => so pipe to Out-Null to force PowerShell to wait Generates a.AsDatabase file => “deployable artifact” Deploy Microsoft.AnalysisServices.Deployment.exe /s PowerShell to generate XML config files defining target server etc. Windows EXE => so pipe to Out-Null to force PowerShell to wait SSAS Partition Manager Deploys using AMO and also dynamically creates partitions SsasPartitionManager.codeplex.com

Tools and techniques for CI NBi Test Suite Open source framework to test your BI solutions Tests run using NUnit GUI or command-line runner Tests written in XML Can be dynamically manipulated using PowerShell Automatic generation of tests via: Tools provided with NBi suite – GenBI and GenBIL SELECT … FOR XML PowerShell etc. Run SQL, MDX and DAX queries Extract queries from SSRS reports Run SSIS packages and check “side effects” Check model structure

Tools and techniques for CI NBi Test Suite Extensive support for testing the model structure

Tools and techniques for CI NBi Test Suite Compare results of a query Static data set CSV Results of another query Check datatypes, nulls, empty strings, format etc. Apply tolerance and rounding Validate SQL query syntax Performance tests Clear the cache in test setup Check cube member count, ordering, existence etc.

Tools and techniques for CI TeamCity + NBi TeamCity test runner expects service messages Allows TeamCity to format failing tests nicely ##teamcity[testStarted name='MyTest.test1'] ##teamcity[testFailed name='MyTest.test1' message='failure message' details='message and stack trace'] ##teamcity[testFinished name='MyTest.test1']

Tools and techniques for CI TeamCity + NBi TeamCity provides NUnit runner  But NUnit runner expects a compiled DLL NBi Framework DLL can be referenced  But only one NBi Test Suite can be run TeamCity also provides a PowerShell runner  But they do not generate the appropriate service messages Solution: TeamCity provide add-in which causes NUnit to generate the relevant service messages Use PowerShell to invoke NUnit console app TeamCity displays nicely formatted test results

Tools and techniques for CI TeamCity + NBi

Tools and techniques for CI Using SSDT for Unit Testing Add a Unit Test C# project to your SSDT solution

Tools and techniques for CI SSDT Code Analysis T-SQL Design Issues Checks for code that might not behave the way you expect Deprecated syntax Issues that could cause problems in the design T-SQL Naming Issues Naming issues arise when a database object violates generally accepted conventions T-SQL Performance Issues Code that might noticeably reduce speed of database operations Extensible model Write your own Code Analysis

SQL Server Data Tools SSDT + T4 Templates T4 = Text Template Transformation Toolkit Built into Visual Studio Create code from code Example: History tables and triggers Old data should be written to a history table every time an update done to the main table Problem: 200 main tables = 200 history tables triggers

SQL Server Data Tools SSDT + T4 Templates Three ways you could implement T4 Templates 1. Use ADO.NET to query catalog views on a materialized (deployed) copy of the databasecatalog views 2. Use the Data-tier Application Framework (DACFx) to query the content of the DACPAC generated by SSDT on your last buildData-tier Application Framework 3. Use the Data-tier Application Framework (DACFx) to query the in-memory content of your SSDT projectData-tier Application Framework Very few examples Download my toolkit from t4dacfx2tsql.codeplex.comt4dacfx2tsql.codeplex.com Read my blog on

Download my toolkit from t4dacfx2tsql.codeplex.com t4dacfx2tsql.codeplex.com

Continuous Integration and the Data Warehouse Dr. John Tunnicliffe Decision Analytics Independent BI Architect & Hands-On Developer Mobile: Blog: