Slide 1

Slide 1 text

© 2023 SRE Holdings Corporation 証券コード:2980 © 2023 SRE Holdings Corporation 3 DevOps 2023/06/21

Slide 2

Slide 2 text

© 2023 SRE Holdings Corporation SRE Holdings 2 2014 2019 SRE / AI DX DX IT

Slide 3

Slide 3 text

© 2023 SRE Holdings Corporation • (@kota65535) • • ⁃ ⁃ ⁃ ⁃ CI/CD ⁃ • AWS ⁃ AWS Certified Solution Architect Professional 3

Slide 4

Slide 4 text

© 2023 SRE Holdings Corporation • Dev Ops • 2 • DevOps 4

Slide 5

Slide 5 text

© 2023 SRE Holdings Corporation • • • • DevOps 5

Slide 6

Slide 6 text

© 2023 SRE Holdings Corporation • Continuous Integration ⁃ • Continuous Delivery ⁃ • Microservices ⁃ IF ⾒ • Infrastructure as Code ⁃ • Monitoring and Logging ⁃ • Communication and Collaboration ⁃ DevOps by AWS 6

Slide 7

Slide 7 text

© 2023 SRE Holdings Corporation 1. ⁃ ⁃ ⁃ CI/CD 2. 3. ⁃ DevOps 7

Slide 8

Slide 8 text

© 2023 SRE Holdings Corporation 8 Backend Java Spring Boot MySQL OpenAPI Docker AWS ECS Python FastAPI Frontend Infra/Monitoring TypeScript React Material UI Emotion AWS S3 AWS CloudFront Vitest Cypress AWS Terraform Ansible GitHub GitHub Actions Envoy CloudWatch CI/CD X-Ray SonarCloud Trivy Vite

Slide 9

Slide 9 text

© 2023 SRE Holdings Corporation 9

Slide 10

Slide 10 text

© 2023 SRE Holdings Corporation • CI/CD : GitHub Actions ⁃ GitHub ⾒ ⁃ Action • setup-java: Java • github-openvpn-connect-action: OpenVPN • : GitHub Flow ⁃ main Feature ⁃ vs. Git Flow • Web • • ⁃ ⁃ CI/CD 10

Slide 11

Slide 11 text

© 2023 SRE Holdings Corporation • App Repo ⁃ ⁃ ⁃ • : foo-front, foo-back ⁃ CI • Infra Repo ⁃ (Terraform) ⁃ App Repo ⁃ • : dev, stg, prod ⁃ CD 11 foo ├── build.gradle ├── foo-back └── foo-front foo-infra ├── envs │ ├── dev │ ├── prod │ └── stg ├── files └── modules

Slide 12

Slide 12 text

© 2023 SRE Holdings Corporation App Repo CI 12

Slide 13

Slide 13 text

© 2023 SRE Holdings Corporation • 1 2 • • Pros. ⁃ ⁃ ⁃ • Cons. ⁃ CI ⁃ ⾒ • : ⁃ 1 ~8 ⁃ ⁃ ⾒ 頻 App Repo - vs 13

Slide 14

Slide 14 text

© 2023 SRE Holdings Corporation • • • GNU Make ⁃ ⁃ ⾒ • Bazel ⁃ ⁃ • Gradle ⁃ ⁃ Java 頻 ⁃ App Repo - 14

Slide 15

Slide 15 text

© 2023 SRE Holdings Corporation • Pros. ⁃ ⁃ Java ⁃ ⁃ ⁃ Gradle Wrapper ⁃ Groovy • Cons. ⁃ • • IntelliJ App Repo - Gradle 15

Slide 16

Slide 16 text

© 2023 SRE Holdings Corporation • Language-agnostic • clean ⁃ • check ⁃ • assemble ⁃ • build ⁃ check, assemble App Repo - Gradle 16

Slide 17

Slide 17 text

© 2023 SRE Holdings Corporation • App Repo - Gradle (1/3) 17 assemble jar dockerBuild (Java) assemble npmBuild (Node) zip check test checkstyle check npmTest eslint

Slide 18

Slide 18 text

© 2023 SRE Holdings Corporation • App Repo - Gradle (2/3) 18 assemble check assemble npmBuild (Node) zip check npmTest eslint assemble jar dockerBuild (Java) check test checkstyle

Slide 19

Slide 19 text

© 2023 SRE Holdings Corporation • App Repo - Gradle (3/3) 19 assemble check assemble npmBuild (Node) zip check npmTest eslint assemble jar dockerBuild (Java) check test checkstyle

Slide 20

Slide 20 text

© 2023 SRE Holdings Corporation • • ⁃ ⁃ build • ⁃ ⁃ check App Repo - (1/4) 20 Backend Frontend Build Check 📝

Slide 21

Slide 21 text

© 2023 SRE Holdings Corporation 1. ⁃ paths- lter ⁃ • • 2. ⁃ Gradle Project ⁃ App Repo - (2/4) 21 foo-back: - foo-back/** - * foo-front: - foo-front/** - * $ cd foo-back $ gradle dependentProjects –q :foo-front

Slide 22

Slide 22 text

© 2023 SRE Holdings Corporation • Composite Action • App Repo - (3/4) 22 prepare-build: runs-on: ubuntu-latest outputs: changed: ${{ steps.services.outputs.changed }} # 変更されたサービスのリスト affected: ${{ steps.services.outputs.affected }} # 影響のあるサービスのリスト steps: - name: Checkout uses: actions/checkout@v3 - name: Get services uses: ./.github/actions/get-services id: services

Slide 23

Slide 23 text

© 2023 SRE Holdings Corporation • Matrix App Repo - (4/4) 23 build-changed: needs: - prepare-build if: ${{ needs.prepare-build.outputs.changed != '[]' }} strategy: matrix: service: ${{ fromJSON(needs.prepare-build.outputs.changed) }} uses: ./.github/workflows/build-service.yml with: service: ${{ matrix.service }} check-affected: needs: - prepare-build if: ${{ needs.prepare-build.outputs.affected != '[]' }} strategy: matrix: service: ${{ fromJSON(needs.prepare-build.outputs.affected) }} uses: ./.github/workflows/check-service.yml with: service: ${{ matrix.service }}

Slide 24

Slide 24 text

© 2023 SRE Holdings Corporation App Repo - CI 24

Slide 25

Slide 25 text

© 2023 SRE Holdings Corporation App Repo - CI: Build (1/4) 25

Slide 26

Slide 26 text

© 2023 SRE Holdings Corporation • PR / PR Push • Gradle build / check App Repo - CI: Build (2/4) 26

Slide 27

Slide 27 text

© 2023 SRE Holdings Corporation • (Sonar Scanner) ⁃ ⁃ SonarCloud • PR App Repo - CI: Build (3/4) 27

Slide 28

Slide 28 text

© 2023 SRE Holdings Corporation • Slack • App Repo - CI: Build (4/4) 28 •

Slide 29

Slide 29 text

© 2023 SRE Holdings Corporation App Repo - CI: Release (1/6) 29

Slide 30

Slide 30 text

© 2023 SRE Holdings Corporation • PR / PR Push • Gradle build / check App Repo - CI: Release (2/6) 30

Slide 31

Slide 31 text

© 2023 SRE Holdings Corporation • (Sonar Scanner) App Repo - CI: Release (3/6) 31

Slide 32

Slide 32 text

© 2023 SRE Holdings Corporation • CodeArtifact Publish ⁃ Bundle (Jar) ⁃ OpenAPI Document (YAML) • ECR Push ⁃ Docker Image • API & Publish ⁃ OpenAPI YAML HTML ⁃ Redoc ⁃ S3 App Repo - CI: Release (4/6) 32

Slide 33

Slide 33 text

© 2023 SRE Holdings Corporation • Infra Repo Release ⁃ Repository Dispatch ⁃ • • • App Repo - CI: Release (5/6) 33 { "services": [ { "name": "foo-back", "version": "1.2.3", "island": "01" } ] }

Slide 34

Slide 34 text

© 2023 SRE Holdings Corporation • Slack • @here ⁃ Release App Repo - CI: Release (6/6) 34

Slide 35

Slide 35 text

© 2023 SRE Holdings Corporation Infra Repo CD 35

Slide 36

Slide 36 text

© 2023 SRE Holdings Corporation Infra Repo - CD 36

Slide 37

Slide 37 text

© 2023 SRE Holdings Corporation • App Repo Release • TF Infra Repo CD: Bump 37

Slide 38

Slide 38 text

© 2023 SRE Holdings Corporation Infra Repo CD: Plan (1/4) 38

Slide 39

Slide 39 text

© 2023 SRE Holdings Corporation Infra Repo CD: Plan (2/4) 39 • Bump Push • Terraform Plan

Slide 40

Slide 40 text

© 2023 SRE Holdings Corporation Infra Repo CD: Plan (3/4) 40 • PR PR Plan ⁃ [Click here] Plan

Slide 41

Slide 41 text

© 2023 SRE Holdings Corporation Infra Repo CD: Plan (4/4) 41 • main Slack Plan • Apply

Slide 42

Slide 42 text

© 2023 SRE Holdings Corporation Infra Repo CD: Apply (1/4) 42

Slide 43

Slide 43 text

© 2023 SRE Holdings Corporation Infra Repo CD: Apply (2/4) 43 • Apply OK ⁃ • Terraform Apply ⁃ Plan Plan

Slide 44

Slide 44 text

© 2023 SRE Holdings Corporation Infra Repo CD: Apply (3/4) 44 • ⁃ CodeDeploy ECS Blue/Green

Slide 45

Slide 45 text

© 2023 SRE Holdings Corporation Infra Repo CD: Apply (4/4) 45 • ⁃ CodeArtifact Bundle ⁃ Hosting S3 ⁃ CloudFront

Slide 46

Slide 46 text

© 2023 SRE Holdings Corporation • ⁃ GitHub Template repository • 46

Slide 47

Slide 47 text

© 2023 SRE Holdings Corporation • Terraform Providers ⁃ terraform-provider-maven ⁃ terraform-provider-unarchive ⁃ terraform-provider-temporary • Terraform Modules ⁃ terraform-aws-github-work ow-dispatch ⁃ terraform-aws-github-work ow-dispatch-slack ⁃ terraform-aws-s3-deployment CI/CD OSS 47 • GitHub Actions ⁃ github-terraform-plan-comment-action ⁃ github-terraform-plan-slack-action ⁃ github-workflow-dispatch-action ⁃ github-workflow-dispatch-slack-action ⁃ github-openvpn-connect-action ⁃ github-asdf-parse-action ⁃ github-git-config-action ⁃ github-template-sync-action ⁃ github-template-rename-action

Slide 48

Slide 48 text

© 2023 SRE Holdings Corporation • ⁃ PR 10 Dev ⁃ ⁃ • ⁃ ⁃ • ⁃ ChatOps Apply ⁃ 築 CI/CD 48

Slide 49

Slide 49 text

© 2023 SRE Holdings Corporation DX (Developer Experience) 1 49

Slide 50

Slide 50 text

© 2023 SRE Holdings Corporation