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
Docker + Jenkinsでバッチ実行 / Using Docker and Jenkins execution batch
Search
yutachaos
April 12, 2018
Technology
0
230
Docker + Jenkinsでバッチ実行 / Using Docker and Jenkins execution batch
2018.4.11 社内勉強会で発表した
Batch実行環境のスライド
yutachaos
April 12, 2018
Tweet
Share
More Decks by yutachaos
See All by yutachaos
JenkinsのJobを CronJobに移した話 /The story of moving Jenkins Job to CronJob
yutachaos
0
160
History of Infrastructure as a Code testing
yutachaos
2
5k
AWS CodePipeline 初めて触って少しハマった話 / A story that challenged AWS CodePipeline for the first time
yutachaos
0
74
gRPC in スタディサプリENGLISH / gRPC in StudySapuri ENGLISH
yutachaos
0
2.6k
AKS,EKS,GKEコマンド比較してみた /compared AKS, EKS, GKE command
yutachaos
2
2k
AWS ECS の説明 /aws-ecs-introduction
yutachaos
0
76
Spring Batchの紹介
yutachaos
0
240
非エンジニア向けMarkdown 勉強会
yutachaos
1
260
Circle CI 入門
yutachaos
0
560
Other Decks in Technology
See All in Technology
あらゆる商品を扱う商品データベースを再設計した話 / product db re-architecture
rince
8
3.6k
ビジネスとコード品質の接合点 そしてコード品質がそこに及ぼす影響 / The Intersections of Business and Engineering, and The Impact of Code Quality There
mtx2s
10
1k
エバンジェリスト活動を7年やってきて見えてきた、コミュニティとエバンジェリストの関係
soracom
PRO
1
200
業務で使えるかもしれない…!?GitHub Actions の Tips 集 / CI/CD Test Night #7
ponkio_o
PRO
24
6.9k
任意コード実行の原理
ffri
0
170
Cloud Friendly(?) Jenkins. How we failed to make Jenkins cloud native and what we learned?
onenashev
PRO
0
110
現実世界の事象から学ぶSOLID原則
h0r15h0
24
10k
Azureコストは水道代/The_47th_Tokyo_Jazug
aeonpeople
3
350
Getting started with controlling LEGO using Swift
hcrane
0
130
GitHub最新情報キャッチアップ 2024年3月
dzeyelid
16
3.2k
技育祭2024春 LT Finatextホールディングス
kevinrobot34
1
160
技術広報として2023年度に頑張ったこと / What we did well in FY2023 as a DevRel
pauli
5
460
Featured
See All Featured
Faster Mobile Websites
deanohume
296
30k
The World Runs on Bad Software
bkeepers
PRO
60
6.6k
Fontdeck: Realign not Redesign
paulrobertlloyd
75
4.8k
Unsuck your backbone
ammeep
660
56k
Thoughts on Productivity
jonyablonski
57
3.8k
A Philosophy of Restraint
colly
195
15k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
39
4.3k
Reflections from 52 weeks, 52 projects
jeffersonlam
343
19k
What’s in a name? Adding method to the madness
productmarketing
PRO
14
2.6k
GraphQLの誤解/rethinking-graphql
sonatard
48
9.1k
A Tale of Four Properties
chriscoyier
150
22k
Art, The Web, and Tiny UX
lynnandtonic
288
19k
Transcript
Jenkins + Docker Batch࣮ߦ 2018/4/11 ଜ༐ଠ
Batch࣮ߦͷྲྀΕ scheduled trigger (ఆظ࣮ߦ) Batch࣮ߦ༻ͷEC2 Jenkins༻ͷEC2 1. docker image pull
(imageͷऔಘ) ECR 2. docker-compose run (batchॲཧͷ࣮ߦ) DB ,S3 ͳͲ 3. logCloudWatch logsʹग़ྗ
Batchશମͷ࣮ߦͷྲྀΕ • BatchࣗମͷδϣϒεέδϡʔϥʔཧJenkinsΛར༻ • EC2্ʹJenkinsΛઃఆͯ͠ར༻ (ͦͷ͏ͪJenkinsDockerԽ͍ͨ͠ɾɾɾ) • ֤BatchͷJobͷ੍ޚʹPipelineΛར༻
Jenkins Pipelineͱ • Jenkins2͔Βඪ४ར༻ग़དྷΔΑ͏ʹͳͬͨ(چpipeline plugin) • ֤Jobͷॲཧͷॱ൪ґଘؔΛཧɾ࣮ߦ͢ΔͨΊͷػೳ • gitཧͯ͠ɺgit͔ΒϑΝΠϧΛಡΈग़࣮ͯ͠ߦՄೳ •
ॲཧ༰ΛGroovyͰॻ͘͜ͱ͕ग़དྷΔͷͰಈతͳॲཧهड़ग़དྷΔ • pipelineܗࣜͰॻ͘ͱɺjobͷ༰͕visualize͕ग़དྷΔ(·ͩΠϚΠνͳ෦ ଟ͍͕ɺɺɺ) • doc • https://jenkins.io/doc/book/pipeline/
Jenkinsfile ײ • ͍͠ॴ • ใ͕গͳ͍ͷͰֶशίετ͕͋Δ • ·ͩ৽͍͠ͷͰɺػೳͷมԽ͕ૣ͍ • ྑ͔ͬͨॴ
• ίʔυϕʔεͰJobͷґଘੑΛॻ͚Δ • pipelineͷܗͰJobΛهࡌ͢ΔͱɺJobͷґଘੑ͕ݟ͍͢ • ScriptͰಈతͳparameter࡞ग़དྷΔ
Batch࣮ߦڥ
• ࣮ߦڥDockerΛར༻ • Docker ImageͷbuildCircleCIͰߦ͍ɺECRʹpush͢Δ • Jenkins͔ΒDocker͕ೖ͍ͬͯΔEC2ʹରͯ͠ɺDockerΛىಈɺ Docker্ͰBatchΛ࣮ߦ Batchͷ࣮ߦڥ
Docker BuildͷྲྀΕ Github Developer CircleCI ECR (Elastic Container Registry) git
push build trigger docker push githubͷίʔυΛར༻ͯ͠ɺ dockerͷimageΛbuildΛߦ͏
Dockerͷར༻ํ๏ • ֤RepositoryͰDockerΛར༻ͯ͠։ൃ • MasterʹMerge͞ΕͨΒɺCircleCIͰDockerͷImageΛbuild,ECRͰ push͢ΔΑ͏ʹ͍ͯ͠Δ • BatchͰECR্ʹPush͞ΕͨImageΛར༻ͯ͠ɺEC2্ͰdockerΛ ىಈɺॲཧΛ࣮ߦ
Batch࣮ߦڥͷ·ͱΊ • ͍͠ॴ • DockerΛར༻ͨ͠ࡍͷڥใͷཧ • 12 factors appతʹڥมʹΓग़͢ͷ͕ͩɺཧ͕େม •
Parameter StoreΛͬͯΈ͕ͨɺ·͍ͩͮΒ͔ͬͨͷͰࠓճஅ೦͠·͠ ͨɻɻɻ • ྑ͔ͬͨॴ • DockerΛར༻ͨ͠෦ • ࣮ߦڥͷґଘΛཧ͘͢͠ͳͬͨ • Docker͑͞ೖ͍ͬͯΕɺಉ͡αʔόʔ্Ͱ৭ʑͳݴޠΛಈ͔ͤͨ • CloudWatch Logsͷઃఆ͕͍͢͠
͋Γ͕ͱ͏͍͟͝·ͨ͠