Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Meet Magento Spain 2019 - Our Experience with Magento Cloud


Published on

Presentation from Meet Magento Spain 2019 about @comwrap's experience with Magento Cloud Projects.

Published in: Software
  • Be the first to comment

Meet Magento Spain 2019 - Our Experience with Magento Cloud

  2. 2. Magento Technical Team Lead Magento Master 2019 Magento Community Maintainer Asynchronous Import Project Maintainer @nuzil Oleksandr Lyzun
  3. 3. Responsibility CUSTOMER/PARTNER • Magento Customisations (3rd party implimentations, custom development, etc.) • Testing • Deployments @nuzil ADOBE/MAGENTO • Core Magento Application • Core Magento Services and their updates • Magento‘s cloud infrastructure, monitoring and scaling
  4. 4. @nuzil 1. Welcome/Intro call 2. Onboarding 3. Hardware Handoff 5. Pre-launch Call 6. Go-Live with MBI connected *Timelines are approximate and will vary based on your specific project requirements Your CSM and TAM are available throughout the launch process to answer questions and support you. 1-2 Weeks ~2 Weeks ~1 Week 7. Post-launch Health Check Call ~3-4 Weeks Development & Testing Every ~2 weeks 4. Development Check-ins Length depends on your project 3-6 months is common Integration (Dev) Environments Integration (Dev) Environments + Staging + Production Cloud Project Timeline
  5. 5. STARTER VS PRO • Magento Commerce + BI + B2B (additional fee) • Fastly CND • New Relic and Brackfire • Infrastructure-as-a-Service (IaaS)—dedicated virtual infrastructure for Production environments and for Staging environments • High availability architecture with a three-server setup in the underlying Infrastructure-as-a- Service (IaaS) to provide enterprise grade reliability and availability • Isolated and dedicated hardware setup in the underlying Infrastructure-as-a-Service (IaaS) to provide even higher levels of reliability and availability @nuzil PRO ONLY
  6. 6. Environments overview STARTER @nuzil PRO Source:
  7. 7. Configure Environments You can configure application settings, routes, build and deploy actions, and notifications to support your project environments using the following configuration files: - defines how to build and deploy Magento, including services, hooks, and cron jobs. .magento.env.yaml - centralizes the management of build and deploy actions across all of your environments, including Pro Staging and Production, using environment variables. You do not need to open a support ticket to push these changes to Staging and Production environments. .magento/routes.yaml - configure caching, redirects, and server-side includes. .magento/services.yaml - defines the services Magento uses by name and version. For example, this file may include versions of MySQL, PHP extensions, Redis, RabbitMQ, and Elasticsearch. @nuzil Source:
  8. 8. Improved Self Service @nuzil Feature Legacy Infrastructure Self-service Infrastructure Adding users to environments (SSH, UI, CLI) support available Setting Environment Variables (UI CLI) support available Selecting PHP version (app.yaml) support available Settings build/deploy hooks (app.yaml) support available Crons configuration (app.yaml) support available Routes configuration (app.yaml) support available Regular CLI support not available available Force re-deploy (CLI) not available available Sensitive & non-Inheritable variables support (CLI) not available available
  9. 9. Development
  10. 10. Development workflow 1. Development takes place in your own local environment, new features, bug fixes, etc. Therefore you need to clone environment/branch to your local machine to start working. The git clone command with the branch name is pre-set-up in your Project UI. 2. Merge code from all sub-integration branches into Integration branch, test there 3. Merge code to Staging Branch/environment for UATs and other tests 4. Merge code to Production branch for pre-launch tests. This is your live website branch @nuzil Source:
  11. 11. Cloud CLI @nuzil
  12. 12. Cloud CLI @nuzil
  13. 13. Debugging on Cloud: Logs INTEGRATION ENV /var/log/php.access.log /var/log/deploy.log /var/log/error.log /var/log/cron.log /app/var/log/exception.log /app/$PROJECT/var/report/ /app/var/log/cloud.log /var/log/* @nuzil STAGE / PROD /var/log/platform/$PROJECT_stg/php.access.log /var/log/platform/$PROJECT_stg/post_deploy.log (node 1 only) /var/log/platform/$PROJECT_stg/error.log /var/log/platform/$PROJECT_stg/cron.log /app/$PROJECT_stg/var/log/exception.log /app/$PROJECT_stg/var/report/ /app/var/log/cloud.log /var/log/mysql/mysql-slow.logCLOUD PRO has 3 nodes!
  14. 14. Debugging on Cloud NOT SO EASY … • Code is deployed into a read-only file system image • Forget about „I will fix it quickly on production“ • Use Xdebug (available on all environments) Enabled in @nuzil
  15. 15. DEPLOYMENT
  16. 16. Deployment process @nuzil Source: GIT PUSH END POST-DEPLOY PHASE DEPLOY PHASE BUILD PHASE run post-deploy hook run deploy hook run build hook hooks: build: | php ./vendor/bin/ece-tools build deploy: | php ./vendor/bin/ece-tools deploy post-deploy: | php ./vendor/bin/ece-tools post-deploy
  17. 17. Deployment Phases BUILD PHASE • no maintenance mode is enabled • apply pathes from m2-hotfixes • regenerates code and the dependency injection configuration • checks if the app/etc/config.php exists • compresses static files using gzip, and deploys the files • prepare the slug • deploy slugs and cluster o mount Services o mount File system o connect them @nuzil DEPLOY PHASE • maintenance mode is enabled • you have access to all the services in your environment • deploy static content if config.php is not packed • if Magento is not installed, it installs Magento • bin/magento setup:upgrade • clear Magento cache
  18. 18. Static Content Deployment @nuzil
  19. 19. SCD on different phases @nuzil SCD on Deploy Phase SCD on Build Phase
  20. 20. Move SCD to the build phase @nuzil magento-cloud ssh vendor/bin/m2- ece-scd-dump copy to local environment git add git commit && git push or vendor/bin/ece-tools config:dump to export every configuration setting, including modified and default settings exports modified configuration settings into config.php file Redeployment with generating static content on the Build phase
  21. 21. SCD – config.php Config.php will contain information about: 1. Websites 2. Stores 3. Store Views 4. Enabled / Disabled modules 5. Locales 6. Dev section information (js, css, template settings) @nuzil Source: Never forget about config.php if you changing your websites structure!
  22. 22. SCD Deploy only required themes and languages .magento.env.yaml @nuzil
  23. 23. SCD Skip HTML minification .magento.env.yaml @nuzil
  24. 24. SCD Skip Static content deploy .magento.env.yaml @nuzil
  25. 25. SCD Set SCD on demand (Intergation environment) .magento.env.yaml @nuzil
  26. 26. SCD Speed @nuzil
  27. 27. PATCHES
  28. 28. Hotfixes / Patches • Hotfixes are used to fix some known Magento issues, without rewriting Magento core • Patches are usually provided officially by Magento • Hotfixes and Patches have to be located in /m2-hotfixes directory @nuzil Don‘t overwrite, CONTRIBUTE!
  29. 29. FASTLY
  30. 30. Fastly Fastly is a CDN based on Varnish caching and Magento has deep support for Varnish providing tight integration with Fastly • Content Delivery Network​ • Full page cache application​ • DDoS protection​ • Web Application Firewall​ • Image optimization @nuzil
  31. 31. Fastly configuration USEFULL CONFIGS • Block traffic from selected IPs and Countries • Basic authentication allows you to protect every page and asset on your site with username and password. • VCL Snippets • Maintenance Mode • Web Application Firewall (Allowed Methods, Restricted Extensions, WAF ACL Bypass) • Webhooks for Fastly @nuzil
  32. 32. CLOUD 2020
  33. 33. CLOUD 2020 • Improving cloud CI with possibilities to integrate automated testing • Provide more performant and robust integration environments. Provision two 4x integration environments. • Improve auto scaling • Enhance support for PWA • Safe deployment rollbacks and data recovery. • Enhanced ECE-tools with possibilities to provide more information about failed deploys and how to fix it • Log reading tools • Adobe Sensei Recommendations! …. Free of charge. @nuzil
  34. 34. AND THE LAST ONE…
  35. 35. @nuzil • For Pro plans, the Production environment has a three node infrastructure that uses auto-incrementing by 3 for all data IDs