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.

of

Ian huston   getting started with cloud foundry Slide 1 Ian huston   getting started with cloud foundry Slide 2 Ian huston   getting started with cloud foundry Slide 3 Ian huston   getting started with cloud foundry Slide 4 Ian huston   getting started with cloud foundry Slide 5 Ian huston   getting started with cloud foundry Slide 6 Ian huston   getting started with cloud foundry Slide 7 Ian huston   getting started with cloud foundry Slide 8 Ian huston   getting started with cloud foundry Slide 9 Ian huston   getting started with cloud foundry Slide 10 Ian huston   getting started with cloud foundry Slide 11 Ian huston   getting started with cloud foundry Slide 12 Ian huston   getting started with cloud foundry Slide 13 Ian huston   getting started with cloud foundry Slide 14 Ian huston   getting started with cloud foundry Slide 15 Ian huston   getting started with cloud foundry Slide 16 Ian huston   getting started with cloud foundry Slide 17 Ian huston   getting started with cloud foundry Slide 18 Ian huston   getting started with cloud foundry Slide 19 Ian huston   getting started with cloud foundry Slide 20 Ian huston   getting started with cloud foundry Slide 21 Ian huston   getting started with cloud foundry Slide 22 Ian huston   getting started with cloud foundry Slide 23 Ian huston   getting started with cloud foundry Slide 24 Ian huston   getting started with cloud foundry Slide 25 Ian huston   getting started with cloud foundry Slide 26 Ian huston   getting started with cloud foundry Slide 27 Ian huston   getting started with cloud foundry Slide 28 Ian huston   getting started with cloud foundry Slide 29
Upcoming SlideShare
Cloud Native Applications - DevOps, EMC and Cloud Foundry
Next
Download to read offline and view in fullscreen.

1 Like

Share

Download to read offline

Ian huston getting started with cloud foundry

Download to read offline

ODSC March 2016 Meetup

Related Books

Free with a 30 day trial from Scribd

See all

Ian huston getting started with cloud foundry

  1. 1. Getting Started with Cloud Foundry •  Ian Huston, Data ScientistIan Huston, Data Scientist ODSC London 2016
  2. 2. 2 © Copyright 2015 Pivotal. All rights reserved. Who am I? Ÿ  Ian Huston Ÿ  @ianhuston Ÿ  www.ianhuston.net Ÿ  More resources:
 https://github.com/ihuston/ python-cf-examples Ÿ  Data Scientist Ÿ  Previously a theoretical physicist using Python for numerical simulations & HPC
  3. 3. 3 © Copyright 2015 Pivotal. All rights reserved. Aims for this talk Goals: Ÿ  What is Cloud Foundry and how can it help? Ÿ  Get a taste of CF as a developer/data scientist Anti-goals: Ÿ  Understand CF from an operations viewpoint Ÿ  Install & run a full Cloud Foundry installation
  4. 4. 4 © Copyright 2015 Pivotal. All rights reserved. Talk Resources For the full 2 hour tutorial clone this repo: https://github.com/ihuston/python-cf-examples

  5. 5. What is Cloud Foundry? http://cloudfoundry.org Open Source Multi-Cloud Platform Simple App Deployment, Scaling & Availability
  6. 6. Cloud Applications Haiku Here is my source code Run it on the cloud for me I do not care how. -  Onsi Fakhouri @onsijoe
  7. 7. How can data scientists use CF?
  8. 8. Data Services Easy control of incoming data
  9. 9. Distributed computation
  10. 10. Data Driven Applications
  11. 11. 11 © Copyright 2015 Pivotal. All rights reserved. Multi-cloud Ÿ  Same applications running across different cloud providers: Private Public Hosted
  12. 12. 12 © Copyright 2015 Pivotal. All rights reserved. Cloud Foundry Foundation PLATINUMGOLDSILVER
  13. 13. 13 © Copyright 2015 Pivotal. All rights reserved. cf push Pushing your first app
  14. 14. 14 © Copyright 2015 Pivotal. All rights reserved. Challenge 1: Pushing your first application Ÿ  Choose PWS API endpoint: $ cf api https://api.run.pivotal.io Ÿ  Login: $ cf login Ÿ  Code directory: 01-simple-python-app Ÿ  Deploy with $ cf push Ÿ  Check it worked at http://myapp-RANDOM-WORDS.cfapps.io Ÿ  Turn off your app when finished with cf stop myapp (but not yet!)
  15. 15. 15 © Copyright 2015 Pivotal. All rights reserved. Simple Flask App Demo Ÿ  Simple one page “Hello World” web app Ÿ  Video: https://www.youtube.com/watch?v=QOfD6tnoAB8 Ÿ  Demonstrates: –  Installation of requirements –  Scaling properties Ÿ  Need to Provide: –  App files –  Dependencies listed in requirements.txt file –  Optional manifest.yml file with configuration for deployment
  16. 16. C F R O" U" T" E" R 2. Set up domain Cloud Controller Instance 1. Upload code 4. Copy app into containerised instances 3. Install Python & Dependencies 5. Start app and accept connections Send request to URL WHAT JUST HAPPENED? Source Code Instance $ cf push Browser 5. Load balance between instances
  17. 17. 17 © Copyright 2015 Pivotal. All rights reserved. What just happened? 1.  Application code is uploaded to CF 2.  Domain URL is set up ready for routing 3.  Cloud controller builds application in container: –  Python interpreter selected –  Dependencies installed with pip 4.  Container is replicated to provide instances 5.  App starts and Router load balances requests Ÿ  See what’s happening using logs: $ cf logs myapp --recent
  18. 18. 18 © Copyright 2015 Pivotal. All rights reserved. Python on Cloud Foundry Ÿ  First class language (with Go, Java, Ruby, Node.js, PHP) Ÿ  Automatic app type detection –  Looks for requirements.txt or setup.py Ÿ  Buildpack takes care of –  Detecting that a Python app is being pushed –  Installing Python interpreter –  Installing packages in requirements.txt using pip –  Starting web app as requested (e.g. python myapp.py)
  19. 19. 19 © Copyright 2015 Pivotal. All rights reserved. Scaling memory and instances Ÿ  We can scale our application as needed in terms of memory and number of instances: $ cf scale myapp –i 5 $ cf scale myapp –m 256M Ÿ  Check app in browser to see different instances being used. Ÿ  Scale back down with $ cf scale myapp –i 1
  20. 20. 20 © Copyright 2015 Pivotal. All rights reserved. How does this work? Ÿ  Containerised application is cached and ready to be deployed. Ÿ  Scaling number of instances replicates container and load balances requests across all instances. Ÿ  Scaling memory requires restarting app. Ÿ  Auto-scaling is also possible.
  21. 21. 21 © Copyright 2015 Pivotal. All rights reserved. Buildpacks Pushing data science apps
  22. 22. 22 © Copyright 2015 Pivotal. All rights reserved. What are buildpacks? Ÿ  Idea and format from Heroku Ÿ  Responsible for doing whatever is necessary to get your app running. Ÿ  Buildpacks take care of –  Detecting which type of application is being pushed –  Installing the appropriate run-time –  Installing required dependencies or other artifacts –  Starting the application as requested
  23. 23. 23 © Copyright 2015 Pivotal. All rights reserved. Containers vs Buildpacks runtime layer OS image application layer Container (e.g. Docker) system brings fixed host OS Kernel * Devs may bring a custom buildpack runtime layer* OS image application layer Buildpack App container System Provides Dev Provides system brings fixed host OS Kernel
  24. 24. 24 © Copyright 2015 Pivotal. All rights reserved. Community Buildpacks https://github.com/cloudfoundry-community/ cf-docs-contrib/wiki/Buildpacks Ÿ  Lots of languages: 
 Clojure, Haskell, .NET, Erlang, Elixir, etc. Ÿ  RShiny app buildpack: 
 https://github.com/alexkago/cf-buildpack-r Ÿ  Can also use some Heroku buildpacks without modification.
  25. 25. 25 © Copyright 2015 Pivotal. All rights reserved. Using conda for package management Ÿ  http://conda.pydata.org Ÿ  Benefits: –  Uses precompiled binary packages –  No fiddling with Fortran or C compilers and library paths –  Known good combinations of main package versions –  Really simple environment management (better than virtualenv) –  Easy to run Python 2 and 3 side-by-side Go try it out if you haven’t already!
  26. 26. 26 © Copyright 2015 Pivotal. All rights reserved. Challenge 2: Pushing a PyData app Ÿ  Code directory: 02-pydata-spyre-app Ÿ  Spyre – Adam Hajari https://github.com/adamhajari/spyre Ÿ  This app uses the Pydata buildpack to install Matplotlib, NumPy and more. Ÿ  Spyre provides a simple way to build interactive web based visualisations similar to Rshiny.
  27. 27. 27 © Copyright 2015 Pivotal. All rights reserved. Next Steps See https://github.com/ihuston/python-cf-examples for continuation of tutorial: Ÿ  How to bind data sources like Redis & PostgreSQL Ÿ  Build a simple machine learning API system Full tutorial as a video: https://www.youtube.com/watch?v=lp2c05yDJko
  28. 28. 28 © Copyright 2015 Pivotal. All rights reserved. Resources Ÿ  Docs: http://docs.cloudfoundry.org Ÿ  CF Summit videos: http://cfsummit.com Ÿ  Join the CF community: http://cloudfoundry.org Ÿ  CF meetups: http://cloud-foundry.meetup.com
  29. 29. 29 © Copyright 2015 Pivotal. All rights reserved. @ianhuston
  • PeterMorgan12

    Mar. 17, 2016

ODSC March 2016 Meetup

Views

Total views

487

On Slideshare

0

From embeds

0

Number of embeds

5

Actions

Downloads

17

Shares

0

Comments

0

Likes

1

×