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
150
IDC에서 AWS로 Redis 데이터 이전하기
mingrammer
0
360
개발자의 흔한 취미: 오픈소스 개발
mingrammer
2
630
회사 밖에서 성장하기
mingrammer
7
11k
Building a serverless application with AWS
mingrammer
1
660
python report card
mingrammer
0
270
머신러닝을 위한 기초 수학 살펴보기
mingrammer
6
7k
Make RESTful API with Go
mingrammer
7
810
Become a Backend Developer
mingrammer
4
1.6k
Other Decks in Programming
See All in Programming
GitHub Actionsのキャッシュと手を挙げることの大切さとそれに必要なこと
satoshi256kbyte
5
430
Contemporary Test Cases
maaretp
0
140
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.3k
TypeScript Graph でコードレビューの心理的障壁を乗り越える
ysk8hori
2
1.1k
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
250
Kaigi on Rails 2024 〜運営の裏側〜
krpk1900
1
230
Jakarta EE meets AI
ivargrimstad
0
650
初めてDefinitelyTypedにPRを出した話
syumai
0
420
「今のプロジェクトいろいろ大変なんですよ、app/services とかもあって……」/After Kaigi on Rails 2024 LT Night
junk0612
5
2.2k
OSSで起業してもうすぐ10年 / Open Source Conference 2024 Shimane
furukawayasuto
0
110
イベント駆動で成長して委員会
happymana
1
330
Jakarta EE meets AI
ivargrimstad
0
200
Featured
See All Featured
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
A designer walks into a library…
pauljervisheath
204
24k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Happy Clients
brianwarren
98
6.7k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
Designing the Hi-DPI Web
ddemaree
280
34k
Raft: Consensus for Rubyists
vanstee
136
6.6k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
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