Advertisement

A Byte of Software Deployment

Backend Developer/Leader/DevOps at Guangzhou Sponia Software Co., Ltd
Jul. 30, 2016
Advertisement

More Related Content

Advertisement
Advertisement

A Byte of Software Deployment

  1. A Byte of Software Deployment @dylanninin
  2. What is Software Deployment ?
  3. Software Development Life Cycle
  4. All the Activities that Make a Software System Available for Use Definition It refers to:
  5. Deployment Activities • Requirements — The Missing Piece of Software Development • Planning — An Objective of Each and Every Activity • Testing — Do Not Ship Bugs At All • Designing — Overall Pictures of Both High/Low-Level • Deployment — What Does this Deployment Mean
  6. How to Deploy Software
  7. A Minimum Python Web Application
  8. An Overview of Realword Web Application
  9. It’s so complicated … …
  10. MVP In Deployment
  11. Just Before You Start • Test your code - We Do Not Ship Bugs At All - Confirm That It Is Deployable
  12. Let’s start • Get a Server • Apply a Public IP - Try AWS or Linode/DigitalOcean … - Login via SSH/VNC … - Apply an IP - Attatch the IP to Your Server - Initialize Security Rules …
  13. Preparing • Install Required Packages - Install Project Based Libraries - Install Redis/Mongodb/ElasticSearch/… - Edit YAML/TOML/JSON Configuration - Maintain Environment Aware of Production/Staging/Test • Setup Dependencies • Build Code/Config into Release - Make them Daemon
  14. Run Stand-alone • Run the App - export PYTHON_ENV=production - python run.py —port=8888 - http :8888/the/actual/url
  15. Web Server • DNS - Choose a Domain Name - Add an A Record in DNS Console • Nginx - Listen on 80/443 - Proxy Pass Requests to Your App - http https://your_domain_name/the/actual/url - Get the Public IP of Your Server
  16. It is simple!
  17. The Well-Known Three
  18. Supervisor: Progress Manager • Convenience • Accuracy • Centralised
  19. Nginx - Web Server • Simplicity • High Concurrency • Extensibility
  20. Sentry - Logging • Log as Event Stream
  21. Trouble Shooting
  22. A Minimum Python Web Application
  23. There may be problems anywhere
  24. With Outlined Tech Stack
  25. How to Trouble Shooting
  26. The So-Called “Interface”
  27. A Minimum Python Web Application
  28. What does “interface” mean?
  29. a Protocol Describes How the Web Server Talks with an Application Definition It refers to:
  30. CGI
  31. mod_python
  32. FastCGI/SCGI
  33. WSGI
  34. Integrated Web Server
  35. Proxy Pass
  36. Proxy Pass
  37. There Are Some Other Topics
  38. Standardisation Explicitly declare and isolate dependencies • Virtual Environment for Isolation • requirements.txt for Dependencies
  39. Standardisation Store config in the environment • YAML/TOML/JSON • Dev/Test/Staging/Production
  40. Standardisation Treat backing services as attached resources • Configurable • Detached/Attached
  41. Automation
  42. Monitoring Aware of Your Application • Console • Utilities • Services
  43. Availability Max Availability • Max Mean Time between Failures • Min Mean Time to Recover • >= 99.9%
  44. Q & A
  45. Reference • Comparison of web server software • http://www.fullstackpython.com/deployment.html • http://www.fullstackpython.com/wsgi-servers.html • https://docs.python.org/3.5/howto/webservers.html • https://github.com/fouber/blog/issues/6 • https://ruby-china.org/topics/12686 • http://supervisord.org/ • http://nginx.org/ • https://jenkins.io/ • https://newrelic.com/ • http://12factor.net/ • https://github.com/alex/what-happens-when
Advertisement