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
650
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
Vaporモードを大規模サービスに最速導入して学びを共有する
kazukishimamoto
3
4.2k
Vue.js学習の振り返り
hiro_xre
2
130
ActiveRecordの力でDBのメタデータを迅速に解析する
lnit
5
2.2k
Honoの来た道とこれから
yusukebe
18
2.9k
組織に自動テストを書く文化を根付かせる戦略(2024秋版) / Building Automated Test Culture 2024 Autumn Edition
twada
PRO
9
4.2k
RailsのPull requestsのレビューの時に私が考えていること
yahonda
4
1.5k
開発効率向上のためのリファクタリングの一歩目の選択肢 ~コード分割~ / JJUG CCC 2024 Fall
ryounasso
0
290
PLoP 2024: The evolution of the microservice architecture pattern language
cer
PRO
0
910
約9000個の自動テストの 時間を50分->10分に短縮 Flakyテストを1%以下に抑えた話
hatsu38
21
8.1k
CSC509 Lecture 06
javiergs
PRO
0
140
GPU Hash Table | レイトレ合宿10
yknishidate
0
360
go.mod、DockerfileやCI設定に分散しがちなGoのバージョンをまとめて管理する / Go Connect #3
arthur1
10
2.2k
Featured
See All Featured
StorybookのUI Testing Handbookを読んだ
zakiyama
26
5.2k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
37
1.8k
How to Think Like a Performance Engineer
csswizardry
19
1.1k
What's in a price? How to price your products and services
michaelherold
243
11k
Building an army of robots
kneath
302
42k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
228
52k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
Into the Great Unknown - MozCon
thekraken
31
1.4k
Navigating Team Friction
lara
183
14k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
280
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
92
16k
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