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.3k
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.4k
AWS ECS の説明 /aws-ecs-introduction
yutachaos
0
83
Spring Batchの紹介
yutachaos
0
260
非エンジニア向けMarkdown 勉強会
yutachaos
1
330
Circle CI 入門
yutachaos
0
670
Other Decks in Technology
See All in Technology
N=1から解き明かすAWS ソリューションアーキテクトの魅力
kiiwami
0
130
室長と気ままに学ぶマイクロソフトのビジネスアプリケーションとビジネスプロセス
ryoheig0405
0
370
『衛星データ利用の方々にとって近いようで触れる機会のなさそうな小話 ~ 衛星搭載ソフトウェアと衛星運用ソフトウェア (実物) を動かしながらわいわいする編 ~』 @日本衛星データコミニティ勉強会
meltingrabbit
0
150
Moved to https://speakerdeck.com/toshihue/presales-engineer-career-bridging-tech-biz-ja
toshihue
2
740
The Future of SEO: The Impact of AI on Search
badams
0
200
Building Products in the LLM Era
ymatsuwitter
10
5.5k
抽象化をするということ - 具体と抽象の往復を身につける / Abstraction and concretization
soudai
16
6.8k
RSNA2024振り返り
nanachi
0
580
人はなぜISUCONに夢中になるのか
kakehashi
PRO
6
1.7k
一度 Expo の採用を断念したけど、 再度 Expo の導入を検討している話
ichiki1023
1
170
PHPカンファレンス名古屋-テックリードの経験から学んだ設計の教訓
hayatokudou
2
310
TAMとre:Capセキュリティ編 〜拡張脅威検出デモを添えて〜
fujiihda
2
250
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Being A Developer After 40
akosma
89
590k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.2k
A Modern Web Designer's Workflow
chriscoyier
693
190k
A Tale of Four Properties
chriscoyier
158
23k
Docker and Python
trallard
44
3.3k
Site-Speed That Sticks
csswizardry
4
380
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
4
330
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
10
1.3k
Done Done
chrislema
182
16k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
30
2.2k
KATA
mclloyd
29
14k
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ͷઃఆ͕͍͢͠
͋Γ͕ͱ͏͍͟͝·ͨ͠