SlideShare ist ein Scribd-Unternehmen logo
1 von 62
Downloaden Sie, um offline zu lesen
November 12, 2014 | Las Vegas, NV 
Thomas Lobinger and Jonathan Weiss, Amazon Web Services
OpsWorksBackend 
OpsWorksAgent 
Amazon EC2, Amazon EBS, EIP, 
Amazon VPC, Elastic Load Balancing…. Auto-Scaling, Auto-Healing…. 
On-instance execution viaChef client/zero 
Command 
JSON 
CommandLog+Status
Chef Client 
& 
Chef Server
AWS OpsWorks recipes 
Yourcustomrecipes
search(:node, “name:web1”) 
search(:node, “name:web*”)
appserver = search(:node, "role:php-app").first 
Chef::Log.info(”Private IP: #{appserver[:private_ip]}")
appserver = search(:node, "role:php-app").first 
Chef::Log.info(”Private IP: #{appserver[:private_ip]}")
{ 
"opsworks": { 
"data_bags": { 
"bag_name1": { 
"item_name1: { 
"key1" : “value1”, 
"key2" : “value2”, 
... 
} 
}, 
"bag_name2": { 
"item_name1": { 
"key1" : “value1”, 
"key2" : “value2”, 
... 
} 
}, 
... 
} 
} 
}
{ 
"opsworks": { 
"data_bags": { 
"myapp": { 
"mysql": { 
"username": "default-user", 
"password": "default-pass" 
} 
} 
} 
} 
} 
mything= data_bag_item("myapp", "mysql") 
Chef::Log.info("username: #{mything['username']}")
user= ENV[“payment_provider_user“] 
password= ENV[“payment_provider_password“] 
PaymentGateway.new(user, password)
Change cookbook 
Push change 
Stop an instance 
Update cookbooks 
Start an instance 
Trigger event or runlist 
Check logs
list_commands 
get_json 
run_command 
show_log
list 
# list event history (up to 10 events) 
# opsworks-agent-cli list 
2014-11-06T10:26:58setup 
2014-11-06T10:55:13configure2014-11-06T14:59:05execute_recipes 
2014-11-07T18:25:53deploy 
2014-11-07T18:34:11configure 
2014-11-08T10:05:23configure 
2014-11-08T14:43:43configure
get 
# show JSON events (latest or by type/timestamp) 
# opsworks-agent-cli get 
{ 
"ssh_users": { 
"2066": { 
"name": "thomas", 
"public_key": "ssh-rsa AAAAB3NzaC1...", 
"sudoer": true 
...
# list current agent folder and cookbooks 
# ls/opt/aws/opsworks/current 
cookbooks# OpsWorks cookbooks 
berkshelf-cookbooks# CookbooksfromBerkshelf 
site-cookbooks# Yourcookbooks 
merged-cookbooks# Resultingcookbooksforrun 
...
run 
# run last setup event (changed cookbooks, same JSON) 
# opsworks-agent-cli run setup 
# or select specific date 
# opsworks-agent-cli run 2014-11-08T14:43:43 
[2014-11-12 13:06:41] INFO [opsworks-agent(17817)]:About to re-run 'setup' from 2014-11-08T14:43:43 
Waiting for process 17817 
... 
Finished Chef run with exitcode 0
# change recipe 
# cd /opt/aws/opsworks/current/site-cookbooks 
# vim mycookbooks/recipes/default.rb 
# confirm success 
# opsworks-agent-cli run setup 
# commit back to your git repo 
# git commit -am “can develop on instance“ 
# git push
Destroy 
Create 
Converge 
Setup 
Verify 
Destroy
.kitchen.yml 
driver: 
name: opsworks 
stack_id: vvvvvvvv-wwww-xxxx-yyyy-zzzzzzzzzzzz 
provisioner: 
name: shell 
busser: 
ruby_bindir: /opt/aws/opsworks/local/bin
.kitchen.yml 
platforms: 
-name: Amazon Linux 2014.09 
-name: Ubuntu 12.04 LTS 
-name: Ubuntu 14.04 LTS 
suites: 
-name: default 
run_list: 
-recipe[demo::default]
# destroy, create, setup, converge, verify, destroy 
kitchen test 
kitchen verify [NAME|REGEXP|all]# run all 'tests' 
kitchen verify ubuntu# only ubuntus 
kitchen verify client# only client tests 
kitchen verify -c NUMBER# concurrency 
# Talk by Fletcher Nichol http://youtu.be/YzlCHAbJ7KM
‣attributes 
‣recipes 
‣templates 
▾test 
‣integration 
.kitchen.yml 
metadata.rb
‣attributes 
‣recipes 
‣templates 
▾test 
▾integration 
‣default<--test suite name 
.kitchen.yml 
metadata.rb
‣attributes 
‣recipes 
‣templates 
▾test 
▾integration 
▾default<--test suite name 
‣bats<--test framework 
.kitchen.yml 
metadata.rb
‣attributes 
‣recipes 
‣templates 
▾test 
▾integration 
▾default<--test suite name 
▾bats<--test framework 
htop_installed.bats<--the actual test 
.kitchen.yml 
metadata.rb
Test file htop_installed.bats 
#!/usr/bin/env bats 
@test "htop binary is found in PATH"{ 
run which htop 
[ "$status"-eq 0 ] 
}
5 
commit 
StackonEC2
$./opsrun.rb92ca56ec-1672-4db0-8c6e-a8566e7db671 'echo $SHELL' 
ruby: warning: RUBY_HEAP_MIN_SLOTS isobsolete. UseRUBY_GC_HEAP_INIT_SLOTS instead. 
Abouttoruna scripton stack92ca56ec-1672-4db0-8c6e- a8566e7db671 on 2 online instances 
... 
... 
jenkins2: 
/bin/bash 
php-app1: 
/bin/bash 
$
http://bit.ly/awsevals

Weitere ähnliche Inhalte

Mehr von Amazon Web Services

Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsAmazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareAmazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSAmazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAmazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareAmazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSAmazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 
Come costruire un'architettura Serverless nel Cloud AWS
Come costruire un'architettura Serverless nel Cloud AWSCome costruire un'architettura Serverless nel Cloud AWS
Come costruire un'architettura Serverless nel Cloud AWSAmazon Web Services
 
AWS Serverless per startup: come innovare senza preoccuparsi dei server
AWS Serverless per startup: come innovare senza preoccuparsi dei serverAWS Serverless per startup: come innovare senza preoccuparsi dei server
AWS Serverless per startup: come innovare senza preoccuparsi dei serverAmazon Web Services
 
Crea dashboard interattive con Amazon QuickSight
Crea dashboard interattive con Amazon QuickSightCrea dashboard interattive con Amazon QuickSight
Crea dashboard interattive con Amazon QuickSightAmazon Web Services
 
Costruisci modelli di Machine Learning con Amazon SageMaker Autopilot
Costruisci modelli di Machine Learning con Amazon SageMaker AutopilotCostruisci modelli di Machine Learning con Amazon SageMaker Autopilot
Costruisci modelli di Machine Learning con Amazon SageMaker AutopilotAmazon Web Services
 

Mehr von Amazon Web Services (20)

Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 
Come costruire un'architettura Serverless nel Cloud AWS
Come costruire un'architettura Serverless nel Cloud AWSCome costruire un'architettura Serverless nel Cloud AWS
Come costruire un'architettura Serverless nel Cloud AWS
 
AWS Serverless per startup: come innovare senza preoccuparsi dei server
AWS Serverless per startup: come innovare senza preoccuparsi dei serverAWS Serverless per startup: come innovare senza preoccuparsi dei server
AWS Serverless per startup: come innovare senza preoccuparsi dei server
 
Crea dashboard interattive con Amazon QuickSight
Crea dashboard interattive con Amazon QuickSightCrea dashboard interattive con Amazon QuickSight
Crea dashboard interattive con Amazon QuickSight
 
Costruisci modelli di Machine Learning con Amazon SageMaker Autopilot
Costruisci modelli di Machine Learning con Amazon SageMaker AutopilotCostruisci modelli di Machine Learning con Amazon SageMaker Autopilot
Costruisci modelli di Machine Learning con Amazon SageMaker Autopilot
 

Kürzlich hochgeladen

Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 

Kürzlich hochgeladen (20)

Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 

(APP301) AWS OpsWorks Under the Hood | AWS re:Invent 2014

  • 1. November 12, 2014 | Las Vegas, NV Thomas Lobinger and Jonathan Weiss, Amazon Web Services
  • 2.
  • 3.
  • 4.
  • 5. OpsWorksBackend OpsWorksAgent Amazon EC2, Amazon EBS, EIP, Amazon VPC, Elastic Load Balancing…. Auto-Scaling, Auto-Healing…. On-instance execution viaChef client/zero Command JSON CommandLog+Status
  • 6. Chef Client & Chef Server
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15. AWS OpsWorks recipes Yourcustomrecipes
  • 16.
  • 17.
  • 19. appserver = search(:node, "role:php-app").first Chef::Log.info(”Private IP: #{appserver[:private_ip]}")
  • 20. appserver = search(:node, "role:php-app").first Chef::Log.info(”Private IP: #{appserver[:private_ip]}")
  • 21. { "opsworks": { "data_bags": { "bag_name1": { "item_name1: { "key1" : “value1”, "key2" : “value2”, ... } }, "bag_name2": { "item_name1": { "key1" : “value1”, "key2" : “value2”, ... } }, ... } } }
  • 22. { "opsworks": { "data_bags": { "myapp": { "mysql": { "username": "default-user", "password": "default-pass" } } } } } mything= data_bag_item("myapp", "mysql") Chef::Log.info("username: #{mything['username']}")
  • 23.
  • 24. user= ENV[“payment_provider_user“] password= ENV[“payment_provider_password“] PaymentGateway.new(user, password)
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31. Change cookbook Push change Stop an instance Update cookbooks Start an instance Trigger event or runlist Check logs
  • 32.
  • 34. list # list event history (up to 10 events) # opsworks-agent-cli list 2014-11-06T10:26:58setup 2014-11-06T10:55:13configure2014-11-06T14:59:05execute_recipes 2014-11-07T18:25:53deploy 2014-11-07T18:34:11configure 2014-11-08T10:05:23configure 2014-11-08T14:43:43configure
  • 35. get # show JSON events (latest or by type/timestamp) # opsworks-agent-cli get { "ssh_users": { "2066": { "name": "thomas", "public_key": "ssh-rsa AAAAB3NzaC1...", "sudoer": true ...
  • 36. # list current agent folder and cookbooks # ls/opt/aws/opsworks/current cookbooks# OpsWorks cookbooks berkshelf-cookbooks# CookbooksfromBerkshelf site-cookbooks# Yourcookbooks merged-cookbooks# Resultingcookbooksforrun ...
  • 37. run # run last setup event (changed cookbooks, same JSON) # opsworks-agent-cli run setup # or select specific date # opsworks-agent-cli run 2014-11-08T14:43:43 [2014-11-12 13:06:41] INFO [opsworks-agent(17817)]:About to re-run 'setup' from 2014-11-08T14:43:43 Waiting for process 17817 ... Finished Chef run with exitcode 0
  • 38. # change recipe # cd /opt/aws/opsworks/current/site-cookbooks # vim mycookbooks/recipes/default.rb # confirm success # opsworks-agent-cli run setup # commit back to your git repo # git commit -am “can develop on instance“ # git push
  • 39.
  • 40.
  • 41. Destroy Create Converge Setup Verify Destroy
  • 42. .kitchen.yml driver: name: opsworks stack_id: vvvvvvvv-wwww-xxxx-yyyy-zzzzzzzzzzzz provisioner: name: shell busser: ruby_bindir: /opt/aws/opsworks/local/bin
  • 43. .kitchen.yml platforms: -name: Amazon Linux 2014.09 -name: Ubuntu 12.04 LTS -name: Ubuntu 14.04 LTS suites: -name: default run_list: -recipe[demo::default]
  • 44. # destroy, create, setup, converge, verify, destroy kitchen test kitchen verify [NAME|REGEXP|all]# run all 'tests' kitchen verify ubuntu# only ubuntus kitchen verify client# only client tests kitchen verify -c NUMBER# concurrency # Talk by Fletcher Nichol http://youtu.be/YzlCHAbJ7KM
  • 45. ‣attributes ‣recipes ‣templates ▾test ‣integration .kitchen.yml metadata.rb
  • 46. ‣attributes ‣recipes ‣templates ▾test ▾integration ‣default<--test suite name .kitchen.yml metadata.rb
  • 47. ‣attributes ‣recipes ‣templates ▾test ▾integration ▾default<--test suite name ‣bats<--test framework .kitchen.yml metadata.rb
  • 48. ‣attributes ‣recipes ‣templates ▾test ▾integration ▾default<--test suite name ▾bats<--test framework htop_installed.bats<--the actual test .kitchen.yml metadata.rb
  • 49. Test file htop_installed.bats #!/usr/bin/env bats @test "htop binary is found in PATH"{ run which htop [ "$status"-eq 0 ] }
  • 50.
  • 51.
  • 52.
  • 54.
  • 55.
  • 56. $./opsrun.rb92ca56ec-1672-4db0-8c6e-a8566e7db671 'echo $SHELL' ruby: warning: RUBY_HEAP_MIN_SLOTS isobsolete. UseRUBY_GC_HEAP_INIT_SLOTS instead. Abouttoruna scripton stack92ca56ec-1672-4db0-8c6e- a8566e7db671 on 2 online instances ... ... jenkins2: /bin/bash php-app1: /bin/bash $
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.