Showing posts with label Continuous Deployment. Show all posts
Showing posts with label Continuous Deployment. Show all posts

2020-08-08

2020-08-08 Saturday - Researching: Azure DevOps Build Pipelines

Photo by JJ Ying on Unsplash
https://unsplash.com/photos/4XvAZN8_WHo
 

This weekend I'm doing a bit of a deep-dive research into the current state of features, capabilities, and limitations - in Azure DevOps Build Pipelines - and researching additional capabilities that are offered by plugins in the Azure DevOps section of the Visual Studio Marketplace.

My corresponding LinkedIn post.


Going forward, I'll continue gathering information on this topic in my Lab.Cloud.Azure github repository, in this file:
https://github.com/intltechventures/Lab.Cloud.Azure/blob/master/Pipelines.md

1.0 Azure DevOps Build Pipelines

1.1 References

- https://azure.microsoft.com/en-us/services/devops/pipelines/

- Azure Pipelines Documentation
  + https://docs.microsoft.com/en-us/azure/devops/pipelines/?view=azure-devops

- What is Azure Pipelines?
  + https://docs.microsoft.com/en-us/azure/devops/pipelines/get-started/what-is-azure-pipelines?view=azure-devops
    * "Azure Pipelines is a cloud service that you can use to automatically build and test your code project and make it available to other users."

- Key Concepts
  + https://docs.microsoft.com/en-us/azure/devops/pipelines/get-started/key-pipelines-concepts?view=azure-devops

- Getting Started
  + https://docs.microsoft.com/en-us/azure/devops/pipelines/get-started/pipelines-get-started?view=azure-devops
    * "You define your pipeline in a YAML file called azure-pipelines.yml with the rest of your app."
    * See "Feature Availability" table

- Task Types & Usage
  + https://docs.microsoft.com/en-us/azure/devops/pipelines/process/tasks?view=azure-devops&tabs=yaml
  + https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/?view=azure-devops
  + https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/?view=azure-devops#tool
    * https://github.com/Microsoft/azure-pipelines-tasks

  + Build & Release Tasks:
    * https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/?view=azure-devops
      * Android Signing Build & Release Task
        * https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/android-signing?view=azure-devops
        
  + Add a Build or Release Task
    * https://docs.microsoft.com/en-us/azure/devops/extend/develop/add-build-task?view=azure-devops

  + Download Pipeline Artifacts task
    * https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/download-pipeline-artifact?view=azure-devops

  + Download Secure File Task
    * https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/download-secure-file?view=azure-devops

  + Jenkins Queue Job task
    * https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/jenkins-queue-job?view=azure-devops

  + Jenkins Download Artifacts task
    * https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/jenkins-download-artifacts?view=azure-devops

  + File Upload Task
    * https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/ftp-upload?view=azure-devops

  + Copy Files Task
    * https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/copy-files?view=azure-devops&tabs=yaml
 
  + Publish Pipeline Artifacts task
    * https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/publish-pipeline-artifact?view=azure-devops

  + Publish Build Artifacts task
    * https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/publish-build-artifacts?view=azure-devops

  + Install Apple Provisioning Profile task
    * https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/install-apple-provisioning-profile?view=azure-devops

- Expressions
  + https://docs.microsoft.com/en-us/azure/devops/pipelines/process/expressions?view=azure-devops#functions
    * Re: https://stackoverflow.com/questions/54931739/task-custom-condition-does-a-given-file-exist
      * "There is no built in condition or function that operates off of the presence or absence of a file."
      * "You can write and run a script that sets a variable, then check the contents of the variable."
      * Example:
            $fileExists = Test-Path -Path "$(System.DefaultWorkingDirectory)/file.txt"
            Write-Output "##vso[task.setvariable variable=FileExists]$fileExists"
        See posting for secondary task
      
- Integration Applications
  + https://docs.microsoft.com/en-us/azure/devops/integrate/?view=azure-devops
    * "You can build custom applications or services that integrate with your Azure DevOps and Team Foundation Server (TFS) accounts by using the REST APIs to make direct HTTP calls, or utilize our .NET Client Libraries."

  + Service Hooks in Azure DevOps Services
    * https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/service-hooks?view=azure-devops
      * "Using the Subscriptions REST APIs, you can programmatically create a subscription that performs an action on an external (consumer) service when a specific event occurs in a project."

  + Service hook consumers for Azure DevOps Services
    * https://docs.microsoft.com/en-us/azure/devops/service-hooks/consumers?view=azure-devops
      * "Use service hook consumers to programmatically create a subscription. The subscription specifies the event, the consumer and the action. Select the consumer that you want to use in your subscription from the following consumers:..."
        * Web Hooks, POST via HTTP
          * https://docs.microsoft.com/en-us/azure/devops/service-hooks/consumers?view=azure-devops#webhooks

- Specify events that trigger pipelines
  + https://docs.microsoft.com/en-us/azure/devops/pipelines/build/triggers?view=azure-devops
    * CI Triggers in Github
      * https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/github?view=azure-devops&tabs=yaml#ci-triggers


- Notifications
  + https://docs.microsoft.com/en-us/azure/devops/notifications/about-notifications?view=azure-devops
    * "Notifications help you and your team stay informed about activity that occurs within your Azure DevOps projects. You're notified when changes occur to work items, code reviews, pull requests, source control files, and builds. You can be notified via email."


- File matching patterns reference
  + https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/file-matching-patterns?view=azure-devops

- YAML schema reference
  + https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema%2Cparameter-schema
    * "This article is a detailed reference guide to Azure Pipelines YAML pipelines. It includes a catalog of all supported YAML capabilities and the available options."

1.2 Visual Studio Marketplace - Azure DevOps

- https://marketplace.visualstudio.com/search?target=AzureDevOps&category=Azure%20Pipelines&sortBy=Installs

- AWS Toolkit for Azure DevOps
  + https://github.com/aws/aws-toolkit-azure-devops
  + https://docs.aws.amazon.com/vsts/latest/userguide/welcome.html
  + https://marketplace.visualstudio.com/items?itemName=AmazonWebServices.aws-vsts-tools
    * "Tasks for Amazon S3, AWS Elastic Beanstalk, AWS CodeDeploy, AWS Lambda and AWS CloudFormation and more, and running commands in the AWS Tools for Windows PowerShell module and the AWS CLI."
    * "AWSCLI - Interact with the AWSCLI (Windows hosts only)"
    * "AWS Powershell Module - Interact with AWS through powershell (Windows hosts only)"
    * "Beanstalk - Deploy ElasticBeanstalk applications"
    * "CodeDeploy - Deploy with CodeDeploy"
    * "CloudFormation - Create/Delete/Update CloudFormation stacks"
    * "ECR - Push an image to an ECR repository"
    * "Lambda - Deploy from S3, .net core applications, or any other language that builds on Azure DevOps"
    * "S3 - Upload/Download to/from S3 buckets"
    * "Secrets Manager - Create and retrieve secrets"
    * "SQS - Send SQS messages"
    * "SNS - Send SNS messages"
    * "Systems manager - Get/set parameters and run commands"

- Publishing to Apple Store
  + https://github.com/microsoft/app-store-vsts-extension
    * "Visual Studio Team Services (VSTS) extension for performing continuous delivery to the App Store store from your automated CI builds"
  + https://marketplace.visualstudio.com/items?itemName=ms-vsclient.app-store
    * "Provides tasks for publishing to Apple's App Store from a TFS/Azure DevOps build or release pipeline"
    * "The tasks install and use fastlane tools. fastlane requires Ruby 2.0.0 or above and recommends having the latest Xcode command line tools installed on the MacOS computer."
  + https://github.com/fastlane/fastlane
    * "The easiest way to automate building and releasing your iOS and Android apps"

- AWS S3 Upload
  + https://marketplace.visualstudio.com/items?itemName=MFelling.AWSS3Upload

- File Utilities Build Tasks
  + https://marketplace.visualstudio.com/items?itemName=richardfennellBM.BM-VSTS-FileCopier-Tasks


- Changed files
  + https://marketplace.visualstudio.com/items?itemName=touchify.vsts-changed-files

- Download a file
  + https://marketplace.visualstudio.com/items?itemName=Fizcko.azure-devops-download-a-file

- File Operations
  + https://marketplace.visualstudio.com/items?itemName=KirKone.fileoperations

1.3 Azure DevOps Feature Requests - and possible workarounds

- Run task if file/directory exists #1877
  + https://github.com/MicrosoftDocs/azure-devops-docs/issues/1877
  + See pseudo code example suggested, using script task

 - bash: |
   if [ -f your-file-here.txt ]; then
    echo "##vso[task.setVariable variable=FILEEXISTS]true"
   fi
- task: Foo@1
condition: eq(variables.FILEEXISTS, 'true')

- Add an exists() on Task Custom Condition
  + https://developercommunity.visualstudio.com/idea/366095/add-an-exists-on-task-custom-condition.html


1.4 Third-Party Solutions

- WinScp
  + SFTP/FTPS file transfers in Microsoft Azure WebJob
    * Re: Azure WebJob
      * https://docs.microsoft.com/en-us/azure/app-service/webjobs-create
    * "Starts immediately when the WebJob is created."
  + https://winscp.net/eng/docs/guide_microsoft_azure_webjob_sftp

1.5 Training Resources

- https://azuredevopslabs.com/

1.6 For Comparison: Jenkins Pipeline Capabilities

- https://www.jenkins.io/doc/book/getting-started/

- https://plugins.jenkins.io/
  + File System Trigger
    * https://github.com/jenkinsci/fstrigger-plugin
    * https://plugins.jenkins.io/fstrigger/
      * "The plug-in makes it possible to monitor changes of a file or a set of files in a folder."

- Pipeline Steps Reference
  + https://www.jenkins.io/doc/pipeline/steps/

1.7 Suggested Books

- Hands-on Azure Pipelines: Understanding Continuous Integration and Deployment in Azure DevOps 1st ed. Edition (July 2020)
  + https://www.amazon.com/Hands-Azure-Pipelines-Understanding-Integration/dp/1484259017/

- Agile Project Management with Azure DevOps: Concepts, Templates, and Metrics Paperback – (April 2019)
  + https://www.amazon.com/Agile-Project-Management-Azure-DevOps/dp/1484244826/
 
- Operations Anti-Patterns, DevOps Solutions, Jeffrey D. Smith, Manning Publications (MEAP, est. Fall 2020)
  + https://www.manning.com/books/operations-anti-patterns-devops-solutions

- Effective DevOps at Scale, Jennifer Davis, Ryan Daniels, O'Reilly Publishing (2016)
  + https://azure.microsoft.com/en-us/resources/effective-devops/
  + Note: 410 pages, *Free Book*
 

1.8 Articles of possible interest

2019

- How I Failed My Way to Success with Azure Pipelines
  + https://toastit.dev/2019/02/06/how-i-failed-my-way-to-success-with-azure-pipelines/
  + https://toastit.dev/2019/02/17/how-i-failed-my-way-to-success-with-azure-pipelines-part-2-release/

2015-11-01

2015-11-01 Sunday - CDN Best Practices

This posting is a placeholder for resources I find interesting - related to CDN Best Practices - that may be useful to to others...

https://en.wikipedia.org/wiki/Content_delivery_network

I'm currently evaluating Amazon's AWS CloudFront as a possible CDN solution
http://aws.amazon.com/cloudfront/

http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DownloadDistS3AndCustomOrigins.html

http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-creating-console.html

http://docs.aws.amazon.com/AmazonCloudFront/latest/APIReference/CreateDistribution.html

http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web.html

http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ServingCompressedFiles.html

http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_cloudfront


S3 limitation on creating directory structures for serving CDN content
 see Phil P's last response - Apr 24, 2013 11:56pm
- this invalidated an assumption I had of using a CDN release directory structure with S3 - but seems to state that it could be done with an EC2 instance as a custom origin.

I also noted this entry, re: Invalidation of paths is not (?) supported with wildcards...

A question I've raised on the AWS CloudFront forums

https://azure.microsoft.com/en-us/documentation/articles/best-practices-cdn/ 
"Versioning and cache-control You must consider how you will update static content and deploy new versions. The CDN does not currently provide a mechanism for flushing content so that new versions are available. This is a similar challenge to managing client side caching, such as in a web browser."
"Testing It can be difficult to perform local testing of your CDN settings when developing and testing an application locally or in staging."
"You cannot set up a CDN endpoint for an application deployed in Azure staging, or in the local Azure emulator in Visual Studio. This will affect unit testing, functional testing, and final pre-deployment testing. You must allow for this by implementing an alternative mechanism. For example, you could pre-deploy the content to the CDN using a temporary custom application or utility, and perform testing during the period it is cached. Alternatively, use compile directives or global constants to control where the application loads the resources from. For example, when running in debug mode it could load resources such as client-side script bundles and other content from a local folder, and use the CDN when running in release mode."

A lists of CDN Vendors...
http://blog.streamingmedia.com/2014/07/cdnvendors.html

Heroku's Fastly
https://devcenter.heroku.com/articles/fastly

Marrying CDNs with front-end optimization
http://www.webperformancetoday.com/2012/05/14/cdn-feo-front-end-optimization-web-acceleration/

2013-11-26

2013-11-26 Tuesday - Deployment Optimization



A nice little nugget of a problem was handed to me today: identify ways to help an operations team reduce their system maintenance / deployment window [for production system updates] that has somehow grown to require a xx-hour window, and achieve zero downtime (or as close as possible).

The environemnt is complicated in the extreme: highly regulated industry, compliance requirements, clustered servers, high availability, PCI security zones, 3rd party software/service providers, cloud service providers/integrations (SaaS and PaaS), frequent commercial software upgrades/patches, vendor constraints on database schema changes, disaster recovery dependencies, a legion of upstream and downstream data integration dependencies.

For the last year I've been carefully planting seeds of certain ideas in various conversations with key stakeholders within an organization - to begin the gradual introduction of concepts and practices such as DevOps, Continuous Deployment, and Continuous Operations. Now that a sufficient level of pain has been experienced, there is a broad consensus and acceptance that there needs to be change.

"He was not in a hurry, 'hurry' being one human concept he had failed to grok at all. He was sensitively aware of the key importance of correct timing in all acts — but with the Martian approach: correct timing was accomplished by waiting."
Stranger in a Strange Land, by Robert E. Heinlein

I have some ideas, but as a good researcher, first order of business is to review current directions, trends, peer articles.  This posting will be a place for me to share some of the information that may be of interest to others:

Zero Downtime, Instant Deployment and Rollback
http://www.ebaytechblog.com/2013/11/21/zero-downtime-instant-deployment-and-rollback/

Jevgeni Kabanov (ZeroTurnaround)
Pragmatic Continuous Delivery, at W-JAX 2012
http://vimeo.com/79959315

Continuous Operations for Zero Downtime Deployments
http://www.virtualizationpractice.com/continuous-operations-for-zero-downtime-deployments-22680/

The Virtualization Practice
http://www.virtualizationpractice.com/

Deploying the Netflix API
http://techblog.netflix.com/2013/08/deploying-netflix-api.html


Cloud Architecture Tutorial
Constructing Cloud Architecture the Netflix Way
Gluecon May 23rd, 2012, by Adrian Cockroft
http://www.slideshare.net/adrianco/netflix-architecture-tutorial-at-gluecon

Cassandra in the Netflix Architecture, Denis Sheahan
CassandraEU London March 28th, 2012
http://www.slideshare.net/acunu/cassandra-eu-2012-netflixs-cassandra-architecture-and-open-source-efforts

Patterns for Continuous Delivery, Reactive, High Availability, DevOps and Cloud Native Open Source with Netflix OSS
Adrian Cockroft + Ben Christensen, YOW! Workshop Dec'2013
https://speakerdeck.com/adrianco/patterns-for-continuous-delivery-reactive-high-availability-devops-and-cloud-native-open-source-with-netflixoss

Best Practices for Zero Risk, Zero Downtime Database Maintenance
http://www.oracle.com/us/products/database/311390-133499.pdf

VMware vSphere High Availability 5.0 Deployment Best Practices
http://www.vmware.com/files/pdf/techpaper/vmw-vsphere-high-availability.pdf

Free Ebook: Continuous Delivery — What It Is and How to Get Started
http://info.puppetlabs.com/download-free-continuous-delivery-ebook.html

The Phoenix Project, A Novel About IT, DevOps & Helping Your Business Win
http://www.amazon.com/Phoenix-Project-DevOps-Helping-Business/dp/0988262592/

How Draw Something Scaled to 50 million New Users, in 50 Days, with Zero Downtime
http://www.infoq.com/presentations/games-scalability-omgpop

I Ain't Afraid of No Downtime: Scaling Continuous Deployment, by Cody Powell
http://www.codypowell.com/taods/2012/04/i-aint-afraid-of-no-downtime-scaling-continuous-deployment.html

Mandi Walls free ebook, Building a DevOps Culture [Kindle]
http://www.amazon.com/Building-DevOps-Culture-Mandi-Walls-ebook/dp/B00CBM1WFC

Daily Dose of DevOps: 27 People to Follow on Twitter
http://puppetlabs.com/blog/daily-dose-devops-27-people-follow


Selected QCON 2013 San Francisco presentations:

Adopting Continuous Delivery, Adjusting your Architecture
Rachel Laycock, ThoughtWorks
http://qconsf.com/system/files/presentation-slides/Adopting%20Continuous.pdf
 Build Your Own PaaS the Netflix Way
Sudhir Tonse, Manager, Cloud Platform Infrastructure, Netflix
http://qconsf.com/system/files/presentation-slides/BuildYourOwnPaaSTheNetflixWay-QConSF.pdf
Facebook Infrastructure
Pedro Canahuati, Director, Infrastructure Operations
http://qconsf.com/system/files/presentation-slides/ScalingtheOperationsOrganizationatFacebook.pdf

Tools:
Liquidbase:
  • Improved checksum performance
  • CORE-1509: Significantly decreased memory usage, especially with large sql files
  • CORE-1533: Performance improvements in dropAll

ZeroTurnAround's LiveRebel:

 log4j2:
  • "Log4j 2 can automatically reload its configuration upon modification"
  • "Log4j 2 contains next-generation Asynchronous Loggers based on the LMAX Disruptor library. In multi-threaded scenarios Asynchronous Loggers have 10 times higher throughput and orders of magnitude lower latency than Log4j 1.x"

  • Note the performance benchmark results recently posted on takipiblog.com


Puppet Labs:

2013-09-25

2013-09-25 Wednesday - Tooling to Support Continuous Deployment

This posting is a placeholder for resources links and notes about tooling that I find interesting to support DevOps in the challenges of Configuration Management and [Continuous?] Deployment.

For some somewhat agnostic overviews of tooling and processes that can support continuous deployment  in practice...these presentations may be of interest:


While many companies have stringent regulatory constraints that require more thoughtful and methodical approaches to deployment, I thought it worth noting how Etsy.com implemented a RADICAL (!) DevOps culture - as an inspiring example to challenge status quo thinking of "but-that's-not-the-way-we-do-things-here..."

A Wikipedia article - providing a sparse summary/survey of some open source solutions for automated deployment tooling...

There is a great deal of fast-paced innovation in the tooling space for deployment & configuration management – here are some of the tools (slightly listed in order of what I find to be interesting and innovative)…


Microsoft System Center 2012

Less sophisticated, but perhaps a good example of how some shops can still make improvements over manual processes...even if it is just by doing things with bare-bones scripting…for example, via Rex

WordCount

Copyright

© 2001-2026 International Technology Ventures, Inc., All Rights Reserved.