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
200
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
92
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
99
Spring Batchの紹介
yutachaos
0
280
非エンジニア向けMarkdown 勉強会
yutachaos
1
360
Circle CI 入門
yutachaos
0
710
Other Decks in Technology
See All in Technology
Devin(Deep) Wiki/Searchの活用で変わる開発の世界観/devin-wiki-search-impact
tomoki10
0
310
SFTPコンテナからファイルをダウンロードする
dip
0
190
Create a Rails8 responsive app with Gemini and RubyLLM
palladius
0
120
Long journey of Continuous Delivery at Mercari
hisaharu
1
210
新卒3年目の後悔〜機械学習モデルジョブの運用を頑張った話〜
kameitomohiro
0
230
Grafana MCP serverでなんかし隊 / Try Grafana MCP server
kohbis
0
340
QAはソフトウェアエンジニアリングを学んで実践するのが大事なの
ymty
1
390
評価の納得感を2段階高める「構造化フィードバック」
aloerina
1
160
JSX - 歴史を振り返り、⾯⽩がって、エモくなろう
pal4de
2
570
Rubyで作る論理回路シミュレータの設計の話 - Kashiwa.rb #12
kozy4324
1
290
マルチテナント+マルチプロダクト SaaS への AI Agent の組み込み方
kworkdev
PRO
2
330
Digitization部 紹介資料
sansan33
PRO
1
4.2k
Featured
See All Featured
Building Applications with DynamoDB
mza
95
6.4k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.4k
BBQ
matthewcrist
89
9.7k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.1k
[RailsConf 2023] Rails as a piece of cake
palkan
55
5.6k
The Cult of Friendly URLs
andyhume
79
6.4k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
16
920
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
The World Runs on Bad Software
bkeepers
PRO
68
11k
Making the Leap to Tech Lead
cromwellryan
134
9.3k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
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ͷઃఆ͕͍͢͠
͋Γ͕ͱ͏͍͟͝·ͨ͠