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
GoogleContainerBuilderOverview
Search
sakajunquality
April 27, 2018
Technology
3
1.4k
GoogleContainerBuilderOverview
#cndjp5
https://cnd.connpass.com/event/84310/
sakajunquality
April 27, 2018
Tweet
Share
More Decks by sakajunquality
See All by sakajunquality
DevFest Tokyo 2023: Google Cloudでチームで安全にデプロイをする
sakajunquality
10
1.8k
Cloud Spanner Monitoring 入門 / Cloud Spanner Monitoring Introduction
sakajunquality
1
1.3k
GKE Overview March 2021: Introducing Autopilot
sakajunquality
1
800
Introduction to Cloud Run 2021
sakajunquality
3
1.5k
Building Reliable Distributed Systems on GCP
sakajunquality
1
230
Istio 1.5 Updates
sakajunquality
4
1.9k
GCP 101: Getting Started through Cloud Run
sakajunquality
6
3.6k
Seeking Observability, Getting Started with Service Mesh
sakajunquality
0
140
Fastly Yamagoya Meetup: Leveraging Cloud Portability with Fastly
sakajunquality
0
15k
Other Decks in Technology
See All in Technology
サービスでLLMを採用したばっかりに振り回され続けたこの一年のあれやこれや
segavvy
2
390
AWS re:Invent 2024で発表された コードを書く開発者向け機能について
maruto
0
190
[Ruby] Develop a Morse Code Learning Gem & Beep from Strings
oguressive
1
150
KnowledgeBaseDocuments APIでベクトルインデックス管理を自動化する
iidaxs
1
260
社内イベント管理システムを1週間でAKSからACAに移行した話し
shingo_kawahara
0
180
Amazon Kendra GenAI Index 登場でどう変わる? 評価から学ぶ最適なRAG構成
naoki_0531
0
100
宇宙ベンチャーにおける最近の情シス取り組みについて
axelmizu
0
110
KubeCon NA 2024 Recap / Running WebAssembly (Wasm) Workloads Side-by-Side with Container Workloads
z63d
1
240
2024年にチャレンジしたことを振り返るぞ
mitchan
0
130
ずっと昔に Star をつけたはずの思い出せない GitHub リポジトリを見つけたい!
rokuosan
0
150
10個のフィルタをAXI4-Streamでつなげてみた
marsee101
0
160
PHP ユーザのための OpenTelemetry 入門 / phpcon2024-opentelemetry
shin1x1
1
160
Featured
See All Featured
Unsuck your backbone
ammeep
669
57k
A Tale of Four Properties
chriscoyier
157
23k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Facilitating Awesome Meetings
lara
50
6.1k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.9k
A designer walks into a library…
pauljervisheath
204
24k
Testing 201, or: Great Expectations
jmmastey
40
7.1k
Bash Introduction
62gerente
608
210k
YesSQL, Process and Tooling at Scale
rocio
169
14k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
Documentation Writing (for coders)
carmenintech
66
4.5k
Transcript
#cndjp5 @sakajunquality Google Container Builder
Overview
- GCP Full-Managed CI - Build and Push Docker Image
- Build and Upload Artifact Tarball Overview Container Builder Container Registry Source Code CI Registry/Storage Trigger Cloud Storage Upload Push
- Also works as CI/CD Pipeline Overview Container Builder Container
Registry Source Code CI Registry Compute Engine Kubernetes Engine Runtime Deployment
- Version (as of 26 April 2018) 17.05? Docker
Basic Usage & Configuration
Configuration: GCP Console
Configuration: cloudbuild.yaml // cloudbuild.yaml steps: # build - name: 'gcr.io/cloud-builders/docker'
args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/my-app:$REVISION_ID', '.' ] # push - name: 'gcr.io/cloud-builders/docker' args: ["push", "gcr.io/$PROJECT_ID/my-app:$REVISION_ID"] List build steps
- Supported Build Steps - https://github.com/GoogleCloudPlatform/cloud-builders - bash is also
available - - name: 'gcr.io/cloud-builders/gcloud' - entrypoint: 'bash' - Custom Build Steps - https://cloud.google.com/container-builder/docs/create-custom-build-steps?hl=ja Steps
Supported Builder Images
Notification
Notification - Every event is pushed to Cloud Pub/Sub topic
- Topic: cloud-builds - https://cloud.google.com/container-builder/docs/pubsub?hl=ja Container Builder Cloud Functions Cloud Pub/Sub Event Subscribe
Event Message Payload 1 { "id": "xxxxxxxx-yyyy-zzzz-aaaa-bbbbbbbbbbbb", "projectId": "my-project", "status":
"SUCCESS", "source": { "repoSource": { "projectId": "my-project", "repoName": "github-sakajunquality-my-app", "branchName": "master" } }, // ... }
Event Message Payload 2 { // ... "steps": [ {
"name": "gcr.io/cloud-builders/docker", "args": [ "build", "-t", "gcr.io/my-project/my-repo:hashhash", "." ] }, { "name": "gcr.io/cloud-builders/docker", "args": [ "push", "gcr.io/my-project/my-repo:hashhash"] }, // ... ] // ... }
Event Message Payload 3 { // ... "createTime": "2018-04-06T09:17:45.069621980Z", "startTime":
"2018-04-06T09:17:46.231838575Z", "finishTime": "2018-04-06T09:19:03.547323Z", "sourceProvenance": { "resolvedRepoSource": { "projectId": "my-project", "repoName": "github-sakajunquality-my-app", "commitSha": "88e07c6db8a03653598884dc94ad4e8910c0fd51" } }, // ... }
Cloud Function deploy // deploy cloud function gcloud beta functions
deploy cloudbuild-notify \ --entry-point subscribe \ --trigger-event providers/cloud.pubsub/eventTypes/topic.publish \ --trigger-resource cloud-builds \ --region us-central1 \ --stage-bucket [your bucket]
Slack Notification Sample
Logging & Debugging
Logging & Debugging - Container Builder Console - Stackdriver Logging
Logging: Container Builder
Logging: Stackdriver
Deployment
Deployment // cloudbuild.yaml Steps: // build & push - name:
'gcr.io/cloud-builders/kubectl' args: - set - image - deployment - [DEPLOYMENT-NAME] - [CONTAINER]=gcr.io/[PROJECT-ID]/[IMAGE]:[TAG] // see also https://cloud.google.com/container-builder/docs/configuring-builds/build-test-deploy-artifacts?hl=ja
Online Resources
- Official Document - https://cloud.google.com/container-builder/docs/?hl=ja - Speeding-up - https://cloud.google.com/container-builder/docs/speeding-up-builds?hl=ja#using_a _cached_docker_image
Online Resources
Thank you