SlideShare uma empresa Scribd logo
1 de 20
Baixar para ler offline
AETN Digital Media | Confidential and Proprietary
TEMPLATE ABSTRACTION AND
AUTOMATED DEPLOYMENTS TO FASTLY
A Practical Walkthrough on Real Life Experiences
AETN Digital Media | Confidential and Proprietary
Then ☹
Manual UI Based Implementation
AETN Digital Media | Confidential and Proprietary
30m-1hr x Envs
Manual Process Back Then
• Caching
• Shielding
• Geographical
• Device Detection
• Backends
• Redirects
• Proxies
• Authorization
www.aetv.com
• Caching
• Shielding
• Geographical
• Device Detection
• Backends
• Redirects
• Proxies
• Authorization
www.mylifetime.com
• Caching
• Shielding
• Geographical
• Device Detection
• Backends
• Redirects
• Proxies
• Authorization
www.fyi.tv
• Caching
• Shielding
• Geographical
• Device Detection
• Backends
• Redirects
• Proxies
• Authorization
www.history.com
AETN Digital Media | Confidential and Proprietary
And then we have more sites!
30m-1hr x Env
30m-1hr x Env
30m-1hr x Env
AETN Digital Media | Confidential and Proprietary
Even more URLS added
30m-1hr x Env
30m-1hr x Env
30m-1hr x Env
30m-1hr x Env
30m-1hr x Env
30m-1hr x Env
AETN Digital Media | Confidential and Proprietary
Digging into Legacy Code!
AETN Digital Media | Confidential and Proprietary
Manual Process Back Then!
AETN Digital Media | Confidential and Proprietary
Update (100)
URLS
3 environments
Weeks of
work=
Manual Process Back Then!
AETN Digital Media | Confidential and Proprietary
DevOps Principals
• Collaboration
• Test everything
• Treat Infrastructure as code
• Breakdown the barriers
• Automate everything
• Measure & monitor everything
• Support business and IT agility
• Work as one team end to end
AETN Digital Media | Confidential and Proprietary
And Now ☺
Continuous
Integration
Fastly VCL
Templates APIs
Automated
Testing
EQUALS Awesome!
AETN Digital Media | Confidential and Proprietary
Continuous Integration
Selenium
Automated Process
CI Tool
AETN Digital Media | Confidential and Proprietary
GLOBALFASTLY BOILER PLATE
Sub vcl_recv
Sub vcl_fetch
Sub vcl_hit
Sub vcl_miss
Sub vcl_deliver
Sub vcl_error
Sub vcl_pass
SERVICES
Application URLS
Main.vcl
Backends.vcl
custom.vcl
default.vcl
Fastly Boiler Plate
Sub vcl_recv
call aetn_recv_shield
call aetn_recv_geo
call aetn_recv_cache
aetn.vcl
Template Abstraction
call aetn_recv_device
sub aetn_recv_shield
sub aetn_recv_geo
sub aetn_recv_cache
sub aetn_recv_device
AETN Digital Media | Confidential and Proprietary
Environment Agnostic Implementation
• Separate Service for each Env: {env}-abc.com
• Abstract Env Specific Backends in separate VCLs: {env}-backends.vcl
Backend dev_abc_com {
.first_byte_timeout = 3s;
.connect_timeout = 1s;
.dynamic = true;
.max_connections = 200;
.between_bytes_timeout = 3s;
.share_key = ”COMMONBACKEND";
.port = "443";
.host = ”dev.abc.com";
.probe = {
.url = "/aetn-heartbeat.html";
.interval = 30s;
.timeout = 3s;
.window = 5;
.threshold = 2;
}
}
• Use GITFlow guidelines
• CI Tool reads the config file to deploy to correct env
"environments" : {
"dev" : {
"ref" : "refs/heads",
"servers" : [
{
"id" : ”ABC567defgzThQ"
}
]
},
AETN Digital Media | Confidential and Proprietary
CIDataFlowforManagingEnvAgnostic
CI ToolGitHUB
Config File
(Env to Service Mapping)
Process
qa-backend.vcl
Process
dev-backend.vcl
Process all common files
Process
prod-backend.vcl
Event Payload
Notification to
CI Tool
Process Payload
and identify Event Type
Identify
ENV and
Service ID
QA
FASTLY
Deploy Files and Activate
DEV PROD
Commit VCL
AETN Digital Media | Confidential and Proprietary
DeploymentWorkFlowUsingFastlyAPI
List of Files Modified
Service/
Common
Retrieve the list of Services
Parse the list of services
Retrieve the service and
common files
Fastly Dev Version
(/service/search?name)
Clone New Version
(/service/service_id/version/number/clone)
Deploy Files
(/service/service_id/version/version/vcl/{main})
Activate
(/service/service_id/version/number/activate)
Create Dev Version
(/service/service_id/version/number/clone)
GITHUB
Deployment
Object
Common
Service
No
Yes
AETN Digital Media | Confidential and Proprietary
Update (100)
URLS
3 environments
Weeks of
work=
Automated Process Now!
From
To
Update (100)
URLS
3 environments a few Minutes
=
To
AETN Digital Media | Confidential and Proprietary
Workflow in Action
Update TTL for all sites
AETN Digital Media | Confidential and Proprietary
• Create a feature branch
• GIT Clone Repo
$ git clone https://USERNAME:TOKEN_OR_PASSWORD@github.com/aenetworks/
REPO_NAME.git fastly
Cloning into 'fastly'...
remote: Counting objects: 11441, done.
remote: Compressing objects: 100% (127/127), done.
remote: Total 11441 (delta 71), reused 0 (delta 0), pack-reused 11313
Receiving objects: 100% (11441/11441), 1.67 MiB | 1.17 MiB/s, done.
Resolving deltas: 100% (7939/7939), done.
Checking connectivity... done.
=================================================================================
====================================
WorkflowinAction
$ git checkout -b sd-increase-ttl
Switched to a new branch 'sd-increase-ttl'
=================================================================================
=====================================
if ((beresp.status == 200) && req.url ~ ".(aif|aiff|au|avi|bin|bmp|cab|carb|cct|
cdf|class|css|doc|dcr|dtd|eot|exe|flv|gcf|gff|gif|grv|html|hqx|ico|ini|jpeg|jpg|
js|json|mov|mp3|nc|otf|pct|png|ppc|pws|svg|swa|swf|ttf|txt|vbs|w32|wav|wbmp|wml|
wmlc|wmls|wmlsc|xsd|zip|webp|jxr|hdp|wdp)($|?)" ) {
set beresp.ttl = 36h;
}
=================================================================================
========================================
AETN Digital Media | Confidential and Proprietary
WorkflowinAction
if ((beresp.status == 200) && req.url ~ ".(aif|aiff|au|avi|bin|bmp|cab|carb|cct|
cdf|class|css|doc|dcr|dtd|eot|exe|flv|gcf|gff|gif|grv|html|hqx|ico|ini|jpeg|jpg|
js|json|mov|mp3|nc|otf|pct|png|ppc|pws|svg|swa|swf|ttf|txt|vbs|w32|wav|wbmp|wml|
wmlc|wmls|wmlsc|xsd|zip|webp|jxr|hdp|wdp)($|?)" ) {
set beresp.ttl = 36h;
}
• Modify TTL in any editor
• Dev:
• GIT Commit and Push to Feature Branch
$ git commit -m "Increased the TTL" -a
[sd-increase-ttl f5d4bff] Increased the TTL
1 file changed, 1 insertion(+), 1 deletion(-)
$ git push origin sd-increase-ttl
Counting objects: 6, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 716 bytes | 0 bytes/s, done.
Total 6 (delta 2), reused 0 (delta 0)
To https://USERNAME:TOKEN_OR_PASSWORD@github.com/aenetworks/REPO_NAME.git
* [new branch] sd-increase-ttl -> sd-increase-ttl
wrap
Today at 4:16 PM • 2KB Plain Text snippet • Private snippet shared with you
shift+enter to add a new line
• QA and Prod
• Follow GIT Flow to Create Pull request and release to appropriate Env
AETN Digital Media | Confidential and Proprietary
Thanks!

Mais conteúdo relacionado

Mais procurados

Ruby HTTP clients comparison
Ruby HTTP clients comparisonRuby HTTP clients comparison
Ruby HTTP clients comparison
Hiroshi Nakamura
 

Mais procurados (20)

Stupid Boot Tricks: using ipxe and chef to get to boot management bliss
Stupid Boot Tricks: using ipxe and chef to get to boot management blissStupid Boot Tricks: using ipxe and chef to get to boot management bliss
Stupid Boot Tricks: using ipxe and chef to get to boot management bliss
 
Altitude NY 2018: Programming the edge workshop
Altitude NY 2018: Programming the edge workshopAltitude NY 2018: Programming the edge workshop
Altitude NY 2018: Programming the edge workshop
 
Securing Prometheus exporters using HashiCorp Vault
Securing Prometheus exporters using HashiCorp VaultSecuring Prometheus exporters using HashiCorp Vault
Securing Prometheus exporters using HashiCorp Vault
 
Altitude NY 2018: Leveraging Log Streaming to Build the Best Dashboards, Ever
Altitude NY 2018: Leveraging Log Streaming to Build the Best Dashboards, EverAltitude NY 2018: Leveraging Log Streaming to Build the Best Dashboards, Ever
Altitude NY 2018: Leveraging Log Streaming to Build the Best Dashboards, Ever
 
Autoscaling with hashi_corp_nomad
Autoscaling with hashi_corp_nomadAutoscaling with hashi_corp_nomad
Autoscaling with hashi_corp_nomad
 
Ruby HTTP clients comparison
Ruby HTTP clients comparisonRuby HTTP clients comparison
Ruby HTTP clients comparison
 
Gruntwork Executive Summary
Gruntwork Executive SummaryGruntwork Executive Summary
Gruntwork Executive Summary
 
Testing your infrastructure with litmus
Testing your infrastructure with litmusTesting your infrastructure with litmus
Testing your infrastructure with litmus
 
Static Typing in Vault
Static Typing in VaultStatic Typing in Vault
Static Typing in Vault
 
About Node.js
About Node.jsAbout Node.js
About Node.js
 
Bootstrapping multidc observability stack
Bootstrapping multidc observability stackBootstrapping multidc observability stack
Bootstrapping multidc observability stack
 
bootstrapping containers with confd
bootstrapping containers with confdbootstrapping containers with confd
bootstrapping containers with confd
 
Observability with Consul Connect
Observability with Consul ConnectObservability with Consul Connect
Observability with Consul Connect
 
Node.js cluster
Node.js clusterNode.js cluster
Node.js cluster
 
Altitude NY 2018: 132 websites, 1 service: Your local news runs on Fastly
Altitude NY 2018: 132 websites, 1 service: Your local news runs on FastlyAltitude NY 2018: 132 websites, 1 service: Your local news runs on Fastly
Altitude NY 2018: 132 websites, 1 service: Your local news runs on Fastly
 
Creating Reusable Puppet Profiles
Creating Reusable Puppet ProfilesCreating Reusable Puppet Profiles
Creating Reusable Puppet Profiles
 
Composable and streamable Play apps
Composable and streamable Play appsComposable and streamable Play apps
Composable and streamable Play apps
 
Integrating icinga2 and the HashiCorp suite
Integrating icinga2 and the HashiCorp suiteIntegrating icinga2 and the HashiCorp suite
Integrating icinga2 and the HashiCorp suite
 
A complete guide to Node.js
A complete guide to Node.jsA complete guide to Node.js
A complete guide to Node.js
 
WebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! FrameworkWebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! Framework
 

Destaque

Destaque (11)

Abstraction
AbstractionAbstraction
Abstraction
 
Design Patterns on Service Abstraction
Design Patterns on Service Abstraction Design Patterns on Service Abstraction
Design Patterns on Service Abstraction
 
Service design principles and patterns
Service design principles and patternsService design principles and patterns
Service design principles and patterns
 
Making ops life easier
Making ops life easierMaking ops life easier
Making ops life easier
 
Building Customer User Experiences from the Edge
Building Customer User Experiences from the EdgeBuilding Customer User Experiences from the Edge
Building Customer User Experiences from the Edge
 
Know your resolvers
Know your resolversKnow your resolvers
Know your resolvers
 
Next-gen API authentication
Next-gen API authenticationNext-gen API authentication
Next-gen API authentication
 
Addressing IPv6
Addressing IPv6Addressing IPv6
Addressing IPv6
 
The perfect support ticket
The perfect support ticketThe perfect support ticket
The perfect support ticket
 
Progressive web apps
Progressive web appsProgressive web apps
Progressive web apps
 
Services Oriented Infrastructure in a Web2.0 World
Services Oriented Infrastructure in a Web2.0 WorldServices Oriented Infrastructure in a Web2.0 World
Services Oriented Infrastructure in a Web2.0 World
 

Semelhante a VCL template abstraction model and automated deployments to Fastly

How netflix manages petabyte scale apache cassandra in the cloud
How netflix manages petabyte scale apache cassandra in the cloudHow netflix manages petabyte scale apache cassandra in the cloud
How netflix manages petabyte scale apache cassandra in the cloud
Vinay Kumar Chella
 

Semelhante a VCL template abstraction model and automated deployments to Fastly (20)

Cloud Native: Designing Change-tolerant Software
Cloud Native: Designing Change-tolerant SoftwareCloud Native: Designing Change-tolerant Software
Cloud Native: Designing Change-tolerant Software
 
Cloud Native Architectures for Devops
Cloud Native Architectures for DevopsCloud Native Architectures for Devops
Cloud Native Architectures for Devops
 
Cloud Native: Designing Change-tolerant Software
Cloud Native: Designing Change-tolerant SoftwareCloud Native: Designing Change-tolerant Software
Cloud Native: Designing Change-tolerant Software
 
Streaming Dataflow with Apache Flink
Streaming Dataflow with Apache Flink Streaming Dataflow with Apache Flink
Streaming Dataflow with Apache Flink
 
AWS re:Invent 2016: Service Integration Delivery and Automation Using Amazon ...
AWS re:Invent 2016: Service Integration Delivery and Automation Using Amazon ...AWS re:Invent 2016: Service Integration Delivery and Automation Using Amazon ...
AWS re:Invent 2016: Service Integration Delivery and Automation Using Amazon ...
 
Developing Resilient Cloud Native Apps with Spring Cloud
Developing Resilient Cloud Native Apps with Spring CloudDeveloping Resilient Cloud Native Apps with Spring Cloud
Developing Resilient Cloud Native Apps with Spring Cloud
 
TIAD : Automating the modern datacenter
TIAD : Automating the modern datacenterTIAD : Automating the modern datacenter
TIAD : Automating the modern datacenter
 
Atmosphere Conference 2015: Taming the Modern Datacenter
Atmosphere Conference 2015: Taming the Modern DatacenterAtmosphere Conference 2015: Taming the Modern Datacenter
Atmosphere Conference 2015: Taming the Modern Datacenter
 
How do I run microservices in production using Docker.
How do I run microservices in production using Docker.How do I run microservices in production using Docker.
How do I run microservices in production using Docker.
 
Performance tests - it's a trap
Performance tests - it's a trapPerformance tests - it's a trap
Performance tests - it's a trap
 
Planning to Fail #phpne13
Planning to Fail #phpne13Planning to Fail #phpne13
Planning to Fail #phpne13
 
On-the-fly Visual Category Search in Web-scale Image Collections
On-the-fly Visual Category Search in Web-scale Image CollectionsOn-the-fly Visual Category Search in Web-scale Image Collections
On-the-fly Visual Category Search in Web-scale Image Collections
 
Docker presentasjon java bin
Docker presentasjon java binDocker presentasjon java bin
Docker presentasjon java bin
 
Plane Spotting
Plane SpottingPlane Spotting
Plane Spotting
 
Sadeem cloud native السحابة الطبيعية
Sadeem cloud native السحابة الطبيعيةSadeem cloud native السحابة الطبيعية
Sadeem cloud native السحابة الطبيعية
 
Scala, ECS, Docker: Delayed Execution @Coursera
Scala, ECS, Docker: Delayed Execution @CourseraScala, ECS, Docker: Delayed Execution @Coursera
Scala, ECS, Docker: Delayed Execution @Coursera
 
How we use and deploy Varnish at Opera
How we use and deploy Varnish at OperaHow we use and deploy Varnish at Opera
How we use and deploy Varnish at Opera
 
How netflix manages petabyte scale apache cassandra in the cloud
How netflix manages petabyte scale apache cassandra in the cloudHow netflix manages petabyte scale apache cassandra in the cloud
How netflix manages petabyte scale apache cassandra in the cloud
 
Chicago DevOps Meetup Nov2019
Chicago DevOps Meetup Nov2019Chicago DevOps Meetup Nov2019
Chicago DevOps Meetup Nov2019
 
Shipping Code like a keptn: Continuous Delivery & Automated Operations on k8s
Shipping Code like a keptn: Continuous Delivery & Automated Operations on k8sShipping Code like a keptn: Continuous Delivery & Automated Operations on k8s
Shipping Code like a keptn: Continuous Delivery & Automated Operations on k8s
 

Mais de Fastly

Mais de Fastly (20)

Revisiting HTTP/2
Revisiting HTTP/2Revisiting HTTP/2
Revisiting HTTP/2
 
Altitude San Francisco 2018: Preparing for Video Streaming Events at Scale
Altitude San Francisco 2018: Preparing for Video Streaming Events at ScaleAltitude San Francisco 2018: Preparing for Video Streaming Events at Scale
Altitude San Francisco 2018: Preparing for Video Streaming Events at Scale
 
Altitude San Francisco 2018: Building the Souther Hemisphere of the Internet
Altitude San Francisco 2018: Building the Souther Hemisphere of the InternetAltitude San Francisco 2018: Building the Souther Hemisphere of the Internet
Altitude San Francisco 2018: Building the Souther Hemisphere of the Internet
 
Altitude San Francisco 2018: The World Cup Stream
Altitude San Francisco 2018: The World Cup StreamAltitude San Francisco 2018: The World Cup Stream
Altitude San Francisco 2018: The World Cup Stream
 
Altitude San Francisco 2018: We Own Our Destiny
Altitude San Francisco 2018: We Own Our DestinyAltitude San Francisco 2018: We Own Our Destiny
Altitude San Francisco 2018: We Own Our Destiny
 
Altitude San Francisco 2018: Scale and Stability at the Edge with 1.4 Billion...
Altitude San Francisco 2018: Scale and Stability at the Edge with 1.4 Billion...Altitude San Francisco 2018: Scale and Stability at the Edge with 1.4 Billion...
Altitude San Francisco 2018: Scale and Stability at the Edge with 1.4 Billion...
 
Altitude San Francisco 2018: Moving Off the Monolith: A Seamless Migration
Altitude San Francisco 2018: Moving Off the Monolith: A Seamless MigrationAltitude San Francisco 2018: Moving Off the Monolith: A Seamless Migration
Altitude San Francisco 2018: Moving Off the Monolith: A Seamless Migration
 
Altitude San Francisco 2018: Bringing TLS to GitHub Pages
Altitude San Francisco 2018: Bringing TLS to GitHub PagesAltitude San Francisco 2018: Bringing TLS to GitHub Pages
Altitude San Francisco 2018: Bringing TLS to GitHub Pages
 
Altitude San Francisco 2018: HTTP Invalidation Workshop
Altitude San Francisco 2018: HTTP Invalidation WorkshopAltitude San Francisco 2018: HTTP Invalidation Workshop
Altitude San Francisco 2018: HTTP Invalidation Workshop
 
Altitude San Francisco 2018: HTTP/2 Tales: Discovery and Woe
Altitude San Francisco 2018: HTTP/2 Tales: Discovery and WoeAltitude San Francisco 2018: HTTP/2 Tales: Discovery and Woe
Altitude San Francisco 2018: HTTP/2 Tales: Discovery and Woe
 
Altitude San Francisco 2018: How Magento moved to the cloud while maintaining...
Altitude San Francisco 2018: How Magento moved to the cloud while maintaining...Altitude San Francisco 2018: How Magento moved to the cloud while maintaining...
Altitude San Francisco 2018: How Magento moved to the cloud while maintaining...
 
Altitude San Francisco 2018: Scaling Ethereum to 10B requests per day
Altitude San Francisco 2018: Scaling Ethereum to 10B requests per dayAltitude San Francisco 2018: Scaling Ethereum to 10B requests per day
Altitude San Francisco 2018: Scaling Ethereum to 10B requests per day
 
Altitude San Francisco 2018: Authentication at the Edge
Altitude San Francisco 2018: Authentication at the EdgeAltitude San Francisco 2018: Authentication at the Edge
Altitude San Francisco 2018: Authentication at the Edge
 
Altitude San Francisco 2018: WebAssembly Tools & Applications
Altitude San Francisco 2018: WebAssembly Tools & ApplicationsAltitude San Francisco 2018: WebAssembly Tools & Applications
Altitude San Francisco 2018: WebAssembly Tools & Applications
 
Altitude San Francisco 2018: Testing with Fastly Workshop
Altitude San Francisco 2018: Testing with Fastly WorkshopAltitude San Francisco 2018: Testing with Fastly Workshop
Altitude San Francisco 2018: Testing with Fastly Workshop
 
Altitude San Francisco 2018: Fastly Purge Control at the USA TODAY NETWORK
Altitude San Francisco 2018: Fastly Purge Control at the USA TODAY NETWORKAltitude San Francisco 2018: Fastly Purge Control at the USA TODAY NETWORK
Altitude San Francisco 2018: Fastly Purge Control at the USA TODAY NETWORK
 
Altitude San Francisco 2018: WAF Workshop
Altitude San Francisco 2018: WAF WorkshopAltitude San Francisco 2018: WAF Workshop
Altitude San Francisco 2018: WAF Workshop
 
Altitude San Francisco 2018: Logging at the Edge
Altitude San Francisco 2018: Logging at the Edge Altitude San Francisco 2018: Logging at the Edge
Altitude San Francisco 2018: Logging at the Edge
 
Altitude San Francisco 2018: Video Workshop Docs
Altitude San Francisco 2018: Video Workshop DocsAltitude San Francisco 2018: Video Workshop Docs
Altitude San Francisco 2018: Video Workshop Docs
 
Altitude San Francisco 2018: Programming the Edge
Altitude San Francisco 2018: Programming the EdgeAltitude San Francisco 2018: Programming the Edge
Altitude San Francisco 2018: Programming the Edge
 

Último

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Último (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

VCL template abstraction model and automated deployments to Fastly

  • 1. AETN Digital Media | Confidential and Proprietary TEMPLATE ABSTRACTION AND AUTOMATED DEPLOYMENTS TO FASTLY A Practical Walkthrough on Real Life Experiences
  • 2. AETN Digital Media | Confidential and Proprietary Then ☹ Manual UI Based Implementation
  • 3. AETN Digital Media | Confidential and Proprietary 30m-1hr x Envs Manual Process Back Then • Caching • Shielding • Geographical • Device Detection • Backends • Redirects • Proxies • Authorization www.aetv.com • Caching • Shielding • Geographical • Device Detection • Backends • Redirects • Proxies • Authorization www.mylifetime.com • Caching • Shielding • Geographical • Device Detection • Backends • Redirects • Proxies • Authorization www.fyi.tv • Caching • Shielding • Geographical • Device Detection • Backends • Redirects • Proxies • Authorization www.history.com
  • 4. AETN Digital Media | Confidential and Proprietary And then we have more sites! 30m-1hr x Env 30m-1hr x Env 30m-1hr x Env
  • 5. AETN Digital Media | Confidential and Proprietary Even more URLS added 30m-1hr x Env 30m-1hr x Env 30m-1hr x Env 30m-1hr x Env 30m-1hr x Env 30m-1hr x Env
  • 6. AETN Digital Media | Confidential and Proprietary Digging into Legacy Code!
  • 7. AETN Digital Media | Confidential and Proprietary Manual Process Back Then!
  • 8. AETN Digital Media | Confidential and Proprietary Update (100) URLS 3 environments Weeks of work= Manual Process Back Then!
  • 9. AETN Digital Media | Confidential and Proprietary DevOps Principals • Collaboration • Test everything • Treat Infrastructure as code • Breakdown the barriers • Automate everything • Measure & monitor everything • Support business and IT agility • Work as one team end to end
  • 10. AETN Digital Media | Confidential and Proprietary And Now ☺ Continuous Integration Fastly VCL Templates APIs Automated Testing EQUALS Awesome!
  • 11. AETN Digital Media | Confidential and Proprietary Continuous Integration Selenium Automated Process CI Tool
  • 12. AETN Digital Media | Confidential and Proprietary GLOBALFASTLY BOILER PLATE Sub vcl_recv Sub vcl_fetch Sub vcl_hit Sub vcl_miss Sub vcl_deliver Sub vcl_error Sub vcl_pass SERVICES Application URLS Main.vcl Backends.vcl custom.vcl default.vcl Fastly Boiler Plate Sub vcl_recv call aetn_recv_shield call aetn_recv_geo call aetn_recv_cache aetn.vcl Template Abstraction call aetn_recv_device sub aetn_recv_shield sub aetn_recv_geo sub aetn_recv_cache sub aetn_recv_device
  • 13. AETN Digital Media | Confidential and Proprietary Environment Agnostic Implementation • Separate Service for each Env: {env}-abc.com • Abstract Env Specific Backends in separate VCLs: {env}-backends.vcl Backend dev_abc_com { .first_byte_timeout = 3s; .connect_timeout = 1s; .dynamic = true; .max_connections = 200; .between_bytes_timeout = 3s; .share_key = ”COMMONBACKEND"; .port = "443"; .host = ”dev.abc.com"; .probe = { .url = "/aetn-heartbeat.html"; .interval = 30s; .timeout = 3s; .window = 5; .threshold = 2; } } • Use GITFlow guidelines • CI Tool reads the config file to deploy to correct env "environments" : { "dev" : { "ref" : "refs/heads", "servers" : [ { "id" : ”ABC567defgzThQ" } ] },
  • 14. AETN Digital Media | Confidential and Proprietary CIDataFlowforManagingEnvAgnostic CI ToolGitHUB Config File (Env to Service Mapping) Process qa-backend.vcl Process dev-backend.vcl Process all common files Process prod-backend.vcl Event Payload Notification to CI Tool Process Payload and identify Event Type Identify ENV and Service ID QA FASTLY Deploy Files and Activate DEV PROD Commit VCL
  • 15. AETN Digital Media | Confidential and Proprietary DeploymentWorkFlowUsingFastlyAPI List of Files Modified Service/ Common Retrieve the list of Services Parse the list of services Retrieve the service and common files Fastly Dev Version (/service/search?name) Clone New Version (/service/service_id/version/number/clone) Deploy Files (/service/service_id/version/version/vcl/{main}) Activate (/service/service_id/version/number/activate) Create Dev Version (/service/service_id/version/number/clone) GITHUB Deployment Object Common Service No Yes
  • 16. AETN Digital Media | Confidential and Proprietary Update (100) URLS 3 environments Weeks of work= Automated Process Now! From To Update (100) URLS 3 environments a few Minutes = To
  • 17. AETN Digital Media | Confidential and Proprietary Workflow in Action Update TTL for all sites
  • 18. AETN Digital Media | Confidential and Proprietary • Create a feature branch • GIT Clone Repo $ git clone https://USERNAME:TOKEN_OR_PASSWORD@github.com/aenetworks/ REPO_NAME.git fastly Cloning into 'fastly'... remote: Counting objects: 11441, done. remote: Compressing objects: 100% (127/127), done. remote: Total 11441 (delta 71), reused 0 (delta 0), pack-reused 11313 Receiving objects: 100% (11441/11441), 1.67 MiB | 1.17 MiB/s, done. Resolving deltas: 100% (7939/7939), done. Checking connectivity... done. ================================================================================= ==================================== WorkflowinAction $ git checkout -b sd-increase-ttl Switched to a new branch 'sd-increase-ttl' ================================================================================= ===================================== if ((beresp.status == 200) && req.url ~ ".(aif|aiff|au|avi|bin|bmp|cab|carb|cct| cdf|class|css|doc|dcr|dtd|eot|exe|flv|gcf|gff|gif|grv|html|hqx|ico|ini|jpeg|jpg| js|json|mov|mp3|nc|otf|pct|png|ppc|pws|svg|swa|swf|ttf|txt|vbs|w32|wav|wbmp|wml| wmlc|wmls|wmlsc|xsd|zip|webp|jxr|hdp|wdp)($|?)" ) { set beresp.ttl = 36h; } ================================================================================= ========================================
  • 19. AETN Digital Media | Confidential and Proprietary WorkflowinAction if ((beresp.status == 200) && req.url ~ ".(aif|aiff|au|avi|bin|bmp|cab|carb|cct| cdf|class|css|doc|dcr|dtd|eot|exe|flv|gcf|gff|gif|grv|html|hqx|ico|ini|jpeg|jpg| js|json|mov|mp3|nc|otf|pct|png|ppc|pws|svg|swa|swf|ttf|txt|vbs|w32|wav|wbmp|wml| wmlc|wmls|wmlsc|xsd|zip|webp|jxr|hdp|wdp)($|?)" ) { set beresp.ttl = 36h; } • Modify TTL in any editor • Dev: • GIT Commit and Push to Feature Branch $ git commit -m "Increased the TTL" -a [sd-increase-ttl f5d4bff] Increased the TTL 1 file changed, 1 insertion(+), 1 deletion(-) $ git push origin sd-increase-ttl Counting objects: 6, done. Delta compression using up to 4 threads. Compressing objects: 100% (6/6), done. Writing objects: 100% (6/6), 716 bytes | 0 bytes/s, done. Total 6 (delta 2), reused 0 (delta 0) To https://USERNAME:TOKEN_OR_PASSWORD@github.com/aenetworks/REPO_NAME.git * [new branch] sd-increase-ttl -> sd-increase-ttl wrap Today at 4:16 PM • 2KB Plain Text snippet • Private snippet shared with you shift+enter to add a new line • QA and Prod • Follow GIT Flow to Create Pull request and release to appropriate Env
  • 20. AETN Digital Media | Confidential and Proprietary Thanks!