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

D405f3b9dc9fa223f6fa507717f41372?s=47 bungoume
April 23, 2019

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

D405f3b9dc9fa223f6fa507717f41372?s=128

bungoume

April 23, 2019
Tweet

Transcript

  1. 2.

     n r . )( iK p A ZUok ,(

    - W s P EabC DY , ( Mc htSe l OI
  2. 4.

      AWS Elastic Beanstalk AWS Lambda S3 push, merge

    ໿300ϦϙδτϦ͕ CircleCIΛར༻ • Unit test • Deploy • E2E test
  3. 5.

      AWS Elastic Beanstalk ECR push, merge • Unit

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

    ) (

  6. 9.

    ) ( 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 ॲཧ࣌ؒ͸ҰྫͰ͢
  7. 10.

       •    • ։ൃऀͷ࣌ؒΛୣ͏ •

    ςετ͕མͪͨͱ͖ͷଛࣦײ͕૿͑Δʢࣗ෼ௐ΂ʣ •   • ͙͢ϦϦʔε͍ͨ͠ͷʹͰ͖ͳ͍ •     • CircleCIʹ͓͕͔͔ۚΔ
  8. 14.

    • . • OrbsΛ࢖͏ͱ؆୯ • 5GB(head͸1GB)ϦϙδτϦͰ90s -> 60s • .

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

       •   • )$!  (

      • )&"# '% *+ 
  10. 18.

      •   ! •  • 

       • Dockerfile಺Ͱ `COPY . /usr/src/app` ͍ͯ͠Δ৔߹͸ .dockerignore Λ༻ҙ • deploy_env/ .git/ .circleci/ ͳͲΞϓϦ࣮ߦʹෆཁͳϑΝΠϧؚ͕·Εͯͳ͍͔
  11. 19.

    , ) (2 R I 1) ) 3 ) -

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

     • - + .1 0 + • L O

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