Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Running High-Speed Serverless with nuclio

995 views

Published on

Learn how simply build and run serverless functions for a broad set of use-cases

Published in: Data & Analytics
  • Be the first to comment

Running High-Speed Serverless with nuclio

  1. 1. iguazio © 2016 1 https://nuclio.io
  2. 2. iguazio © 2016 2 2 Years to Production Moving Target, Skill Gaps High CapEx & OpEx Not Enterprise Grade Businesses Rely on Modern Services But DIY is Complex and Failing 2
  3. 3. iguazio © 2016 3 High-Level Abstractions and Serverless Solve the Complexity Enabling faster business transformation
  4. 4. iguazio © 2016 4 iguazio Data Platform: Simple, Fast, and Secure SERVERLESS FUNCTIONS MICRO-SERVICESSTATELESS DATA APIs NoSQL API Stream API Object API File API Security Queries & Functions Unified Data Data Lifecycle High-performance unified data fabric S3 Kinesis DynamoDB SQL (Presto) Managed data services and serverless like in the cloud, just: • Unified • Up to 100x Faster • Deployed ANYWHERE • 1/3rd the COST Unified Data Platform Productivity with Performance
  5. 5. iguazio © 2016 5 What is Serverless? “No need to spend time and resources on server provisioning, maintenance, updates, scaling, and capacity planning. Instead, all of these tasks and capabilities are handled by a serverless platform and are completely abstracted away from the developers and IT/operations teams” - CNCF Serverless Paper Event Sources Function Instance invoker Function Instance invoker Function Instance invoker Event Sources Event Sources Synchronous or Asynchronous Invocation FaaS Controller Platform Services (Identity, Data, etc.)
  6. 6. iguazio © 2016 6 Serverless Application Examples APIS, UI, DASHBOARDS DATA / EVENT SOURCES DATA SERVICES DATA SERVICES DATA SOURCE DESTINATION IOT DEVICE / GATEWAY CENTRAL / EDGE CLOUD Real-time Analytics & AI Data Transformation & Movement IoTAPIs, UI, Bots APP SERVICES APP SERVICES SENSORS
  7. 7. iguazio © 2016 7 Serverless Pros and Cons • Serverless: Easy to deploy functions, no scripts, Dockerfiles, build, etc. Auto-scaling and event triggers are built-in Use any language • What’s missing in current implementations? Slow performance, lack of concurrency, no stream partitioning Limited number of event sources (mostly HTTP, some Kafka) Hard to debug and diagnose Hard to manage complex functions and dependencies
  8. 8. iguazio © 2016 8 nuclio: A New Real-Time Serverless Platform Comprehensive, Open, Super Fast and Runs ANYWHERE Variety of event sources, single API 8 400K Events/sec per Process Maximum performance Dev, test, and run ANYWHERE Simple, fast and secure data integration https://github.com/nuclio/nuclio http://nuclio.io Platform Controller Local or shared image repository Event Listeners Real-Time, Auto-scaling Function OS Language Runtime Function Workers Data Bindings Pluggable Data Services Pluggable Event Sources Platform API: config, log, monitor, security HTTP, AMQP, MQTT, Kafka, Kinesis, NATS, Files/DB CLI & UI
  9. 9. iguazio © 2016 9 nuclio Perf Results: Single Process, Basic Echo Functions Lang Threads HTTP Req/sec Avg Latency 1 40,281 24 us 100 372,496 2.03 ms 1 30,156 38us 100 66,681 3.41 ms Setup: a single AWS C5.9Xlarge instance Other Serverless/FaaS platforms processed only 1-5K events/sec at magnitudes higher latency ! Up to 100X Faster Py Go
  10. 10. iguazio © 2016 10 Data Bindings $ nuctl deploy <name> <source> [options] Enabling Simple and Continuous Dev and Ops (CI/CD) One click to test, deploy, upgrade or rollback code Runs ANYWHERE, Self-healing and auto-Scaling LOCAL or CLOUD
  11. 11. iguazio © 2016 11 nuclio Playground – Online Dev, Config, and Test Environment Edit, Deploy, Run, Test Configure
  12. 12. iguazio © 2016 12 nuclio Function Spec Support Kubernetes CRD: Functions can be created and deleted using kubectl tags/labels used for search and event sources (Label Selectors) Control Min/Max Replicas for controlled auto-scale Pass text or secret environment variables (k8s convention) Flex resource allocation, GPUs are coming Pluggable Data Sources Various src code options*: inline code, path (local/http/git), or local/remote pre-built image namespaced For the full spec see: https://github.com/nuclio/nuclio/blob/master/docs/configuring-a-function.md
  13. 13. iguazio © 2016 13 Function Example – Sentiment Analysis Dependencies (in YAML, UI or Code comments) Call API (Trigger independent) Structured Logging Structured or Unstructured Response
  14. 14. DEMO Type the following command and browse to <host-ip>:8070 docker run -p 8070:8070 -v /var/run/docker.sock:/var/run/docker.sock -v /tmp:/tmp nuclio/playground:0.2.1-amd64
  15. 15. iguazio © 2016 15 Serverless Invocation Modes Function Instance invoker Message Function Instance invoker Function Instance invoker Exchange Message Queue (e.g. RabbitMQ) HTTP API GW Function Instance invoker Function Instance invoker Function Instance invoker Req Function Instance invoker Function Instance invoker Function Instance invokerPartition 1 Messages Synchronous Req/Rep Message Stream Async Message Queue Kafka, Kinesis, etc. Function Instance invoker Function Instance invoker Function Instance invoker Job Job (Master/Worker) Priority Queue Master (dealer) Dealer Partition 2 Partition 3 Partition 4
  16. 16. iguazio © 2016 16 Serverless is Enabling Intelligent and Continuous Applications ACTIONS, INTERACTIVE UI & DASHBOARDS EXTERNAL SOURCES OPERATIONAL DATA CONTAINERIZED AI & ANALYTICS TOOLS EXTERNAL DATA SOURCES / LAKES DATA SERVICES Productivity | Faster Insights | Invisible Infrastructure | Lower TCO SyncIngest / Alert APIs & Triggers Analyze
  17. 17. iguazio © 2016 17 Real-time Maps & Dashboards Extract Metadata: Geo location, time, device, thumbnail Deep Learning: Detect people, gender, age, etc. Queries: Find people in places, relations Missing person notification Trigger Update SMS Query/Scan Trigger Update Trigger • Pictures + Metadata • People DB, Locations and relations Ingest DATA SERVICES Real-Time Surveillance Example
  18. 18. iguazio © 2016 18 Streaming vehicle data via web APIs Real-Time Analytics for Alerts and Proactive Maintenance Real-time enrichment with weather & road data Finds correlations between weather conditions and vehicle components Weather Microservice for data ingestion Customer use case #1 Road info Real-time alerts Real-time Dashboard DATA SERVICES
  19. 19. iguazio © 2016 19 Real-Time Fleet Management Dashboard Real-time enriched data Fuel consumption and weather correlation Vehicle location heatmap Filter by bad weather alerts Customer use case #1
  20. 20. iguazio © 2016 20 Real Example: Event-Driven Analytics for Connected Cars Geo Data Weather/Road info Vehicles Data State Changed? Identify Violation? Drivers Violations Stream State Changes Geo Aggregate Map Process Alerts Process Violations External Sources Import service Enriched Events Parallel Enrichment ML Processing Complex Events + Data processed in real-time without the infrastructure hassle real-time, auto-Scaling serverless functions Model Update Stats Update * See code in the UI/Playground slide
  21. 21. Thank You nuclio is easy: try it and give it a https://github.com/nuclio Sign up for our online hackathon and build the greatest serverless application on nuclio. You just might win a Phantom 4 drone…
  22. 22. iguazio © 2016 22 CLI (Run Command Example) $ nuctl run --help Build, deploy and run a function Usage: nuctl deploy function-name [flags] Flags: --base-image string Name of base image. If empty, per-runtime default is used --build-command String Commands to run on build of processor image --data-bindings string JSON encoded data bindings for the function (default "{}") --desc string Function description -d, --disabled Start function disabled (don't run yet) -e, --env string Environment variables (name1=val1,name2=val2..) -f, --file string Function configuration file --handler string Name of handler -h, --help help for deploy -i, --image string Docker image name, will use function name if not specified -l, --labels string Additional function labels (lbl1=val1,lbl2=val2..) --max-replicas int Maximum number of function replicas --min-replicas int Minimum number of function replicas --no-pull Don't pull base images - use local versions --nuclio-src-dir string Local directory with nuclio sources (avoid cloning) --nuclio-src-url string nuclio sources url for git clone (default "https://github.com/nuclio/nuclio.git") -o, --output string Build output type - docker|binary (default "docker") -p, --path string Function source code path --port int Public HTTP port (node port) --publish Publish the function -r, --registry string URL of container registry (env: NUCTL_REGISTRY) --replicas int If set, number of replicas is static (default 1) --run-image string If specified, this is the image that the deploy will use, rather than try to build one --run-registry string The registry URL to pull the image from, if differs from -r (env: NUCTL_RUN_REGISTRY) --runtime string Runtime (e.g. golang, golang:1.8, python:2.7) --triggers string JSON encoded triggers for the function (default "{}") --version string Docker image version (default "latest") Global Flags: -k, --kubeconfig string Path to Kubernetes config (admin.conf) -n, --namespace string Kubernetes namespace (default "default") --platform string One of kube/local/auto (default "auto") -v, --verbose verbose output See more in: https://github.com/nuclio/nuclio/blob/master/docs/nuctl/nuctl.md

×