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
250
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
190
History of Infrastructure as a Code testing
yutachaos
2
5.2k
AWS CodePipeline 初めて触って少しハマった話 / A story that challenged AWS CodePipeline for the first time
yutachaos
0
86
gRPC in スタディサプリENGLISH / gRPC in StudySapuri ENGLISH
yutachaos
0
2.8k
AKS,EKS,GKEコマンド比較してみた /compared AKS, EKS, GKE command
yutachaos
2
2.3k
AWS ECS の説明 /aws-ecs-introduction
yutachaos
0
83
Spring Batchの紹介
yutachaos
0
260
非エンジニア向けMarkdown 勉強会
yutachaos
1
320
Circle CI 入門
yutachaos
0
650
Other Decks in Technology
See All in Technology
I could be Wrong!! - Learning from Agile Experts
kawaguti
PRO
8
3.4k
2025年の挑戦 コーポレートエンジニアの技術広報/techpr5
nishiuma
0
140
Visual StudioとかIDE関連小ネタ話
kosmosebi
1
370
[IBM TechXchange Dojo]Watson Discoveryとwatsonx.aiでRAGを実現!事例のご紹介+座学②
siyuanzh09
0
110
Amazon Q Developerで.NET Frameworkプロジェクトをモダナイズしてみた
kenichirokimura
1
200
Formal Development of Operating Systems in Rust
riru
1
420
三菱電機で社内コミュニティを立ち上げた話
kurebayashi
1
350
comilioとCloudflare、そして未来へと向けて
oliver_diary
6
440
Oracle Exadata Database Service(Dedicated Infrastructure):サービス概要のご紹介
oracle4engineer
PRO
0
12k
機械学習を「社会実装」するということ 2025年版 / Social Implementation of Machine Learning 2025 Version
moepy_stats
5
970
今から、 今だからこそ始める Terraform で Azure 管理 / Managing Azure with Terraform: The Perfect Time to Start
nnstt1
0
220
アジャイルチームが変化し続けるための組織文化とマネジメント・アプローチ / Agile management that enables ever-changing teams
kakehashi
3
3.3k
Featured
See All Featured
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3.1k
Building Your Own Lightsaber
phodgson
104
6.2k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Being A Developer After 40
akosma
89
590k
Product Roadmaps are Hard
iamctodd
PRO
50
11k
Java REST API Framework Comparison - PWX 2021
mraible
28
8.3k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.5k
Automating Front-end Workflow
addyosmani
1366
200k
The Power of CSS Pseudo Elements
geoffreycrofte
74
5.4k
For a Future-Friendly Web
brad_frost
176
9.5k
Into the Great Unknown - MozCon
thekraken
34
1.6k
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ͷઃఆ͕͍͢͠
͋Γ͕ͱ͏͍͟͝·ͨ͠