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 Jenki...
Search
yutachaos
April 12, 2018
Technology
0
260
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
210
History of Infrastructure as a Code testing
yutachaos
2
5.4k
AWS CodePipeline 初めて触って少しハマった話 / A story that challenged AWS CodePipeline for the first time
yutachaos
0
94
gRPC in スタディサプリENGLISH / gRPC in StudySapuri ENGLISH
yutachaos
0
2.9k
AKS,EKS,GKEコマンド比較してみた /compared AKS, EKS, GKE command
yutachaos
2
2.4k
AWS ECS の説明 /aws-ecs-introduction
yutachaos
0
100
Spring Batchの紹介
yutachaos
0
280
非エンジニア向けMarkdown 勉強会
yutachaos
1
360
Circle CI 入門
yutachaos
0
720
Other Decks in Technology
See All in Technology
Tech-Verse 2025 Keynote
lycorptech_jp
PRO
0
1.3k
Understanding_Thread_Tuning_for_Inference_Servers_of_Deep_Models.pdf
lycorptech_jp
PRO
0
150
Connect 100+を支える技術
kanyamaguc
0
150
Github Copilot エージェントモードで試してみた
ochtum
0
130
MySQL5.6から8.4へ 戦いの記録
kyoshidaxx
1
300
Snowflake Summit 2025全体振り返り / Snowflake Summit 2025 Overall Review
mtpooh
2
440
Oracle Cloud Infrastructure:2025年6月度サービス・アップデート
oracle4engineer
PRO
2
310
生成AI活用の組織格差を解消する 〜ビジネス職のCursor導入が開発効率に与えた好循環〜 / Closing the Organizational Gap in AI Adoption
upamune
5
4.5k
How Community Opened Global Doors
hiroramos4
PRO
1
130
Should Our Project Join the CNCF? (Japanese Recap)
whywaita
PRO
0
290
ハッカソン by 生成AIハッカソンvol.05
1ftseabass
PRO
0
120
Delegating the chores of authenticating users to Keycloak
ahus1
0
130
Featured
See All Featured
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
20
1.3k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
24k
Optimising Largest Contentful Paint
csswizardry
37
3.3k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.4k
Site-Speed That Sticks
csswizardry
10
670
Optimizing for Happiness
mojombo
379
70k
Docker and Python
trallard
44
3.5k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.5k
The Pragmatic Product Professional
lauravandoore
35
6.7k
Mobile First: as difficult as doing things right
swwweet
223
9.7k
The Invisible Side of Design
smashingmag
300
51k
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ͷઃఆ͕͍͢͠
͋Γ͕ͱ͏͍͟͝·ͨ͠