Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
How GitHub uses Codespaces
Yuichi Tanaka
August 31, 2022
Programming
2
450
How GitHub uses Codespaces
Tech Stand #9 GitHubにてお話しした際の資料です。
https://standfm.connpass.com/event/256786/
Yuichi Tanaka
August 31, 2022
Tweet
Share
More Decks by Yuichi Tanaka
See All by Yuichi Tanaka
30分でわかるシステム運用アンチパターン / Operations Anti Patterns in 30 minutes
yuichielectric
11
11k
オープンソースのベストプラクティスを企業内で実践/How to implement InnerSource
yuichielectric
12
8.5k
GitHubにおける継続的デリバリー/How GitHub builds and deploy software
yuichielectric
12
3k
GitHubにおける GitHub Actions利用法/How GitHub uses GitHub Actions
yuichielectric
7
570
InnerSourceのすすめ / InnerSource
yuichielectric
8
1.5k
GitHub Pro Tips
yuichielectric
0
110
Other Decks in Programming
See All in Programming
ECS Service Connectでマイクロサービスを繋いでみた
xblood
0
510
Swift Observation
shiz
3
240
はてなリモートインターンシップ2022 インフラ 講義資料
hatena
4
2.1k
Findy - エンジニア向け会社紹介 / Findy Letter for Engineers
findyinc
2
42k
和暦を正しく扱うための暦の話
nagise
10
4.5k
Excelの助けを借りて楽にシナリオを作ろう
rpa_niiyama
0
180
Hono v3 - Do Everything, Run Anywhere, But Small, And Faster
yusukebe
4
120
Ruby Pattern Matching
bkuhlmann
0
600
PHPアプリケーションにおけるアーキテクチャメトリクスについて / Architecture Metrics in PHP Applications
isanasan
1
180
はてなリモートインターンシップ2022 フロントエンドブートキャンプ 講義資料
hatena
0
110
Amazon QuickSightのアップデート -re:Invent 2022の復習&2022年ハイライト-
shogo452
0
200
Rallyで支えるバージョン追従
pakio
0
180
Featured
See All Featured
Producing Creativity
orderedlist
PRO
335
37k
Making the Leap to Tech Lead
cromwellryan
116
7.6k
Happy Clients
brianwarren
90
5.8k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
500
130k
Imperfection Machines: The Place of Print at Facebook
scottboms
254
12k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
239
19k
What’s in a name? Adding method to the madness
productmarketing
12
1.9k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
318
19k
The Invisible Customer
myddelton
113
12k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
2
390
How to train your dragon (web standard)
notwaldorf
66
4.2k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
10
1.3k
Transcript
2022/08/31 How GitHub uses Codespaces Tech Stand #9 @yuichielectric 田中
裕一 (@yuichielectric) How GitHub uses Codespaces
2022/08/31 How GitHub uses Codespaces Tech Stand #9 @yuichielectric 田中
裕一 GitHub、シニアソリューションズエンジニア 個人で「システム運用アンチパターン」 (オライリー・ジャパン)の翻訳を担当 @yuichielectric
Codespaces クラウド上の開発環境 妥協のないコーディング体験 ブラウザから、コーディング、ビルド、テスト、 デバッグ、デプロイが可能な完全な開発環境に アクセス。 ワークフローをシンプルに 依存関係やSSHキーを自動でセットアップ。 あらゆるプロジェクトでコーディングを開始できる までの時間を短縮。
カスタマイズ可能 dotfileによるエディタの設定やすべてのCodespace 環境にあらかじめインストールしておくVS Code拡 張の指定など
{ "name": "Go", "build": { "dockerfile": "Dockerfile", "args": { "VARIANT":
"1-bullseye", } }, "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ], "settings": { "go.toolsManagement.checkForUpdates": "local", "go.useLanguageServer": true, "go.gopath": "/go", "go.goroot": "/usr/local/go" }, "extensions": [ "golang.Go" ], "forwardPorts": [8080], "postCreateCommand": "go version", "remoteUser": "vscode" } https://github.com/microsoft/vscode-dev-containers/blob/main/containers/go/.devcontainer/devcontainer.json 名前 コンテナの指定 Visual Studio Codeの設定 Visual Studio Code拡張 フォワードするポート 環境作成後コマンド 実行ユーザー コンテナ実行時パラメータ .devcontainer/devcontainer.json
2022/08/31 How GitHub uses Codespaces Tech Stand #9 @yuichielectric GitHub社内での標準の開発環境
github/github: コミット数100万以上、サイズは 13GB以上 Codespaces以前 各エンジニアのmac上に開発環境を 構築。すべてスクリプト化されては いたものの、環境構築には半日 かかっていた。 Codespaces以後 github/githubの環境を10秒で用意 ブランチ切り替えの必要なし VS Codeユーザー以外からもSSH https://github.blog/jp/2021-08-30-githubs-engineering-team-moved-codespaces/
2022/08/31 How GitHub uses Codespaces Tech Stand #9 @yuichielectric コンテナイメージ
ベースイメージ用のリポジトリを作 り、Actionsで、イメージをビルド しPackagesにpush プリビルド github/githubのmainへのマージ のたびにCodespaces環境をビルド 環境 32コア、64GBメモリのマシン サイズのみを使うように設定 https://docs.github.com/ja/codespaces/prebuilding-your-codespaces/about-github-codespaces-prebuilds Codespace環境のビルド
2022/08/31 How GitHub uses Codespaces Tech Stand #9 @yuichielectric Codespaceのビルド(プリビルドも
含む)は複数リポジトリにも対応 関連するリポジトリに対しての 権限を要求した上で、プリビルド 環境を構築後に必要なリポジトリ を取得してセットアップ https://github.blog/changelog/2022-07-28-prebuilding-codespaces-is-now-supported-for-multi-repository-and-monorepo-projects/ 複数リポジトリ
2022/08/31 How GitHub uses Codespaces Tech Stand #9 @yuichielectric VPNのセットアップをfeaturesを使って共通化。
プロジェクトごとに必要に応じて利用。 その他の手段として、ローカルマシンを、Codespaceと プライベートリソースへのゲートウェイとして使うことも可能。 GitHub CLI拡張としてプレビュー公開。 https://github.com/github/gh-net プライベートリソースへのアクセス
2022/08/31 How GitHub uses Codespaces Tech Stand #9 @yuichielectric Codespaces環境に単機能を追加するプロセスを定義するための仕組み
例 • GitHub CLI • Ruby • SSHサーバ 独自のfeatureを定義することも可能。 devcontainers/feature-template features
2022/08/31 How GitHub uses Codespaces Tech Stand #9 @yuichielectric Codespacesの別の側面
2022/08/31 How GitHub uses Codespaces Tech Stand #9 @yuichielectric ドキュメント担当以外のメンバーが
GitHubのドキュメントに間違いを 見つけた場合であっても、 devcontainer.jsonがあれば、 Codespace上でドキュメントを修正 して、プレビューを確認後にPull Requestを送るというプロセスが 容易になる。 チームの垣根を超えた コントリビュート
2022/08/31 How GitHub uses Codespaces Tech Stand #9 @yuichielectric 社内の多くのリポジトリで
Codespacesの設定をしておくこと でチームの壁を超えたコントリ ビュートの敷居を低減 プリビルドを積極的に使うことで迅 速に開発環境を構築 CodespacesはGitHub社内での 標準開発環境 その過程で生み出された機能を Codespacesに組み込み まとめ
2022/08/31 How GitHub uses Codespaces Tech Stand #9 @yuichielectric Thank
you