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
self-hosted runnerと actions/cache の噛み合わせが悪かった件 ...
Search
whywaita
PRO
September 25, 2023
Technology
3
2.2k
self-hosted runnerと actions/cache の噛み合わせが悪かった件 #githubactionsmeetup
Talked by
GitHub Actions Meetup Tokyo #2
whywaita
PRO
September 25, 2023
Tweet
Share
More Decks by whywaita
See All by whywaita
masawada Advent Calendarのおもいで #masawadaアドベントカレンダー10周年
whywaita
PRO
0
7
過去事例から見るモニタリングの大切さ #techfeed_live
whywaita
PRO
2
1.3k
バリエーションで差をつける。myshoesの新たな挑戦 #cicd_test_night
whywaita
PRO
0
5.6k
ディスクレスハイパーバイザ 〜運用しやすいクラウドのために〜
whywaita
PRO
0
180
Securing CI/CD Systems Through eBPF (recap)
whywaita
PRO
1
950
GitHub Actions runner基盤におけるオンプレミスマルチテナントアプリケーションの運用 #CADC2022
whywaita
PRO
1
500
Development myshoes and Provide Cycloud-hosted runner -- GitHub Actions with your shoes. #cndjp
whywaita
PRO
0
46
イベント企画運営の経験と実際 / The history of organizing events by me
whywaita
PRO
0
24
作って(壊して?)学ぶインターネットのしくみ サイバーエージェントの実験用ASの紹介 / Introduce experimental AS in CyberAgent Internet Seminer
whywaita
PRO
0
140
Other Decks in Technology
See All in Technology
Raycast Favorites × Script Command で実現するお手軽情報チェック
smasato
1
140
LINE NEWSにおけるバックエンド開発
lycorptech_jp
PRO
0
230
AIエージェント元年
shukob
0
160
Snowflakeの開発・運用コストをApache Icebergで効率化しよう!~機能と活用例のご紹介~
sagara
1
430
ExaDB-XSで利用されているExadata Exascaleについて
oracle4engineer
PRO
3
240
OSS構成管理ツールCMDBuildを使ったAWSリソース管理の自動化
satorufunai
0
640
わたしがEMとして入社した「最初の100日」の過ごし方 / EMConfJp2025
daiksy
14
4.9k
Iceberg Meetup Japan #1 : Iceberg and Databricks
databricksjapan
0
360
PHPで印刷所に入稿できる名札データを作る / Generating Print-Ready Name Tag Data with PHP
tomzoh
0
180
4th place solution Eedi - Mining Misconceptions in Mathematics
rist
0
140
日経のデータベース事業とElasticsearch
hinatades
PRO
0
230
いまからでも遅くない!コンテナでWebアプリを動かしてみよう!コンテナハンズオン編
nomu
0
150
Featured
See All Featured
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
30
4.6k
Building a Scalable Design System with Sketch
lauravandoore
461
33k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
10
510
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7.1k
Navigating Team Friction
lara
183
15k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.3k
The Pragmatic Product Professional
lauravandoore
32
6.4k
Optimizing for Happiness
mojombo
376
70k
Testing 201, or: Great Expectations
jmmastey
42
7.2k
Building Your Own Lightsaber
phodgson
104
6.2k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
7
640
Transcript
self-hosted runnerと actions/cache の噛み合わせが悪かった件 株式会社サイバーエージェント CIU Development div Nakanishi
Kento @whywaita GitHub Actions Meetup Tokyo # 2 @ サイボウズ株式会社 2023/09/21
Nakanishi Kento / whywaita • 株式会社サイバーエージェント 2019新卒 • 業務: CAグループ向けプライベートクラウド開発
• GitHub Actions ベースCIサービス (Managed myshoes) PM • 社内向け IaaS 開発者 • 趣味: ポーカー / XREAL Air / ⾃宅インフラ ISUCON本買ってね! #isucon →
本⽇ • スライド: 48枚 • 発表時間: 10分 = 600秒 •
12.5秒/枚!!!!!! 3
周辺知識 4
action/cache • https://github.com/actions/cache • 依存ライブラリのファイルをキャッシュす ることでCI時間を短くするモジュール • 任意のファイルを保存できる • 1
0 GB / repo まで無料 5
self-hosted runner • ↔ GitHub-hosted runner • ⾃前のインフラでrunner起動するやつ • ⾃宅
社内サーバ プライベートクラウド... • ネットワーク CPU メモリなど嬉しい要素 6
[PR] whywaita/myshoes • Auto-scaling VirtualMachine runner 🏃 for GitHub Actions
• 様々なクラウドでrunnerを作成可能 • https://github.com/whywaita/myshoes 7
[PR] Cycloud 8 •Cy(berAgent)cloud •各種サービスの提供 •IaaS / KaaS / PaaS
/ ML Platform •Cycloud-hosted runner (myshoes)
9 https://www.cyberagent.co.jp/news/detail/id= 2 84 8 4
10 https://isucon.net/archives/ 55 5 3 3 0 13 .html
[PR] Cycloud-hosted runner • Cycloud VMをStadiumとしGitHub-hostedよりも安価に 提供 • LXDイメージはGitHub-hostedとほぼ同じイメージを利⽤ •
https://github.com/whywaita/actions-runner-images- lxd • runnerスペック 2Core 20 GB ~ 16 Core 1 60 GB 11
[PR] 規模感 • Stadium台数: 約80台 ( 1 6 c 160
gb) • 導⼊数: エンジニアの50% が利⽤! • アカウント数ベース • Linux版GAから: 1年8ヶ⽉ • 1⽇の実⾏job数: 約1万個 • 常時500〜700インスタンスぐらい 12
13 https://speakerdeck.com/whywaita/evolution-myshoes-cicd-test-night- 6
14 Internal actions/cache
GitHub owned by Microsoft • GitHub Actionsのバックエンドは (現状)ほぼAzure Pipelines
• 関連サービスもAzureの製品を⽤いて実装 されている(ことが多い) 15
GitHub owned by Microsoft trigger: - main pool: vmImage: 'ubuntu-latest'
steps: - task: Maven@4 inputs: mavenPomFile: 'pom.xml' mavenOptions: '-Xmx3072m' javaHomeOption: 'JDKVersion' jdkVersionOption: '1.11' jdkArchitectureOption: 'x64' 16 https://learn.microsoft.com/ja-jp/azure/devops/pipelines/customize-pipeline?view=azure-devops
ぽい 17
GitHub owned by Microsoft • (whywaita 調べ) • GitHub Actionsのバックエンドは
(現状)ほぼAzure Pipelines • 関連サービスもAzureの製品を⽤いて実装 されている(ことが多い) 18
GitHub owned by Microsoft • (whywaita 調べ) • GitHub Actionsのバックエンドは
(現状)ほぼAzure Pipelines • 関連サービスもAzureの製品を⽤いて実装 されている(ことが多い) 19
actions/cache internal • actions/cache は Azure Blob storage • それっぽい機能が実装されている
• CDNっぽく配信するとか • GETしたら Lifecycle 伸ばすとか 20
actions/cache internal 21 runner Azure blob storage
🙅 22
actions/cache internal 23 runner Azure blob storage
actions/cache internal 24 runner Azure blob storage GitHub Cache API
actions/cache internal • GitHub Cache API (仮称) • 各種情報を確認しているのでは?と推測 •
リポジトリ毎の保存ファイル容量 • アクセス状態 • etc etc... 25
- name: Cache Primes id: cache-primes uses: actions/cache@v3 with: path:
prime-numbers key: ${{ runner.os }}-primes 26
Con fi g less 27
28 Meets self-hosted runner
actions/cache internal 29 runner Azure blob storage GitHub Cache API
actions/cache internal 30 GitHub-hosted Azure blob storage GitHub Cache API
actions/cache internal 31 self-hosted Azure blob storage GitHub Cache API
- name: Cache Primes id: cache-primes uses: actions/cache@v3 with: path:
prime-numbers key: ${{ runner.os }}-primes 32 同じcon fi gが利⽤可能
actions/cache internal 33 🏠 self-hosted Azure blob storage GitHub Cache
API GitHub-hosted Azure blob storage GitHub Cache API
actions/cache internal 34 GitHub-hosted Azure blob storage GitHub Cache API
self-hosted Azure blob storage GitHub Cache API 同じ or 近い
actions/cache internal 35 GitHub-hosted Azure blob storage GitHub Cache API
self-hosted Azure blob storage GitHub Cache API 遠い
Benchmark 36 https://github.com/google/wireit/issues/ 239
遠すぎ🥺 37
@actions/cache (= library) • ライブラリとして内部的に組み込み可能 • actions/setup-go@v 4 • Dependency
cache is default enable • ruby/setup-ruby • rubyのキャッシュが難しく当初より実装 38
避けようがない🥺 39
世間の対応
Backend as a Amazon S 3 • S 3 などオブジェクトストレージをバックエンドに
利⽤したCustom Actionを作る案 • actions/cache に求める物がシンプルならこれでOK • 設定が煩雑になりがち • 各リポジトリごとに AWS_ACCESS_ID 書いたり 41
Backend as a Amazon S 3 • https://github.com/whywaita/actions-cache-s 3
作ってます (ました) • 社内オブジェクトストレージをバックエンドに採⽤ • 課題もいくつかあり • 設定の煩雑性 • GET時にLifecycleを伸ばす機能がS 3 にない 42
BuildJet cache • BuildJet: self-hosted runner 会社 • buildjet/cache@v 3
• バックエンドはCloud fl are R 2 • buildjet/setup-go などを完備 43
BuildJet cache 44
45 https://buildjet.com/for-github-actions/blog/launch-buildjet-cache
46 https://buildjet.com/for-github-actions/blog/launch-buildjet-cache
47 https://buildjet.com/for-github-actions/blog/launch-buildjet-cache
🥰🥰🥰 48
まとめ • self-hosted runnerをactions/cacheで使うと遅い • 海を越えてアクセスを⾏う必要があるため • 各位良い感じのソリューションで 最⾼体験をしてください!!!!!
• We Are hiring! 49