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

CircleCIの活用事例とCI高速化/circleci-community-meetup3-...

bungoume
April 23, 2019

 CircleCIの活用事例とCI高速化/circleci-community-meetup3-speedup

bungoume

April 23, 2019
Tweet

More Decks by bungoume

Other Decks in Technology

Transcript

  1.  n r . )( iK p A ZUok ,(

    - W s P EabC DY , ( Mc htSe l OI
  2.   AWS Elastic Beanstalk AWS Lambda S3 push, merge

    ໿300ϦϙδτϦ͕ CircleCIΛར༻ • Unit test • Deploy • E2E test
  3.   AWS Elastic Beanstalk ECR push, merge • Unit

    test • Deploy • E2E test Docker image Production Standby StandbyʹσϓϩΠ͠ E2E͕௨ͬͨΒSwap ໿300ϦϙδτϦ͕ CircleCIΛར༻
  4. ) (

  5. ) ( AWS Elastic Beanstalk ECR 1. Spin up 10s

    3. Setup remote docker 7s 4. Restore Docker cache 10s 5. Docker build 10s, 150s Production Standby 2. checkout 1s 6. Push Docker image 20~60s 7. Deploy 60s 8. E2E 60s 9. SWAP 8s ॲཧ࣌ؒ͸ҰྫͰ͢
  6.    •    • ։ൃऀͷ࣌ؒΛୣ͏ •

    ςετ͕མͪͨͱ͖ͷଛࣦײ͕૿͑Δʢࣗ෼ௐ΂ʣ •   • ͙͢ϦϦʔε͍ͨ͠ͷʹͰ͖ͳ͍ •     • CircleCIʹ͓͕͔͔ۚΔ
  7. • . • OrbsΛ࢖͏ͱ؆୯ • 5GB(head͸1GB)ϦϙδτϦͰ90s -> 60s • .

    • ٯޮՌͷέʔε΋! • ↓5GBͷϦϙδτϦྫ • Cacheͳ͠ • Checkout code: 70-100ඵ • Cache͋Γ • Restoring cache: 73ඵ • Checkout code: 16ඵ • Saving cache: 139ඵ
  8.    •   • )$!  (

      • )&"# '% *+ 
  9.   •   ! •  • 

       • Dockerfile಺Ͱ `COPY . /usr/src/app` ͍ͯ͠Δ৔߹͸ .dockerignore Λ༻ҙ • deploy_env/ .git/ .circleci/ ͳͲΞϓϦ࣮ߦʹෆཁͳϑΝΠϧؚ͕·Εͯͳ͍͔
  10. , ) (2 R I 1) ) 3 ) -

    ( . 3 D.1) I • (pull, cache-from) &3 ) ) -.2 • CircleCIʹ࿈བྷͯ͠༗ྉΦϓγϣϯΛ༗ޮʹ
  11.  • - + .1 0 + • L O

    C 9 OK EI RI • U_ aTRI • B 8 B R D