SlideShare une entreprise Scribd logo
1  sur  24
Pyramid Deployment and Maintenance Carlos de la Guardia Plone Conference 2011
So, your application is ready and looking good
Time to deploy it and see how it holds up
Deployment with NginX More information at:  http://docs.pylonsproject.org/projects/pyramid_cookbook/dev/deployment/nginx.html upstream myapp-site { server 127.0.0.1:5000; server 127.0.0.1:5001; } server { server_name  example.com; access_log  /home/example/env/access.log; location / { proxy_set_header  Host $host; proxy_set_header  X-Real-IP $remote_addr; proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header  X-Forwarded-Proto $scheme; proxy_connect_timeout  60s; proxy_send_timeout  90s; proxy_read_timeout  90s; proxy_buffering  off; proxy_pass http://myapp-site; proxy_redirect  off; } }
Deployment with Apache and Mod_WSGI We need to create an app that will call our application with configuration. Then we set up apache to call this app. More information at: http://docs.pylonsproject.org/projects/pyramid/1.2/tutorials/modwsgi/index.html #pyramid.wsgi from pyramid.paster import get_app application = get_app('/mydir/modwsgi/env/myapp/production.ini', 'main') #apache.conf WSGIApplicationGroup %{GLOBAL} WSGIPassAuthorization On WSGIDaemonProcess pyramid user=cguardia group=staff threads=4 python-path=/mydir/modwsgi/env/lib/python2.6/site-packages WSGIScriptAlias /myapp /mydir/modwsgi/env/pyramid.wsgi <Directory /mydir/modwsgi/env> WSGIProcessGroup pyramid Order allow,deny Allow from all </Directory>
To paste or not to paste ,[object Object]
We already discussed mod_wsgi. If you are sure that you need something else, people on our mailing lists have reported success with uWSGI and gUnicorn.
If you are using ZODB with paster, consider using Jove to manage multiple sites and settings consistently:  https://github.com/Pylons/jove
Other approaches include using gevent, twisted or eventlets.
Putting all your eggs in the same basket
Your very own package index ,[object Object]
Create an egg directory using a GitHub site and  generate the index with the same script.
Install a PyPI clone like ClueReleaseManager, and configure your .pypirc file to  point at the clone. Use setuptools to upload.
Jarn.mkrelease can be used to commit, tag and upload in one step: $ mkrelease -d mypypi src/my.package
Using Buildout with Pyramid ,[object Object]
Recipes are used to define what each part of  the buildout will install and/or setup. There are many available recipes on PyPI.
A buildout can have different configurations. For example, deployment and production.
Buildout can be used to setup a Pyramid application and it's dependencies easily.
Sample buildout [buildout] parts = myapp mkrelease Develop =  src/mypackage index =  http://example.github.com/myapp/staging/index/ [myapp] recipe =  zc.recipe.egg eggs = some_dependency mypackage interpreter =  py [mkrelease] recipe =  zc.recipe.egg eggs =  jarn.mkrelease scripts =  mkrelease
Supervisor ,[object Object]
We can use supervisor to control our pyramid applications, either alone or together with other applications or services.
A very easy way to configure it is to simply add the supervisor egg to our buildout and include a configuration file.
Sample supervisor configuration [inet_http_server] port= 127.0.0.1:9001 [supervisord] logfile= %(here)s/var/supervisord.log logfile_maxbytes= 50MB logfile_backups= 10 loglevel= info pidfile= %(here)s/var/supervisord.pid [rpcinterface:supervisor] supervisor.rpcinterface_factory =  supervisor.rpcinterface:make_main_rpcinterface [supervisorctl] serverurl= http://127.0.0.1:9001 [program:core] command =  %(here)s/bin/paster serve %(here)s/src/inav2_core/development.ini redirect_stderr =  true
Useful maintenance tools

Contenu connexe

Tendances

Node Summit 2018: Cloud Native Node.js
Node Summit 2018: Cloud Native Node.jsNode Summit 2018: Cloud Native Node.js
Node Summit 2018: Cloud Native Node.jsChris Bailey
 
Installing and updating software packages [autosaved]
Installing and updating software packages [autosaved]Installing and updating software packages [autosaved]
Installing and updating software packages [autosaved]ANIMESHKUMARSINHA2
 
CakePHP - Admin Acl Controlled
CakePHP - Admin Acl ControlledCakePHP - Admin Acl Controlled
CakePHP - Admin Acl ControlledLuís Fred
 
Play with Alfresco ADF 2.0.0 Angular
Play with Alfresco ADF 2.0.0 AngularPlay with Alfresco ADF 2.0.0 Angular
Play with Alfresco ADF 2.0.0 AngularEugenio Romano
 
NZ Code Camp 2011 PowerShell + SharePoint
NZ Code Camp 2011 PowerShell + SharePointNZ Code Camp 2011 PowerShell + SharePoint
NZ Code Camp 2011 PowerShell + SharePointNick Hadlee
 
Tools of the CPAN Ninja
Tools of the CPAN NinjaTools of the CPAN Ninja
Tools of the CPAN NinjaAran Deltac
 
IBM Cloud University: Build, Deploy and Scale Node.js Microservices
IBM Cloud University: Build, Deploy and Scale Node.js MicroservicesIBM Cloud University: Build, Deploy and Scale Node.js Microservices
IBM Cloud University: Build, Deploy and Scale Node.js MicroservicesChris Bailey
 
Building scala with bazel
Building scala with bazelBuilding scala with bazel
Building scala with bazelNatan Silnitsky
 
Build website in_django
Build website in_django Build website in_django
Build website in_django swee meng ng
 
Chef for beginners module 2
Chef for beginners   module 2Chef for beginners   module 2
Chef for beginners module 2Chef
 
Top 50 Interview Questions and Answers in CakePHP
Top 50 Interview Questions and Answers in CakePHPTop 50 Interview Questions and Answers in CakePHP
Top 50 Interview Questions and Answers in CakePHPKetan Patel
 
php[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the Cloudphp[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the CloudJoe Ferguson
 
Building with Firebase
Building with FirebaseBuilding with Firebase
Building with FirebaseMike Fowler
 
Lessons learned from a huge Rails app - RubyConf Brasil 2019
Lessons learned from a huge Rails app - RubyConf Brasil 2019Lessons learned from a huge Rails app - RubyConf Brasil 2019
Lessons learned from a huge Rails app - RubyConf Brasil 2019Nahuel Garbezza
 
Remote Config REST API and Versioning
Remote Config REST API and VersioningRemote Config REST API and Versioning
Remote Config REST API and VersioningJumpei Matsuda
 
Silicon Valley Code Camp 2019 - Reaching the Cloud Native World
Silicon Valley Code Camp 2019 - Reaching the Cloud Native WorldSilicon Valley Code Camp 2019 - Reaching the Cloud Native World
Silicon Valley Code Camp 2019 - Reaching the Cloud Native WorldChris Bailey
 
Swagger AEM - An OpenAPI Specification for AEM
Swagger AEM - An OpenAPI Specification for AEMSwagger AEM - An OpenAPI Specification for AEM
Swagger AEM - An OpenAPI Specification for AEMCliffano Subagio
 
Node.js and Google Cloud
Node.js and Google CloudNode.js and Google Cloud
Node.js and Google CloudPaulo Pires
 

Tendances (20)

Node Summit 2018: Cloud Native Node.js
Node Summit 2018: Cloud Native Node.jsNode Summit 2018: Cloud Native Node.js
Node Summit 2018: Cloud Native Node.js
 
Installing and updating software packages [autosaved]
Installing and updating software packages [autosaved]Installing and updating software packages [autosaved]
Installing and updating software packages [autosaved]
 
CakePHP - Admin Acl Controlled
CakePHP - Admin Acl ControlledCakePHP - Admin Acl Controlled
CakePHP - Admin Acl Controlled
 
Play with Alfresco ADF 2.0.0 Angular
Play with Alfresco ADF 2.0.0 AngularPlay with Alfresco ADF 2.0.0 Angular
Play with Alfresco ADF 2.0.0 Angular
 
NZ Code Camp 2011 PowerShell + SharePoint
NZ Code Camp 2011 PowerShell + SharePointNZ Code Camp 2011 PowerShell + SharePoint
NZ Code Camp 2011 PowerShell + SharePoint
 
Tools of the CPAN Ninja
Tools of the CPAN NinjaTools of the CPAN Ninja
Tools of the CPAN Ninja
 
IBM Cloud University: Build, Deploy and Scale Node.js Microservices
IBM Cloud University: Build, Deploy and Scale Node.js MicroservicesIBM Cloud University: Build, Deploy and Scale Node.js Microservices
IBM Cloud University: Build, Deploy and Scale Node.js Microservices
 
Building scala with bazel
Building scala with bazelBuilding scala with bazel
Building scala with bazel
 
Build website in_django
Build website in_django Build website in_django
Build website in_django
 
Chef for beginners module 2
Chef for beginners   module 2Chef for beginners   module 2
Chef for beginners module 2
 
Top 50 Interview Questions and Answers in CakePHP
Top 50 Interview Questions and Answers in CakePHPTop 50 Interview Questions and Answers in CakePHP
Top 50 Interview Questions and Answers in CakePHP
 
Ansible best practices
Ansible best practicesAnsible best practices
Ansible best practices
 
php[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the Cloudphp[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the Cloud
 
Flask
FlaskFlask
Flask
 
Building with Firebase
Building with FirebaseBuilding with Firebase
Building with Firebase
 
Lessons learned from a huge Rails app - RubyConf Brasil 2019
Lessons learned from a huge Rails app - RubyConf Brasil 2019Lessons learned from a huge Rails app - RubyConf Brasil 2019
Lessons learned from a huge Rails app - RubyConf Brasil 2019
 
Remote Config REST API and Versioning
Remote Config REST API and VersioningRemote Config REST API and Versioning
Remote Config REST API and Versioning
 
Silicon Valley Code Camp 2019 - Reaching the Cloud Native World
Silicon Valley Code Camp 2019 - Reaching the Cloud Native WorldSilicon Valley Code Camp 2019 - Reaching the Cloud Native World
Silicon Valley Code Camp 2019 - Reaching the Cloud Native World
 
Swagger AEM - An OpenAPI Specification for AEM
Swagger AEM - An OpenAPI Specification for AEMSwagger AEM - An OpenAPI Specification for AEM
Swagger AEM - An OpenAPI Specification for AEM
 
Node.js and Google Cloud
Node.js and Google CloudNode.js and Google Cloud
Node.js and Google Cloud
 

Similaire à Pyramid deployment

Pyramid Deployment and Maintenance
Pyramid Deployment and MaintenancePyramid Deployment and Maintenance
Pyramid Deployment and MaintenanceJazkarta, Inc.
 
CloudLand 2023: Rock, Paper, Scissors Cloud Competition - Go vs. Java
CloudLand 2023: Rock, Paper, Scissors Cloud Competition - Go vs. JavaCloudLand 2023: Rock, Paper, Scissors Cloud Competition - Go vs. Java
CloudLand 2023: Rock, Paper, Scissors Cloud Competition - Go vs. JavaJan Stamer
 
How to Webpack your Django!
How to Webpack your Django!How to Webpack your Django!
How to Webpack your Django!David Gibbons
 
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...Dilouar Hossain
 
Meetup 2022 - APIs with Quarkus.pdf
Meetup 2022 - APIs with Quarkus.pdfMeetup 2022 - APIs with Quarkus.pdf
Meetup 2022 - APIs with Quarkus.pdfLuca Mattia Ferrari
 
NGINX Can Do That? Test Drive Your Config File!
NGINX Can Do That? Test Drive Your Config File!NGINX Can Do That? Test Drive Your Config File!
NGINX Can Do That? Test Drive Your Config File!Jeff Anderson
 
Joomla in the cloud with Openshift
Joomla in the cloud with OpenshiftJoomla in the cloud with Openshift
Joomla in the cloud with OpenshiftEdoardo Schepis
 
Joomla! Day Chicago 2011 Presentation - Steven Pignataro
Joomla! Day Chicago 2011 Presentation - Steven PignataroJoomla! Day Chicago 2011 Presentation - Steven Pignataro
Joomla! Day Chicago 2011 Presentation - Steven PignataroSteven Pignataro
 
Getting started with Google App Engine
Getting started with Google App EngineGetting started with Google App Engine
Getting started with Google App EngineMilindu Sanoj Kumarage
 
Porting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability SystemsPorting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability SystemsMarcelo Pinheiro
 
Software Project Management
Software Project ManagementSoftware Project Management
Software Project ManagementWidoyo PH
 
Monitoring using Prometheus and Grafana
Monitoring using Prometheus and GrafanaMonitoring using Prometheus and Grafana
Monitoring using Prometheus and GrafanaArvind Kumar G.S
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.catPablo Godel
 
Testing your application on Google App Engine
Testing your application on Google App EngineTesting your application on Google App Engine
Testing your application on Google App EngineInphina Technologies
 
Testing Your Application On Google App Engine
Testing Your Application On Google App EngineTesting Your Application On Google App Engine
Testing Your Application On Google App EngineIndicThreads
 
Django Architecture Introduction
Django Architecture IntroductionDjango Architecture Introduction
Django Architecture IntroductionHaiqi Chen
 
Easy Web Project Development & Management with Django & Mercurial
Easy Web Project Development & Management with Django & MercurialEasy Web Project Development & Management with Django & Mercurial
Easy Web Project Development & Management with Django & MercurialWidoyo PH
 

Similaire à Pyramid deployment (20)

Pyramid Deployment and Maintenance
Pyramid Deployment and MaintenancePyramid Deployment and Maintenance
Pyramid Deployment and Maintenance
 
Pyramid patterns
Pyramid patternsPyramid patterns
Pyramid patterns
 
Pixels_Camp
Pixels_CampPixels_Camp
Pixels_Camp
 
CloudLand 2023: Rock, Paper, Scissors Cloud Competition - Go vs. Java
CloudLand 2023: Rock, Paper, Scissors Cloud Competition - Go vs. JavaCloudLand 2023: Rock, Paper, Scissors Cloud Competition - Go vs. Java
CloudLand 2023: Rock, Paper, Scissors Cloud Competition - Go vs. Java
 
How to Webpack your Django!
How to Webpack your Django!How to Webpack your Django!
How to Webpack your Django!
 
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
 
Meetup 2022 - APIs with Quarkus.pdf
Meetup 2022 - APIs with Quarkus.pdfMeetup 2022 - APIs with Quarkus.pdf
Meetup 2022 - APIs with Quarkus.pdf
 
NGINX Can Do That? Test Drive Your Config File!
NGINX Can Do That? Test Drive Your Config File!NGINX Can Do That? Test Drive Your Config File!
NGINX Can Do That? Test Drive Your Config File!
 
Joomla in the cloud with Openshift
Joomla in the cloud with OpenshiftJoomla in the cloud with Openshift
Joomla in the cloud with Openshift
 
Joomla! Day Chicago 2011 Presentation - Steven Pignataro
Joomla! Day Chicago 2011 Presentation - Steven PignataroJoomla! Day Chicago 2011 Presentation - Steven Pignataro
Joomla! Day Chicago 2011 Presentation - Steven Pignataro
 
Sst hackathon express
Sst hackathon expressSst hackathon express
Sst hackathon express
 
Getting started with Google App Engine
Getting started with Google App EngineGetting started with Google App Engine
Getting started with Google App Engine
 
Porting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability SystemsPorting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability Systems
 
Software Project Management
Software Project ManagementSoftware Project Management
Software Project Management
 
Monitoring using Prometheus and Grafana
Monitoring using Prometheus and GrafanaMonitoring using Prometheus and Grafana
Monitoring using Prometheus and Grafana
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 
Testing your application on Google App Engine
Testing your application on Google App EngineTesting your application on Google App Engine
Testing your application on Google App Engine
 
Testing Your Application On Google App Engine
Testing Your Application On Google App EngineTesting Your Application On Google App Engine
Testing Your Application On Google App Engine
 
Django Architecture Introduction
Django Architecture IntroductionDjango Architecture Introduction
Django Architecture Introduction
 
Easy Web Project Development & Management with Django & Mercurial
Easy Web Project Development & Management with Django & MercurialEasy Web Project Development & Management with Django & Mercurial
Easy Web Project Development & Management with Django & Mercurial
 

Plus de Carlos de la Guardia

Introduction to the transaction package
Introduction to the transaction packageIntroduction to the transaction package
Introduction to the transaction packageCarlos de la Guardia
 
Pyramid as a base for higher level frameworks
Pyramid as a base for higher level frameworksPyramid as a base for higher level frameworks
Pyramid as a base for higher level frameworksCarlos de la Guardia
 
A winning combination: Plone as CMS and your favorite Python web framework as...
A winning combination: Plone as CMS and your favorite Python web framework as...A winning combination: Plone as CMS and your favorite Python web framework as...
A winning combination: Plone as CMS and your favorite Python web framework as...Carlos de la Guardia
 
Turning Plone into a dynamic site factory
Turning Plone into a dynamic site factoryTurning Plone into a dynamic site factory
Turning Plone into a dynamic site factoryCarlos de la Guardia
 

Plus de Carlos de la Guardia (9)

Introduction to the transaction package
Introduction to the transaction packageIntroduction to the transaction package
Introduction to the transaction package
 
Pyramid as a base for higher level frameworks
Pyramid as a base for higher level frameworksPyramid as a base for higher level frameworks
Pyramid as a base for higher level frameworks
 
Pyramid tutorial
Pyramid tutorialPyramid tutorial
Pyramid tutorial
 
Pyramid faq
Pyramid faqPyramid faq
Pyramid faq
 
ZODB Tips and Tricks
ZODB Tips and TricksZODB Tips and Tricks
ZODB Tips and Tricks
 
Python intro for Plone users
Python intro for Plone usersPython intro for Plone users
Python intro for Plone users
 
A winning combination: Plone as CMS and your favorite Python web framework as...
A winning combination: Plone as CMS and your favorite Python web framework as...A winning combination: Plone as CMS and your favorite Python web framework as...
A winning combination: Plone as CMS and your favorite Python web framework as...
 
World Plone Day 2008 Mexico
World Plone Day 2008 MexicoWorld Plone Day 2008 Mexico
World Plone Day 2008 Mexico
 
Turning Plone into a dynamic site factory
Turning Plone into a dynamic site factoryTurning Plone into a dynamic site factory
Turning Plone into a dynamic site factory
 

Dernier

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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...Drew Madelung
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
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 MenDelhi Call girls
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
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...Igalia
 

Dernier (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 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...
 

Pyramid deployment

  • 1. Pyramid Deployment and Maintenance Carlos de la Guardia Plone Conference 2011
  • 2. So, your application is ready and looking good
  • 3. Time to deploy it and see how it holds up
  • 4. Deployment with NginX More information at: http://docs.pylonsproject.org/projects/pyramid_cookbook/dev/deployment/nginx.html upstream myapp-site { server 127.0.0.1:5000; server 127.0.0.1:5001; } server { server_name example.com; access_log /home/example/env/access.log; location / { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_connect_timeout 60s; proxy_send_timeout 90s; proxy_read_timeout 90s; proxy_buffering off; proxy_pass http://myapp-site; proxy_redirect off; } }
  • 5. Deployment with Apache and Mod_WSGI We need to create an app that will call our application with configuration. Then we set up apache to call this app. More information at: http://docs.pylonsproject.org/projects/pyramid/1.2/tutorials/modwsgi/index.html #pyramid.wsgi from pyramid.paster import get_app application = get_app('/mydir/modwsgi/env/myapp/production.ini', 'main') #apache.conf WSGIApplicationGroup %{GLOBAL} WSGIPassAuthorization On WSGIDaemonProcess pyramid user=cguardia group=staff threads=4 python-path=/mydir/modwsgi/env/lib/python2.6/site-packages WSGIScriptAlias /myapp /mydir/modwsgi/env/pyramid.wsgi <Directory /mydir/modwsgi/env> WSGIProcessGroup pyramid Order allow,deny Allow from all </Directory>
  • 6.
  • 7. We already discussed mod_wsgi. If you are sure that you need something else, people on our mailing lists have reported success with uWSGI and gUnicorn.
  • 8. If you are using ZODB with paster, consider using Jove to manage multiple sites and settings consistently: https://github.com/Pylons/jove
  • 9. Other approaches include using gevent, twisted or eventlets.
  • 10. Putting all your eggs in the same basket
  • 11.
  • 12. Create an egg directory using a GitHub site and generate the index with the same script.
  • 13. Install a PyPI clone like ClueReleaseManager, and configure your .pypirc file to point at the clone. Use setuptools to upload.
  • 14. Jarn.mkrelease can be used to commit, tag and upload in one step: $ mkrelease -d mypypi src/my.package
  • 15.
  • 16. Recipes are used to define what each part of the buildout will install and/or setup. There are many available recipes on PyPI.
  • 17. A buildout can have different configurations. For example, deployment and production.
  • 18. Buildout can be used to setup a Pyramid application and it's dependencies easily.
  • 19. Sample buildout [buildout] parts = myapp mkrelease Develop = src/mypackage index = http://example.github.com/myapp/staging/index/ [myapp] recipe = zc.recipe.egg eggs = some_dependency mypackage interpreter = py [mkrelease] recipe = zc.recipe.egg eggs = jarn.mkrelease scripts = mkrelease
  • 20.
  • 21. We can use supervisor to control our pyramid applications, either alone or together with other applications or services.
  • 22. A very easy way to configure it is to simply add the supervisor egg to our buildout and include a configuration file.
  • 23. Sample supervisor configuration [inet_http_server] port= 127.0.0.1:9001 [supervisord] logfile= %(here)s/var/supervisord.log logfile_maxbytes= 50MB logfile_backups= 10 loglevel= info pidfile= %(here)s/var/supervisord.pid [rpcinterface:supervisor] supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface [supervisorctl] serverurl= http://127.0.0.1:9001 [program:core] command = %(here)s/bin/paster serve %(here)s/src/inav2_core/development.ini redirect_stderr = true
  • 25.
  • 26. Importing web application code from a command line script will not work when it depends on a request.
  • 27. Pyramid offers a facility for generating an environment similar to what the application would get from a real request.
  • 28. This makes it possible to easily write scripts for tasks like updating databases, create sample content or initialize application services.
  • 29.
  • 30.
  • 31. app
  • 32. root
  • 35. Exception logging with pyramid_exclog [loggers] keys = exc_logger [handlers] keys = exc_handler [formatters] keys = exc_formatter [logger_exc_logger] level = ERROR handlers = exc_handler qualname = exc_logger [handler_exc_handler] class = handlers.SMTPHandler args = (('localhost', 25), 'from@example.com', ['to@example.com'], 'myapp Exception') level = ERROR formatter = exc_formatter [formatter_exc_formatter] format = %(asctime)s %(message)s
  • 36.
  • 39. Do not forget about staging
  • 40.
  • 41. It's important to be able to quickly deploy changes to staging before trying them in production.
  • 42. Ideally, multiple branches could be deployed separately.
  • 43. Take a look at octomotron: https://github.com/chrisrossi/octomotron
  • 44.
  • 50.
  • 51. Mission-critical application used by organizations such as Open Society Foundations and Oxfam.
  • 52. 5000+ users (no anonymous access).
  • 53. More than 75,000 Pages of content.
  • 55.
  • 57. Custom package index stored on GitHub.
  • 58. 1 App Server, 1 DB Server.
  • 59. Uses ZODB with RelStorage and PGTextIndex.
  • 60. Deployment is done with a Python script that creates a parallel environment, backs up and evolves data, then restarts the instance.
  • 61. Thank You! Email: [email_address] IRC: #pyramid, #pylons http://groups.google.com/group/pylons-devel