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
860
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
620
회사 밖에서 성장하기
mingrammer
7
11k
Building a serverless application with AWS
mingrammer
1
640
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
Subclassing, Composition, Python, and You
hynek
3
180
Unlocking Python's Core Magic
leew
0
130
データマイグレーションの成功戦略~サービスリニューアルで失敗しないための実践ガイド~
tkzwtks
8
750
Kotlin Multiplatform at Stable and Beyond (Kotlin Vienna, October 2024)
zsmb
2
370
ML-прайсинг_на_Lamoda__вошли_и_вышли__приключение_на_20_минут__Слава_Цыганков.pdf
lamodatech
0
210
Pydantic x Database API:turu-pyの開発
yassun7010
1
720
dbt-ga4パッケージを実業務に導入してみた話
t_tokumaru_feedcorp
0
130
Go製CLIツールGatling Commanderによる負荷試験実施の自動化
okmtz
3
710
Cancel Next.js Page Navigation: Full Throttle
ypresto
1
210
.NET Aspireのクラウド対応検証: Azureと他環境での実践
ymd65536
1
530
CSC509 Lecture 04
javiergs
PRO
0
150
ビット演算の話 / Let's play with bit operations
kaityo256
PRO
4
180
Featured
See All Featured
Designing Experiences People Love
moore
138
23k
Building Adaptive Systems
keathley
38
2.2k
[RailsConf 2023] Rails as a piece of cake
palkan
49
4.8k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
46
4.9k
A Tale of Four Properties
chriscoyier
156
22k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Learning to Love Humans: Emotional Interface Design
aarron
272
40k
Imperfection Machines: The Place of Print at Facebook
scottboms
264
13k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
231
17k
Embracing the Ebb and Flow
colly
84
4.4k
It's Worth the Effort
3n
183
27k
Code Review Best Practice
trishagee
63
17k
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