Built smart service
on GCP
GliaStudio - AI Video Creation Platform
David Chen, CEO
201810
GliaCloud is a technology company
empowering every individual to use and
enjoy Artificial Intelligence and Big Data in
their daily lives.
Founded in 2015, our flagship product,
GliaStudio, is an AI video creation platform
that allows media industry to embrace the
rich video content with ease.
GliaCloud
Founder
Our CEO David Chen graduated from NCTU AI Lab in
Taiwan and has several AI related publications on
International journals. Start to use Google Cloud since
2008 and become one of the Google Cloud Developer
Experts (GDE) since 2014.
Before GliaCloud, David co-founded a startup doing
real-time bidding advertising platform and fully
focused on performance advertising. He then feels
that the current AI technology applications is quite
limited and would like to explore the possibility for
more innovations. That’s why he founded GliaCloud.
AI Video Revolution
Script Produce Voiceover Edit Export Video
Current Solution: Time consuming and labor intensive. Difficult to scale up.
Content Video
GliaStudio: Use AI to generate videos right from your contents in seconds.
Core Technology
Natural
Language
Process
Image
Recognition
Videolize
Analyze
1.NLP algorithm will go over the content and
summarize to scripts.
2.Apply Machine Learning to recognize the
corresponding image and clips.
3.Programmatic compose all material into
ready to use videos.
4.Analyze user behavior and optimize the
video output.
Our Smart Service
on GCP
Smart Brain & Smart Body
Why Micro-Service
Micro-Service
小國寡民。
使有什伯之器而不用,使民重死而不遠徙。
雖有舟輿,無所乘之,雖有甲兵,無所陳之。
使人復結繩而用之,甘其食,美其服,安其居,樂其俗。
鄰國相望,雞犬之聲相聞,民至老死,不相往來。
Source:老子道德經第八十章
Micro-Service
A properly implemented microservices-based application can achieve
the following goals:
• Define strong contracts between the various microservices.
• Allow for independent deployment cycles, including rollback.
• Facilitate concurrent, A/B release testing on subsystems.
• Minimize test automation and quality-assurance overhead.
• Improve clarity of logging and monitoring.
• Provide fine-grained cost accounting.
• Increase overall application scalability and reliability.
Source:		https://cloud.google.com/appengine/docs/standard/python/microservices-on-app-engine
Use GCP
•Why GCP? Cloud Native
Video Production x 10
1000 daily à 18000 daily
with almost the same cost
•Setup time 30sec à 3sec
•Image Size 5GB à 1.3GB
•Memory Usage 8GB à 1GB
Migrate to GCP (2017/12 ~)
Phase 1:
use GKE
Phase 2:
use gRPC and Cloud Endpoint
Cloud Native
Include:
• DevOps
• Continuous Delivery
• MicroServices
• Agile Infrastructure
• 康威定律(Conways Law)
Goal:
• Build for Scale
• Focus on Code, instead of machine
• Version Control
• Reproduce
• (Docker)
• Continuous XXX
• Early detection of early treatment
Cloud Native
Stack
•Unify	ML algorithm,	dataset	management,	training	and	testing...
[GBrain]
•GliaStudio and	other	service
[Application]
•Unify dev/prod	env for	micro-services	python-applications
•Protocol	&	APIs	format,	common	packages,	design	patterns,	logging	&	notifications,	...
•Based	on	gRPC	+	Cloud	Endpoint
[GEnv]
•Handle	common	env setup
Docker
•Unify env for	micro-service	deployment	
•security,	common	image	(ffmpeg),	os,	other	service	(db,	cache,	…)
[G8s]	à KNative,	Istio
•Handle	common	DevOps	tasks
•deployment,	networking,	scale	and	recover		
K8S	(GKE)
•GCP
VM
PAAS / FAAS
Micro-service
Phase 1
Phase 2
Phase 3
G8S
Build GAE on GKE
Why:
• Configure/deploy are painful
• Configure 1 deployment vs configure 1X deployment
• How to keep everything sync?
G8S
Design
• Resource Definition:
• gstudio-master-0-1-20-5-7665985cf9-
bjdwg
• Application: a service
• Role: master / worker / admin / …
• Version: release number (git tag)
• Instance: machine
• Domain: 0-1-20-5.gstudio-master.xxxx.com
Feature:
• Continues integration / deployment /
release
• Resource allocation
• CPU, Memory, Auto Scale
• External IP (external-dns)
Cluster
Cluster
G8S
Stackdriver Monitoring Logging Trace
Error
Reporting
App
Engine
Cloud
Functions
Container
Registry
Cloud Source
Repositories
Release	SDK
Batch Processing
Container Engine
Static Node
Version	Control
Deploy
Moniter
Batch Processing
Container Engine
Preemptible Node
G8S - CLI
➜ src git:(fix-460-permissions) ✗ source ../venv/bin/activate
(venv) ➜ src git:(fix-460-permissions) ✗ g8
g8 version 0.2.28
Type: Main
String form: <src.g8.Main object at 0x10cf2ca10>
File: ~/repos/gstudio/venv/lib/python2.7/site-packages/src/g8.py
Usage: g8 -
g8 - application
g8 - backbone
g8 - build
g8 - debug
g8 - delete
g8 - deploy
g8 - dry
g8 - image-url
g8 - project
g8 - promote
g8 - pyfmt
g8 - release
g8 - scale
g8 - version
Based	on	Google	Fire
GENV
Cloud
Endpoints
GQueue
Cloud Endpoint
Media Storage
Cloud Storage
Meta Data & Workflow
Cloud SQL
Meta Data & Workflow
Cloud Datastore
Media Processing
Container Engine
Autoscaling
Asset Mgmt & Sharing
Container Engine
Autoscaling
Cloud Load
Balancing
Cloud Network
W/ Edge Cache
GENV
• Logging
• Stack Driver Logging, Error Report
• Cache
• Storage
• Cloud Storage
• RPC
• django Restful, gRPC & Cloud
Endpoint
• Type
• Attrs / Schematic / Enum
• Common Design Pattern
• Singleton / Factory
• Utility
• Test
Based on Django and Python 2 / 3
GENV - GQUEUE
Based	on	Google	Pipeline	API
Feature:
DAG for micro-service. class RecordVideo(Pipe):
def run(self, video, fps=25):
…
clips = []
# MAP
for screen in screens:
clip = yield RecordScreen(screen, fps)
clips.append(clip)
screens = yield List(*screens)
clips = yield List(*clips)
# REDUCE
yield Concat(video['audio'], screens, clips)
API
GBrain
Data Sources
Machine Learning
Model
Language Model
Container Engine
Behavior Model
Container Engine
Vision Model
Container Engine
Information
Cloud Storage
Behavior Data
Cloud SQL
Analytics
BigQuery
ETL
Cloud Dataflow
Transform Data
Normalized Data
Cloud Storage
Combined Sources
Hosted Models
Cloud Machine Learning
Customize Models
GPU
API Management
Cloud Endpoints
Google
Speech API
Google
Translation API
Stored Model
Cloud Storage
Combined Sources
Model
Enrich	your	life	with	AI.
https://gliacloud.com/

Build Smart Service on GCP - Google DevFest 2018 Taiwan

  • 1.
    Built smart service onGCP GliaStudio - AI Video Creation Platform David Chen, CEO 201810
  • 2.
    GliaCloud is atechnology company empowering every individual to use and enjoy Artificial Intelligence and Big Data in their daily lives. Founded in 2015, our flagship product, GliaStudio, is an AI video creation platform that allows media industry to embrace the rich video content with ease. GliaCloud
  • 3.
    Founder Our CEO DavidChen graduated from NCTU AI Lab in Taiwan and has several AI related publications on International journals. Start to use Google Cloud since 2008 and become one of the Google Cloud Developer Experts (GDE) since 2014. Before GliaCloud, David co-founded a startup doing real-time bidding advertising platform and fully focused on performance advertising. He then feels that the current AI technology applications is quite limited and would like to explore the possibility for more innovations. That’s why he founded GliaCloud.
  • 4.
    AI Video Revolution ScriptProduce Voiceover Edit Export Video Current Solution: Time consuming and labor intensive. Difficult to scale up. Content Video GliaStudio: Use AI to generate videos right from your contents in seconds.
  • 5.
    Core Technology Natural Language Process Image Recognition Videolize Analyze 1.NLP algorithmwill go over the content and summarize to scripts. 2.Apply Machine Learning to recognize the corresponding image and clips. 3.Programmatic compose all material into ready to use videos. 4.Analyze user behavior and optimize the video output.
  • 6.
    Our Smart Service onGCP Smart Brain & Smart Body
  • 7.
  • 8.
  • 9.
    Micro-Service A properly implementedmicroservices-based application can achieve the following goals: • Define strong contracts between the various microservices. • Allow for independent deployment cycles, including rollback. • Facilitate concurrent, A/B release testing on subsystems. • Minimize test automation and quality-assurance overhead. • Improve clarity of logging and monitoring. • Provide fine-grained cost accounting. • Increase overall application scalability and reliability. Source: https://cloud.google.com/appengine/docs/standard/python/microservices-on-app-engine
  • 10.
    Use GCP •Why GCP?Cloud Native Video Production x 10 1000 daily à 18000 daily with almost the same cost •Setup time 30sec à 3sec •Image Size 5GB à 1.3GB •Memory Usage 8GB à 1GB Migrate to GCP (2017/12 ~) Phase 1: use GKE Phase 2: use gRPC and Cloud Endpoint
  • 11.
    Cloud Native Include: • DevOps •Continuous Delivery • MicroServices • Agile Infrastructure • 康威定律(Conways Law)
  • 12.
    Goal: • Build forScale • Focus on Code, instead of machine • Version Control • Reproduce • (Docker) • Continuous XXX • Early detection of early treatment Cloud Native
  • 13.
    Stack •Unify ML algorithm, dataset management, training and testing... [GBrain] •GliaStudio and other service [Application] •Unifydev/prod env for micro-services python-applications •Protocol & APIs format, common packages, design patterns, logging & notifications, ... •Based on gRPC + Cloud Endpoint [GEnv] •Handle common env setup Docker •Unify env for micro-service deployment •security, common image (ffmpeg), os, other service (db, cache, …) [G8s] à KNative, Istio •Handle common DevOps tasks •deployment, networking, scale and recover K8S (GKE) •GCP VM PAAS / FAAS Micro-service Phase 1 Phase 2 Phase 3
  • 14.
    G8S Build GAE onGKE Why: • Configure/deploy are painful • Configure 1 deployment vs configure 1X deployment • How to keep everything sync?
  • 15.
    G8S Design • Resource Definition: •gstudio-master-0-1-20-5-7665985cf9- bjdwg • Application: a service • Role: master / worker / admin / … • Version: release number (git tag) • Instance: machine • Domain: 0-1-20-5.gstudio-master.xxxx.com Feature: • Continues integration / deployment / release • Resource allocation • CPU, Memory, Auto Scale • External IP (external-dns)
  • 16.
    Cluster Cluster G8S Stackdriver Monitoring LoggingTrace Error Reporting App Engine Cloud Functions Container Registry Cloud Source Repositories Release SDK Batch Processing Container Engine Static Node Version Control Deploy Moniter Batch Processing Container Engine Preemptible Node
  • 17.
    G8S - CLI ➜src git:(fix-460-permissions) ✗ source ../venv/bin/activate (venv) ➜ src git:(fix-460-permissions) ✗ g8 g8 version 0.2.28 Type: Main String form: <src.g8.Main object at 0x10cf2ca10> File: ~/repos/gstudio/venv/lib/python2.7/site-packages/src/g8.py Usage: g8 - g8 - application g8 - backbone g8 - build g8 - debug g8 - delete g8 - deploy g8 - dry g8 - image-url g8 - project g8 - promote g8 - pyfmt g8 - release g8 - scale g8 - version Based on Google Fire
  • 18.
    GENV Cloud Endpoints GQueue Cloud Endpoint Media Storage CloudStorage Meta Data & Workflow Cloud SQL Meta Data & Workflow Cloud Datastore Media Processing Container Engine Autoscaling Asset Mgmt & Sharing Container Engine Autoscaling Cloud Load Balancing Cloud Network W/ Edge Cache
  • 19.
    GENV • Logging • StackDriver Logging, Error Report • Cache • Storage • Cloud Storage • RPC • django Restful, gRPC & Cloud Endpoint • Type • Attrs / Schematic / Enum • Common Design Pattern • Singleton / Factory • Utility • Test Based on Django and Python 2 / 3
  • 20.
    GENV - GQUEUE Based on Google Pipeline API Feature: DAGfor micro-service. class RecordVideo(Pipe): def run(self, video, fps=25): … clips = [] # MAP for screen in screens: clip = yield RecordScreen(screen, fps) clips.append(clip) screens = yield List(*screens) clips = yield List(*clips) # REDUCE yield Concat(video['audio'], screens, clips)
  • 21.
    API GBrain Data Sources Machine Learning Model LanguageModel Container Engine Behavior Model Container Engine Vision Model Container Engine Information Cloud Storage Behavior Data Cloud SQL Analytics BigQuery ETL Cloud Dataflow Transform Data Normalized Data Cloud Storage Combined Sources Hosted Models Cloud Machine Learning Customize Models GPU API Management Cloud Endpoints Google Speech API Google Translation API Stored Model Cloud Storage Combined Sources Model
  • 22.