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
On-demand image server with Python
Search
mingrammer
May 27, 2017
Programming
3
870
On-demand image server with Python
This is about on-demand image server, the "fitter'
mingrammer
May 27, 2017
Tweet
Share
More Decks by mingrammer
See All by mingrammer
레거시 위에서 재현 가능한 환경 구축하기
mingrammer
0
160
IDC에서 AWS로 Redis 데이터 이전하기
mingrammer
0
370
개발자의 흔한 취미: 오픈소스 개발
mingrammer
2
630
회사 밖에서 성장하기
mingrammer
7
11k
Building a serverless application with AWS
mingrammer
1
670
python report card
mingrammer
0
270
머신러닝을 위한 기초 수학 살펴보기
mingrammer
6
7k
Make RESTful API with Go
mingrammer
7
820
Become a Backend Developer
mingrammer
4
1.6k
Other Decks in Programming
See All in Programming
事業成長を爆速で進めてきたプロダクトエンジニアたちの成功談・失敗談
nealle
3
1.4k
短期間での新規プロダクト開発における「コスパの良い」Goのテスト戦略」 / kamakura.go
n3xem
2
160
これが俺の”自分戦略” プロセスを楽しんでいこう! - Developers CAREER Boost 2024
niftycorp
PRO
0
190
talk-with-local-llm-with-web-streams-api
kbaba1001
0
170
コンテナをたくさん詰め込んだシステムとランタイムの変化
makihiro
1
120
生成AIでGitHubソースコード取得して仕様書を作成
shukob
0
180
rails stats で紐解く ANDPAD のイマを支える技術たち
andpad
1
290
Jakarta EE meets AI
ivargrimstad
0
230
たのしいparse.y
ydah
3
120
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
300
わたしの星のままで一番星になる ~ 出産を機にSIerからEC事業会社に転職した話 ~
kimura_m_29
0
180
Zoneless Testing
rainerhahnekamp
0
120
Featured
See All Featured
Navigating Team Friction
lara
183
15k
How STYLIGHT went responsive
nonsquared
95
5.2k
BBQ
matthewcrist
85
9.4k
Raft: Consensus for Rubyists
vanstee
137
6.7k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
How to Ace a Technical Interview
jacobian
276
23k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
28
4.3k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
5
440
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Transcript
On-demand image server with Python MinJae Kwon (@mingrammer) 2017.05.27 Python
Seminar
Name ӂ (MinJae Kwon) Nickname @mingrammer Email
[email protected]
Who ইҮ
ࣗਝযҗ 3֙ / Backend Developer Blog https://mingrammer.com Facebook https://facebook.com/mingrammer Github https://github.com/mingrammer Eng Blog https://medium.com/@mingrammer
2. ѐߊ زӝ 5. दաܻয় 3. рױೠ ইఃఫ Contents 6.
Next & Future 1. ৡ٣ݔ٘ ࢲߡ? 4. ݽٕ ҳഅ
ৡ٣ݔ٘ ࢲߡ?
ৡ٣ݔ٘ ࢲߡ? Image Server image resized thumbnail rotated
ৡ٣ݔ٘ ࢲߡ? Image Server image resized thumbnail rotated User
Service desired parameters new image
ৡ٣ݔ٘ ࢲߡ? ܳ ܻ ࢤࢿ೧ف ঋইب ؽ ਗೡٸ নೠ
ഋక ܳ ৡ٣ݔ٘۽ ࢤࢿ оמ
ৡ٣ݔ٘ ࢲߡ? ܳ ࢎਊೞח Ѣ ݽٚҔ নೠ ࢎૉ о
ਃೠ ݽ߄ੌ জ ӝ߈ ࢲ࠺झ ਊ оמೠ ࢲ࠺झ
ѐߊ زӝ
ѐߊ زӝ 1. ഥࢎীࢲ ٣ցо ٜ݅য֬ ࢎૉ ߸҃
ਃ 2. ਗࠄਸ о ٣ցীѱ ࢎૉ ߸҃ ਃ ਃ 3. рױೠ সੋ Ѫী ࠺೧ ࣗਊغח ࠺ਊ ֫ 4. ٜ݅!
ѐߊ زӝ ߈ա݅ী ٜ݅Ҋ ಁٸ ਊ ܻࢎ زച۽
ੋ೧ ખ ؊ աই
ѐߊ زӝ द ഥࢎীࢲ ਃೠ ܻࢎ ӝמ ࠺ਯ݅
ਬ೧ࢲ “width”݅ ઑೞҊ நयೞח ӝמ ٯ ೞա But
ѐߊ زӝ ખ ؊ ਬোೠ য়ࣗझ ৡ٣ݔ٘ ࢲߡܳ ٜ݅যࠁ
https://github.com/mingrammer/fitter
рױೠ ইఃఫ
рױೠ ইఃఫ API Server API server for fitter
рױೠ ইఃఫ API Server Configuration Parser Fitter Configuration Parse the
customizable configuration
рױೠ ইఃఫ API Server Configuration Parser Fitter Configuration Storage Manage
storage
рױೠ ইఃఫ API Server Configuration Parser Fitter Configuration Storage Supports
source/store storages Source Store
рױೠ ইఃఫ API Server Configuration Parser Fitter Configuration Storage Supports
file system and s3 Source Store s3 fs
рױೠ ইఃఫ API Server Configuration Parser Fitter Configuration Storage Source
Store s3 fs Engine Processing the transforming
рױೠ ইఃఫ API Server Configuration Parser Fitter Configuration Storage Source
Store s3 fs Engine Thumbnail Flip Resize Rotate Various mode
рױೠ ইఃఫ API Server Configuration Parser Fitter Configuration Storage Source
Store s3 fs Engine Thumbnail Flip Resize Rotate Cache Server Caching the generated image
рױೠ ইఃఫ API Server Configuration Parser Fitter Configuration Storage Source
Store s3 fs Engine Thumbnail Flip Resize Rotate Cache Server Cache Store Manage the cache store
рױೠ ইఃఫ API Server Configuration Parser Fitter Configuration Storage Source
Store s3 fs Engine Thumbnail Flip Resize Rotate Cache Server Cache Store in-memory redis Supports in-memory and redis
рױೠ ইఃఫ API Server Configuration Parser Fitter Configuration Storage Source
Store s3 fs Engine Thumbnail Flip Resize Rotate Cache Server Cache Store in-memory redis Paramter Validator Validate the parameters
рױೠ ইఃఫ API Server Configuration Parser Storage Engine Cache Server
Cache Store Paramter Validator
рױೠ ইఃఫ API Server flask Configuration Parser pyyaml Storage boto3
requests Engine wand Cache Server Cache Store redis-py Paramter Validator Python Fullstack
ݽٕ ҳഅ
ݽٕ ҳഅ ۨನషܻ ҳࢿ
ݽٕ ҳഅ API Server Optional URL for Flask? Pre-registered Not
pre-registered
ݽٕ ҳഅ API Server Optional URL for Flask?
ݽٕ ҳഅ Config parsing - Using common classes
ݽٕ ҳഅ Config parsing Load Config Parsing & Validating Check
Cache Show errors invalid or failed valid
ݽٕ ҳഅ Config parsing - Load and validate the required
fields
ݽٕ ҳഅ Config parsing - Load and validate the required
fields and set the configs
ݽٕ ҳഅ Config parsing - Load and validate the required
fields
ݽٕ ҳഅ Params validator Request Validate Params Handling Show errors
invalid valid
ݽٕ ҳഅ Params validator - Validate all params and restriction
of each mode
ݽٕ ҳഅ Params validator - Validate the all params before
view handling using decorator
Double caching? ݽٕ ҳഅ Check Cache Server Check Store Storage
Generate Use cached Use cached exists exists not not
Double caching? - Use decorators!! Decorator is love ݽٕ ҳഅ
Double caching? - Use decorators!! Decorator is love ݽٕ ҳഅ
How to use different classes on same function? ݽٕ ҳഅ
Stroage S3 File System Cache Store Source Store Source Store In memory Redis class … class … class … class … class … class …
How to use different classes on same function? - Use
Interface-like class ݽٕ ҳഅ
How to use different classes on same function? - Use
Interface-like class ݽٕ ҳഅ
How to use different classes on same function? - Use
Interface-like class ݽٕ ҳഅ Two types are totally different but they have same interfaces!
There is very-simple engine - Just wrapping the each mode.
Common interface :D ݽٕ ҳഅ
We are the world - Combine these modules! ݽٕ ҳഅ
Validate Params Cache Interface Storage Interface Storage Interface Parsing Config Transform Interface Check Cache Store Check Storage Transform Engine Handle Storage
दաܻয়
दաܻয় 1. ۽ஸ ӝ߈ ߸ജ ో 2. ߸ജ
߂ ۄ٘ ߔস ో 3. ߔূ٘ ৡ٣ݔ٘ ࢲߡ
दաܻয় 1. ۽ஸ ӝ߈ ߸ജ ో 2. ߸ജ
߂ ۄ٘ ߔস ో 3. ߔূ٘ ৡ٣ݔ٘ ࢲߡ
दաܻয় நद ࢲߡ ࢸ झషܻ ࢸ ২࣌ ࢸ
दաܻয় fitter ࢲߡ ҳز
दաܻয় ߸ജ ਃ Wallpaper/squares_widew.png ܳ 200 x 300ਵ۽ ߸ജ
resize
दաܻয় What is ‘get’? show : Retrieve the image information
asynchronously (not yet) get : Retrieve the image information synchronously redirect : Redirect to url of transformed image
दաܻয় ਃ റ ߈ജч
दաܻয় நद ࢲߡ (Redis) ഛੋ
दաܻয় S3 ߡఉ நद ٣۩షܻ ഛੋ
दաܻয় ߸ജ Ѿҗ ഛੋ 2880 x 1800 200 x
300
दաܻয় IT WORKS GOOD THING
Next & Future
Next & Future 1. In memory நद झషয ਗ 2.
࠺زӝ ܻ ਗ (Celery) 3. স۽٘ ߂ ৻ࠗ ܻ ਗ 4. ୶о ২࣌ (Size, Prefix, Shard ١) ਗ 5. ܻ ঘ࣌ ୶о (Crop ١) 6. ࢸ/प೯ਊ fitter CLI ઁҕ 7. ۽ஸ ߸ജోਊ ࣛ ઁҕ 8. పझ ٘ ࢿ 9. ޙࢲച 10. ٣۽ ۽ࣁझ ઁҕ (Pluggable Service)
хࢎפ MinJae Kwon (@mingrammer) 2017.05.27 Python Seminar On-demand image server
with Python