Upgrade to Pro — share decks privately, control downloads, hide ads and more …

AWS hurries to the rescue

AWS hurries to the rescue

Very often I’m finding that many people in IT world either don’t know about AWS or any other public cloud or doesn’t have enough experience with it. I often see questions and problems through chats, Slack channels or forums that can be easily solved with AWS help and very often this solution will be very cheap or even free.

In this talk, I want to share my experience of using AWS services for solving different tasks in my daily work not only for testing but in many other areas as well. I also want to introduce AWS to the people who have no idea about what cloud computing is. I’m not affiliated with AWS in any way and they don’t pay me for this. It means that there will be no marketing bullshit, but only my personal blood and tears.

In my talk, I will mention both foundational AWS services, like S3 or EC2, and new things, that may become a “Next Big Thing”, like Lambda. I will share my experience of using them, problems that I found and results that I’ve got.

Avatar for Artem Nikitin

Artem Nikitin

March 03, 2018
Tweet

More Decks by Artem Nikitin

Other Decks in Programming

Transcript

  1. How AWS can help • Run your builds/tests quickly and

    cheap © 2018 HERE | Public Selenium Camp | March, 2018
  2. How AWS can help • Run your builds/tests quickly and

    cheap • Selenium Grid? Sure! Mobile? No problem! © 2018 HERE | Public Selenium Camp | March, 2018
  3. How AWS can help • Run your builds/tests quickly and

    cheap • Selenium Grid? Sure! Mobile? No problem! • Store and share screenshots, video, logs, reports etc… © 2018 HERE | Public Selenium Camp | March, 2018
  4. How AWS can help • Run your builds/tests quickly and

    cheap • Selenium Grid? Sure! Mobile? No problem! • Store and share screenshots, video, logs, reports etc… • Create microservices to support testing © 2018 HERE | Public Selenium Camp | March, 2018
  5. AWS Overview • Market leader for public cloud • 100+

    different services • 10% of Amazon income, but >90% of their profit • Comparison of costs between cloud and own infrastructure isn’t that simple as it may look like © 2018 HERE | Public Selenium Camp | March, 2018
  6. EC2 Different types of instances: • On-Demand: default option ©

    2018 HERE | Public Selenium Camp | March, 2018
  7. EC2 Different types of instances: • On-Demand: default option •

    Reserved: for 24/7 workload type © 2018 HERE | Public Selenium Camp | March, 2018
  8. EC2 Different types of instances: • On-Demand: default option •

    Reserved: for 24/7 workload type • Spot: auction for unused resources © 2018 HERE | Public Selenium Camp | March, 2018
  9. Load testing using Spot Fleet • Not only load testing.

    Selenium Grid? Easy! © 2018 HERE | Public Selenium Camp | March, 2018
  10. Load testing using Spot Fleet • Not only load testing.

    Selenium Grid? Easy! • Up to 10 EC2 Spot instances. Up to 24 hours duration © 2018 HERE | Public Selenium Camp | March, 2018
  11. Load testing using Spot Fleet • Not only load testing.

    Selenium Grid? Easy! • Up to 10 EC2 Spot instances. Up to 24 hours duration • Up to 20 USD per load test run © 2018 HERE | Public Selenium Camp | March, 2018
  12. Using Spot instances in CI • Runs 100+ EC2 instances

    per day © 2018 HERE | Public Selenium Camp | March, 2018
  13. Using Spot instances in CI • Runs 100+ EC2 instances

    per day • Spot instances are the key to keep it cheap © 2018 HERE | Public Selenium Camp | March, 2018
  14. Using Spot instances in CI • Runs 100+ EC2 instances

    per day • Spot instances are the key to keep it cheap • Don’t use Spot instances for CI master © 2018 HERE | Public Selenium Camp | March, 2018
  15. Using Spot instances in CI • Runs 100+ EC2 instances

    per day • Spot instances are the key to keep it cheap • Don’t use Spot instances for CI master • Around 50 USD for February © 2018 HERE | Public Selenium Camp | March, 2018
  16. EC2 Additional use cases: • Run whatever you want J

    • Selenium tests and infrastructure • Android x86 emulators (when bare metal instances will become available) • Services and infrastructure to support testing © 2018 HERE | Public Selenium Camp | March, 2018
  17. S3 • Think about it like a key-value storage •

    Like Map<String, Byte[]> for Java © 2018 HERE | Public Selenium Camp | March, 2018
  18. S3 • Think about it like a key-value storage •

    Like Map<String, Byte[]> for Java • But key can be like “/path/to/my/app.jar” © 2018 HERE | Public Selenium Camp | March, 2018
  19. S3 Additional details: • Access setup and policies can be

    tricky and complicated © 2018 HERE | Public Selenium Camp | March, 2018
  20. S3 Additional details: • Access setup and policies can be

    tricky and complicated • Overall S3 costs less than 5 USD per month © 2018 HERE | Public Selenium Camp | March, 2018
  21. S3 Additional use cases: • Store and share whatever you

    want J • Hosting for static websites/blogs/landings • Distribute releases or public content (via CloudFront) © 2018 HERE | Public Selenium Camp | March, 2018
  22. Device Farm • AWS bought AppThwack in 2015 and renamed

    it to Device Farm • Provides devices for running automated tests for mobile apps and mobile web • Also allows remote access and control for devices © 2018 HERE | Public Selenium Camp | March, 2018
  23. Device Farm Supported test types and frameworks: • Built-in: fuzzing

    (sending random input events) © 2018 HERE | Public Selenium Camp | March, 2018
  24. Device Farm Supported test types and frameworks: • Built-in: fuzzing

    (sending random input events) • Mobile Web: Appium © 2018 HERE | Public Selenium Camp | March, 2018
  25. Device Farm Supported test types and frameworks: • Built-in: fuzzing

    (sending random input events) • Mobile Web: Appium • Android: Appium, Calabash, any Instrumentation framework(Espresso, etc…), UI Automator © 2018 HERE | Public Selenium Camp | March, 2018
  26. Device Farm Supported test types and frameworks: • Built-in: fuzzing

    (sending random input events) • Mobile Web: Appium • Android: Appium, Calabash, any Instrumentation framework(Espresso, etc…), UI Automator • iOS: Appium, Calabash, XCTest, XCUITest, UI Automation © 2018 HERE | Public Selenium Camp | March, 2018
  27. Device Farm Use cases: • Run automated tests • Manual

    testing or bug reproducing © 2018 HERE | Public Selenium Camp | March, 2018
  28. Device Farm Gotchas: • Maybe, not the best choice for

    Appium tests © 2018 HERE | Public Selenium Camp | March, 2018
  29. Device Farm Gotchas: • Maybe, not the best choice for

    Appium tests • Latest devices are very popular and waiting time can be huge © 2018 HERE | Public Selenium Camp | March, 2018
  30. Device Farm Gotchas: • Maybe, not the best choice for

    Appium tests • Latest devices are very popular and waiting time can be huge • Limited support for 3rd party tools © 2018 HERE | Public Selenium Camp | March, 2018
  31. Device Farm Gotchas: • Maybe, not the best choice for

    Appium tests • Latest devices are very popular and waiting time can be huge • Limited support for 3rd party tools • https://github.com/artemnikitin/devicefarm-ci-tool © 2018 HERE | Public Selenium Camp | March, 2018
  32. Lambda AWS description: Serverless computing allows you to build and

    run applications and services without thinking about servers. Serverless applications don't require you to provision, scale, and manage any servers. • Announced during re:Invent in 2014 • Started the whole “serverless” trend © 2018 HERE | Public Selenium Camp | March, 2018
  33. Lambda © 2018 HERE | Public Selenium Camp | March,

    2018 Serverless is the Next Big Thing???
  34. Management of Docker images in AMI © 2018 HERE |

    Public Selenium Camp | March, 2018
  35. Lambda Additional details: • Average cost is around 5 USD

    per month • Requires API Gateway to expose Lambda via HTTP • Switch from Java to Go made our Lambda’s costs 2x smaller • DynamoDB >= 50% of all costs in our cases © 2018 HERE | Public Selenium Camp | March, 2018
  36. Lambda Gotchas: • Cold start time + API Gateway timeout

    © 2018 HERE | Public Selenium Camp | March, 2018
  37. Lambda Gotchas: • Cold start time + API Gateway timeout

    • Especially bad in the case of using Java © 2018 HERE | Public Selenium Camp | March, 2018
  38. Lambda Gotchas: • Cold start time + API Gateway timeout

    • Especially bad in the case of using Java • Either don’t use Java or add more resources © 2018 HERE | Public Selenium Camp | March, 2018
  39. Lambda Gotchas: • Cold start time + API Gateway timeout

    • Especially bad in the case of using Java • Either don’t use Java or add more resources • Or keep Lambda warm, but this is a ”gray” area © 2018 HERE | Public Selenium Camp | March, 2018
  40. Lambda Additional use cases: • ”Glue” for AWS services •

    Handling Gerrit topics • Custom URL shortener • Different support services © 2018 HERE | Public Selenium Camp | March, 2018
  41. Conclusions Do: • Immutable infrastructure • Infrastructure as code •

    Prepare for failures © 2018 HERE | Public Selenium Camp | March, 2018
  42. Conclusions Do: • Immutable infrastructure • Infrastructure as code •

    Prepare for failures • Monitor your spending's © 2018 HERE | Public Selenium Camp | March, 2018