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
距離関数を極める! / SESSIONS 2024
gam0022
0
280
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
880
ヤプリ新卒SREの オンボーディング
masaki12
0
130
2024/11/8 関西Kaggler会 2024 #3 / Kaggle Kernel で Gemma 2 × vLLM を動かす。
kohecchi
5
910
聞き手から登壇者へ: RubyKaigi2024 LTでの初挑戦が 教えてくれた、可能性の星
mikik0
1
130
3rd party scriptでもReactを使いたい! Preact + Reactのハイブリッド開発
righttouch
PRO
1
600
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
170
Hotwire or React? ~アフタートーク・本編に含めなかった話~ / Hotwire or React? after talk
harunatsujita
1
120
Jakarta EE meets AI
ivargrimstad
0
510
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1k
Ethereum_.pdf
nekomatu
0
460
Laravel や Symfony で手っ取り早く OpenAPI のドキュメントを作成する
azuki
1
110
Featured
See All Featured
Typedesign – Prime Four
hannesfritz
40
2.4k
Done Done
chrislema
181
16k
Designing on Purpose - Digital PM Summit 2013
jponch
115
7k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
720
A designer walks into a library…
pauljervisheath
203
24k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
506
140k
Rails Girls Zürich Keynote
gr2m
94
13k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
Bash Introduction
62gerente
608
210k
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