Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
CI/CD環境としてGitHub Actionsを選んだ理由
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Hiroki Matsumoto
July 21, 2023
Technology
250
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
CI/CD環境としてGitHub Actionsを選んだ理由
Hiroki Matsumoto
July 21, 2023
More Decks by Hiroki Matsumoto
See All by Hiroki Matsumoto
システム改善・育成のための障害対応訓練
hirokimatsumoto
0
260
初めてのPSI試験 with Vault Associate
hirokimatsumoto
0
270
多数のプロダクトを開発・運用するためのツール環境
hirokimatsumoto
0
200
デプロイメント手法を選択する/Decide the way of deployment
hirokimatsumoto
2
1.1k
Podライフサイクルを体験する/ux-with-pod-lifecycle
hirokimatsumoto
1
590
Effective Container with VSCode Remote Container
hirokimatsumoto
0
180
GKE+Argo workflow
hirokimatsumoto
1
610
Ansibleをやろうと思ったきっかけ/The-reason-why-I-want-to-learn-Ansible
hirokimatsumoto
0
120
GraalVM Native Imageが 見せた未来/graalvm-native-image showed the future
hirokimatsumoto
2
550
Other Decks in Technology
See All in Technology
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
19k
AIコーディングの次。コードレビューと理解負荷を解消して組織の開発生産性を高める
moongift
PRO
2
2.3k
認知負荷をGemini で溶かす — GKE 基盤「Orbit」における AI エージェントの実践
sansantech
PRO
1
270
ボトムアップ文化が強い組織で セキュリティをどう根付かせていくかの現在進行形の話 / Making Security Stick in a Bottom-Up Organization
yamaguchitk333
0
200
関東Kaggler会発表資料
takoi
1
190
Webアクセシビリティ入門 2026
recruitengineers
PRO
2
460
【CEDEC2026】ゲームシナリオライターを支援するAIツール開発の実践 ― 設計とプロンプトの工夫 ―
cygames
PRO
1
770
20分でわかるセキュアAPI
nwiizo
1
190
つくって納得、つかって実感! 大規模言語モデルことはじめ ver2.0
recruitengineers
PRO
3
1.2k
20260807_第6回_関東kaggler会LT_claw系bot xangiと始める、"寂しくない" kaggle
sugupoko
0
200
モノリス Rails でも日中に rails db:migrate を走らせたい! / Daytime rails db:migrate on Monolithic Rails!
euglena1215
4
550
【CEDEC2026】次世代デジタルカードゲームのサーバー設計と運用 〜『Shadowverse: Worlds Beyond』の舞台裏~
cygames
PRO
1
970
Featured
See All Featured
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
540
Being A Developer After 40
akosma
91
590k
Side Projects
sachag
455
43k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.3k
Technical Leadership for Architectural Decision Making
baasie
3
470
Facilitating Awesome Meetings
lara
57
7.1k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
480
Ethics towards AI in product and experience design
skipperchong
2
340
How to Think Like a Performance Engineer
csswizardry
28
2.7k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
360
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
Exploring anti-patterns in Rails
aemeredith
3
460
Transcript
CI/CD環境としてGitHub Actionsを選んだ理由 July 21th, 2023 Matsumoto Hiroki Marketing Cloud Platform
Department Rakuten Group, Inc.
2 Profile 松本宏紀 ( Matsumoto Hiroki ) • Reliability Engineering
Team • Software Engineer • Joined Rakuten in 2020 • Published • OSS: Passenger Go Exporter • Presentation: デプロイメント⼿法を選択する ~ Flagger/Argo Rollouts ~ • GKE + Java + Cassandra → Ruby + Go + Kubernetes ( Private Cloud / AKS ) • Twitter : @hirokimatsumo13
3 Table of Contents 1. CI/CD環境の歴史 2. GitHub Actionsの機能 3.
Self Hosted Runner環境 4. 学習コストと⽣産性、そして独⾃性
4 CI/CD環境の歴史 GitHub + CircleCI Bitbucket + Jenkins GitHub +
GitHub Actions 2021 より⾼い再利⽤性と学習容易性を求めてGitHub Actionsに移⾏ Actionの再利⽤性、そして簡潔なコードがとても魅⼒的。 GitHubのアカウントさえあれば、簡単に開発して動かすことができることとても開発者に対して良い体験を もたらすことができる。
5 GitHub Actionsの機能 Action 環境構築部分などはほぼコードを書く必要がない。また⾃分たちでこのActionを容易に作ることができる。 ロジックを書くというよりも、やるべきことをYamlで宣⾔するという感覚に近い。 タイミング • プルリクエストが作成・変更された場合 •
タグが作成された場合 • ⽇時ベースでのスケジューリング 独⾃のアクション • デプロイ先にmatrixの提供 (後述) 実際の例 • https://github.com/rakutentech/passenger-go-exporter/blob/main/.github/workflows/pull-request.yml • https://github.com/rakutentech/passenger-go-exporter/blob/main/.github/workflows/releease.yml
6 GitHub Actionsの機能 Strategy Libraryにおいて、複数の環境下でのテストを⾏う際、また複数のKubernetesクラスタへのアプリケーション のデプロイなどで利⽤。配備先の管理は別に管理できる。 実際の例 • https://github.com/rakutentech/passenger-go-exporter/blob/main/.github/workflows/e2e.yaml name:
Kubernetes Clusters outputs: matrix: value: ${{ steps.set-matrix.outputs.matrix }} runs: using: composite steps: - id: set-matrix run: | cat <<EOF | tr -d '\n' >> $GITHUB_OUTPUT matrix={ "include": [ { "k8s": ”$CLUSTER", "version": "v1.25.6", "overlays-resource-name": "$OVERLAYS" }, { "k8s": "$CLUSTER", "version": "v1.25.6", "overlays-resource-name": "$OVERLAYS" } ] } EOF shell: bash
7 GitHub Actionsの機能 Environments 環境ごとに変更したい変数管理、対象ブランチの指定、必須レビューの担当を指定できる。 実際の利⽤例 ・リリース時のフロー kubectl diffの表⽰ Approval
kubectl applyの実⾏ Tagの作成 Productionに関してはレビュー必須、その他環境はレ ビュー無しといったことが可能。
8 GitHub Actionsの機能 Notification • https://github.com/integrations/slack • https://github.com/integrations/microsoft-teams ⾃分たちの場合は、Webhookを利⽤したActionを利⽤。
9 GitHub Actionsの機能 CI/CD Tool 理解・習得性 解析性 試験性 安定性(※) ランニングコスト(※)
Jenkins Circle CI GitHub Actions 個⼈でも利⽤しやすくて学びやすい、そしてfork先で簡単にテストできる部分がとても良い。 独⾃に共通部分を作る部分は少なくMarketplaceで数多く提供されており、その知識や経験を 即戦⼒として活かしやすい。独⾃に作られた領域の学習コストは⾼い。 ※楽天でのon-premises環境における⽐較であり、SaaS環境として提供される環境での⽐較ではありません。
10 GitHub Actionsを通じた学び 仕事を通じてより⼀般的な技術要素を学ぶ機会が増える。エンジニアとしても⾃信につながる。
11 Self Hosted Runner 環境 楽天環境下ではEnterpriseレベルのRunnerは提供されていない。 各⾃がSelf Hosted Runnerを管理する必要がある。 Actions
Runner Controllerを利⽤して、最適化を図っている。 管理対象 10 organizations Over300 repositories Azure AKS Actions Runner Controllers controller organization runner 0~Nでqueueベースでのスケーリング。
12 Self Hosted Runner 環境 Metrics監視のためにリポジトリ登録しないといけない問題 https://github.com/actions/actions-runner-controller/blob/master/docs/automatically-scaling-runners.md 頻度が少ないために忘れがち。特にDev Teamの⽅はこれを対応しないとCI/CDが満⾜に動かせない問題 がある。だからといって、hookして⾃動登録するほどのものでもないよなというジレンマがある。
Permission 問題 おそらく下記に関連。 https://github.com/actions/checkout/issues/956 docker run –it –rm bundle -v $(pwd):/xxx xxx exec rspecなどでroot権限などで動かし、ファイルが⽣成さ れた時にクリーンアップされず、次回checkout時にエラーが発⽣する問題があった。 https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/running-scripts-before-or-after-a-job https://github.com/actions/actions-runner-controller/pull/1268 上記を利⽤して、$GITHUB_WORKSPACEを最後にクリーンアップするようにして解決。 #!/bin/sh if [ -n "$GITHUB_WORKSPACE" ]; then echo "CLEAN UP !!!! ${GITHUB_WORKSPACE}” sudo rm -rf $GITHUB_WORKSPACE fi
13 学習コストと⽣産性、そして独⾃性 ⽣産性を上げるために、独⾃性はどうしても⽣まれる 汎⽤的なフレームワーク・ライブラリを⾃分たちのプロダクトに適⽤するためには、そこにどうし ても独⾃性は⽣まれてしまう。 その独⾃性というのは新しく⼊ったエンジニアの障壁となり学習が必要となる。 具体的例として、300以上のリポジトリ管理は⾟く、より管理を楽にするためのシステムを構築し ているが、全体最適化を図ることによってその全体を管理するためのシステムを理解する必要性と いうのが⽣まれてしまう。それを緩和するために特に気をつけていること。 それが如何に優れたプロダクトであれ、閉じられた環境でしか学べない、試せないものはデメリッ
トが⼤きい。 理解︓明⽰的なコード・設定・宣⾔ 学習︓試しやすい環境 学習︓より⼀般的・学習しやすい環境
None