SlideShare uma empresa Scribd logo
1 de 19
OpenShift Workshop –
    Python for the impatient
    Sign up code: PyConWorkshop
     Steven Citron-Pousty
     @TheSteve0 (TheSteve0 IRC)
     PaaS Dust Spreader, Red Hat



1
Agenda
    • Start with PaaS intro
    • Show you OpenShift
    • What does development look like
    • Do some development – from here on hands on


    • Signup code: PyconWorkshop




2
Assumptions
    1) You know some Mongo
    2) You know or can read some Python
    3) You prefer to write code and apps over managing
       servers or you prefer managing servers rather than
       dealing with annoying developer requests




3
What is OpenShift?

     Red Hat's free, auto-scaling Platform as a Service (PaaS) for
                       applications in the cloud.




4
Kind of like Amazon, right? Nope.




5
What’s supported?




6
What else do I get and what is the
    catch?
• The Catch is we are in developer preview right now
• OpenShift is free-as-in-beer & free-as-in-freedom
• Three gears – each one is half a gig of RAM, and 1 gig
  of disk (always free)
• Need more resources, just ask!




7
Cook24v on Flickr
8
Demo
    1. Create an application using the command line tools with
       a DB (python)
    2. Create a Wordpress app from the web console


    3. Before I start everyone should start installing the
       command line tools if they haven’t already




9
Some terminology for today
 1. Application – your web code and any data store. Has
    to be on 1 or more gears
 2. Gear – is like a server. It can have only 1 language for
    the web programming.
 3. Cartridge – it adds a language, a data store, or other
    functionality
 4. Git – used for version control and managing code
    between server and your development machine
 5. Ssh – command line tool to connect to your gear



10
GIT


 Distributed Version control
 A local repository – on your laptop
 A remote repository – on some other machine, usually a
   server


 Good place to start -
  http://sixrevisions.com/resources/git-tutorials-
  beginners/


11
OK Now it’s your turn
 1. Create a python application at the command line
     1.   Modify the source and push it back up
 2. Add mongo to your application




12
Mongo Next steps
 1. We look at the National Park data together
 2. We use the code from this github repo :
    https://github.com/openshift/openshift-mongo-flask-
    example
 3. We import the national park data into our MongoDB
    database
 4. Look at the code together.
 5. Write a few of the functions and maybe one of your
    own



13
Flask - a microframework for Python
 A quick way to add code to handle specific URLs –
   typical in REST web services – it also does A LOT
   more
 http://flask.pocoo.org/

 from flask import Flask

 app = Flask(__name__)

 @app.route("/") #this is an annotation
 def hello():
    return "Hello World!"

 if __name__ == "__main__":
    app.run()


14
Conclusion
 1. Openshift makes life great for you
 2. Lot’s of Python choices
 3. The tools are easy to use
 4. You should be ready to write services
 5. Almost anything you need on a server
 6. Did I mention – Free




15
What usually happens on local




 Borrowed from: http://git-scm.com/book/en/Git-Basics-Recording-Changes-to-the-Repository


16
What you do with Remote repositories
 Clone – take a remote
   repository and bring it
   local



 Push – push your local
   changes back up to a
   remote




17
You need to understand at least 3 commands in Git
 1. Git add . (means add all news files as being tracked in
    the local repository)
 2. Git commit –am “your message” (means commit all
    my changes to the local repository with this message)
 3. Git push (means push from your local repository to
    the repository on your OpenShift gear)




18
Github
 Publically hosted git repositores (can be private if you
   pay for it)


 http://www.github.com


 You care about it because:
 1)We have quickstarts
   there
 2)You can put your
   projects there for backup

19

Mais conteúdo relacionado

Mais procurados

Git extension-training
Git extension-trainingGit extension-training
Git extension-trainingEric Guo
 
Introduction to Git Commands and Concepts
Introduction to Git Commands and ConceptsIntroduction to Git Commands and Concepts
Introduction to Git Commands and ConceptsCarl Brown
 
Git for a newbie
Git for a newbieGit for a newbie
Git for a newbieAnuj Sharma
 
Docker meets the IDE
Docker meets the IDEDocker meets the IDE
Docker meets the IDEMario Loriedo
 
Using Nagios to monitor your WO systems
Using Nagios to monitor your WO systemsUsing Nagios to monitor your WO systems
Using Nagios to monitor your WO systemsWO Community
 
Using Git with Drupal
Using Git with DrupalUsing Git with Drupal
Using Git with DrupalRyan Cross
 
Gitgithub101slideshare 150922131830-lva1-app6891
Gitgithub101slideshare 150922131830-lva1-app6891Gitgithub101slideshare 150922131830-lva1-app6891
Gitgithub101slideshare 150922131830-lva1-app6891Brian Okinyi
 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An IntroductionBehzad Altaf
 
Teaching a Designer to Use GitHub
Teaching a Designer to Use GitHubTeaching a Designer to Use GitHub
Teaching a Designer to Use GitHubLiam Dempsey
 
OpenWhisk Go/Swift/Binaries Runtime
OpenWhisk Go/Swift/Binaries RuntimeOpenWhisk Go/Swift/Binaries Runtime
OpenWhisk Go/Swift/Binaries RuntimeMichele Sciabarrà
 
Build and deployment
Build and deploymentBuild and deployment
Build and deploymentWO Community
 
Learning git
Learning gitLearning git
Learning gitSid Anand
 
Running Docker on ARM
Running Docker on ARMRunning Docker on ARM
Running Docker on ARMDieter Reuter
 

Mais procurados (19)

Git extension-training
Git extension-trainingGit extension-training
Git extension-training
 
Introduction to Git Commands and Concepts
Introduction to Git Commands and ConceptsIntroduction to Git Commands and Concepts
Introduction to Git Commands and Concepts
 
Git 101 for Beginners
Git 101 for Beginners Git 101 for Beginners
Git 101 for Beginners
 
Git for a newbie
Git for a newbieGit for a newbie
Git for a newbie
 
Docker meets the IDE
Docker meets the IDEDocker meets the IDE
Docker meets the IDE
 
Introduction to git & GitHub
Introduction to git & GitHubIntroduction to git & GitHub
Introduction to git & GitHub
 
Intro to Git and GitHub
Intro to Git and GitHubIntro to Git and GitHub
Intro to Git and GitHub
 
Using Nagios to monitor your WO systems
Using Nagios to monitor your WO systemsUsing Nagios to monitor your WO systems
Using Nagios to monitor your WO systems
 
Using Git with Drupal
Using Git with DrupalUsing Git with Drupal
Using Git with Drupal
 
Gitgithub101slideshare 150922131830-lva1-app6891
Gitgithub101slideshare 150922131830-lva1-app6891Gitgithub101slideshare 150922131830-lva1-app6891
Gitgithub101slideshare 150922131830-lva1-app6891
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Git basics
Git basicsGit basics
Git basics
 
Git 101
Git 101Git 101
Git 101
 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An Introduction
 
Teaching a Designer to Use GitHub
Teaching a Designer to Use GitHubTeaching a Designer to Use GitHub
Teaching a Designer to Use GitHub
 
OpenWhisk Go/Swift/Binaries Runtime
OpenWhisk Go/Swift/Binaries RuntimeOpenWhisk Go/Swift/Binaries Runtime
OpenWhisk Go/Swift/Binaries Runtime
 
Build and deployment
Build and deploymentBuild and deployment
Build and deployment
 
Learning git
Learning gitLearning git
Learning git
 
Running Docker on ARM
Running Docker on ARMRunning Docker on ARM
Running Docker on ARM
 

Destaque

Introduction to PaaS for application developers
Introduction to PaaS for application developersIntroduction to PaaS for application developers
Introduction to PaaS for application developersSteven Pousty
 
APPLICATIONS AND CONTAINERS AT SCALE: OpenShift + Kubernetes + Docker
APPLICATIONS AND CONTAINERS AT SCALE: OpenShift + Kubernetes + DockerAPPLICATIONS AND CONTAINERS AT SCALE: OpenShift + Kubernetes + Docker
APPLICATIONS AND CONTAINERS AT SCALE: OpenShift + Kubernetes + DockerSteven Pousty
 
Spatial script for MongoBoulder
Spatial script for MongoBoulderSpatial script for MongoBoulder
Spatial script for MongoBoulderSteven Pousty
 
Spatial script for CIMA
Spatial script for CIMASpatial script for CIMA
Spatial script for CIMASteven Pousty
 
Spatial MongoDB, Node.JS, and Express - server-side JS for your application
Spatial MongoDB, Node.JS, and Express - server-side JS for your applicationSpatial MongoDB, Node.JS, and Express - server-side JS for your application
Spatial MongoDB, Node.JS, and Express - server-side JS for your applicationSteven Pousty
 
Monkigras - dropping science on your developer ecosystem
Monkigras - dropping science on your developer ecosystemMonkigras - dropping science on your developer ecosystem
Monkigras - dropping science on your developer ecosystemSteven Pousty
 
Build a PaaS with OpenShift Origin
Build a PaaS with OpenShift OriginBuild a PaaS with OpenShift Origin
Build a PaaS with OpenShift OriginSteven Pousty
 

Destaque (7)

Introduction to PaaS for application developers
Introduction to PaaS for application developersIntroduction to PaaS for application developers
Introduction to PaaS for application developers
 
APPLICATIONS AND CONTAINERS AT SCALE: OpenShift + Kubernetes + Docker
APPLICATIONS AND CONTAINERS AT SCALE: OpenShift + Kubernetes + DockerAPPLICATIONS AND CONTAINERS AT SCALE: OpenShift + Kubernetes + Docker
APPLICATIONS AND CONTAINERS AT SCALE: OpenShift + Kubernetes + Docker
 
Spatial script for MongoBoulder
Spatial script for MongoBoulderSpatial script for MongoBoulder
Spatial script for MongoBoulder
 
Spatial script for CIMA
Spatial script for CIMASpatial script for CIMA
Spatial script for CIMA
 
Spatial MongoDB, Node.JS, and Express - server-side JS for your application
Spatial MongoDB, Node.JS, and Express - server-side JS for your applicationSpatial MongoDB, Node.JS, and Express - server-side JS for your application
Spatial MongoDB, Node.JS, and Express - server-side JS for your application
 
Monkigras - dropping science on your developer ecosystem
Monkigras - dropping science on your developer ecosystemMonkigras - dropping science on your developer ecosystem
Monkigras - dropping science on your developer ecosystem
 
Build a PaaS with OpenShift Origin
Build a PaaS with OpenShift OriginBuild a PaaS with OpenShift Origin
Build a PaaS with OpenShift Origin
 

Semelhante a Python for the impatient OpenShift Workshop

Free Mongo on OpenShift
Free Mongo on OpenShiftFree Mongo on OpenShift
Free Mongo on OpenShiftSteven Pousty
 
OpenShift with Eclipse Tooling - EclipseCon 2012
OpenShift with Eclipse Tooling - EclipseCon 2012OpenShift with Eclipse Tooling - EclipseCon 2012
OpenShift with Eclipse Tooling - EclipseCon 2012Steven Pousty
 
Agile NCR 2013- Shekhar Gulati - Open shift platform-for-rapid-and-agile-deve...
Agile NCR 2013- Shekhar Gulati - Open shift platform-for-rapid-and-agile-deve...Agile NCR 2013- Shekhar Gulati - Open shift platform-for-rapid-and-agile-deve...
Agile NCR 2013- Shekhar Gulati - Open shift platform-for-rapid-and-agile-deve...AgileNCR2013
 
Volunteering atyouseeforit services
Volunteering atyouseeforit servicesVolunteering atyouseeforit services
Volunteering atyouseeforit servicesYouSee
 
Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Henry Schreiner
 
Openshift GeoSpatial Capabilities
Openshift GeoSpatial CapabilitiesOpenshift GeoSpatial Capabilities
Openshift GeoSpatial CapabilitiesSteven Pousty
 
Building Social IRC Bots with Node.js and MongoDB
Building Social IRC Bots with Node.js and MongoDBBuilding Social IRC Bots with Node.js and MongoDB
Building Social IRC Bots with Node.js and MongoDBMongoDB
 
Introduction to Python Programming
Introduction to Python ProgrammingIntroduction to Python Programming
Introduction to Python ProgrammingAkhil Kaushik
 
Serial Data from Arduino to Raspberry Pi to MySQL using CoAP Protocol
Serial Data from Arduino to Raspberry Pi to MySQL using CoAP ProtocolSerial Data from Arduino to Raspberry Pi to MySQL using CoAP Protocol
Serial Data from Arduino to Raspberry Pi to MySQL using CoAP ProtocolSanjay Kumar
 
Mongo db bangalore
Mongo db bangaloreMongo db bangalore
Mongo db bangaloreMongoDB
 
Beginner Workshop for Student Developers - Tratech-presentation.pdf
Beginner Workshop for Student Developers - Tratech-presentation.pdfBeginner Workshop for Student Developers - Tratech-presentation.pdf
Beginner Workshop for Student Developers - Tratech-presentation.pdfGDSCKNUST
 
Volunteering at YouSee on Technology Support
Volunteering at YouSee on Technology SupportVolunteering at YouSee on Technology Support
Volunteering at YouSee on Technology SupportYouSee
 
Midwest php 2013 deploying php on paas- why & how
Midwest php 2013   deploying php on paas- why & howMidwest php 2013   deploying php on paas- why & how
Midwest php 2013 deploying php on paas- why & howdotCloud
 
PyCon2022 - Building Python Extensions
PyCon2022 - Building Python ExtensionsPyCon2022 - Building Python Extensions
PyCon2022 - Building Python ExtensionsHenry Schreiner
 
Hands-on Lab: Red Hat Container Development & OpenShift
Hands-on Lab: Red Hat Container Development & OpenShiftHands-on Lab: Red Hat Container Development & OpenShift
Hands-on Lab: Red Hat Container Development & OpenShiftAmazon Web Services
 
How bigtop leveraged docker for build automation and one click hadoop provis...
How bigtop leveraged docker for build automation and  one click hadoop provis...How bigtop leveraged docker for build automation and  one click hadoop provis...
How bigtop leveraged docker for build automation and one click hadoop provis...Evans Ye
 
Pharo IoT Installation Improvements and Continuous Integration
Pharo IoT Installation Improvements and Continuous IntegrationPharo IoT Installation Improvements and Continuous Integration
Pharo IoT Installation Improvements and Continuous IntegrationAllex Oliveira
 
PHARO IoT: Installation Improvements and Continuous Integration
PHARO IoT: Installation Improvements and Continuous IntegrationPHARO IoT: Installation Improvements and Continuous Integration
PHARO IoT: Installation Improvements and Continuous IntegrationPharo
 

Semelhante a Python for the impatient OpenShift Workshop (20)

Free Mongo on OpenShift
Free Mongo on OpenShiftFree Mongo on OpenShift
Free Mongo on OpenShift
 
OpenShift with Eclipse Tooling - EclipseCon 2012
OpenShift with Eclipse Tooling - EclipseCon 2012OpenShift with Eclipse Tooling - EclipseCon 2012
OpenShift with Eclipse Tooling - EclipseCon 2012
 
Agile NCR 2013- Shekhar Gulati - Open shift platform-for-rapid-and-agile-deve...
Agile NCR 2013- Shekhar Gulati - Open shift platform-for-rapid-and-agile-deve...Agile NCR 2013- Shekhar Gulati - Open shift platform-for-rapid-and-agile-deve...
Agile NCR 2013- Shekhar Gulati - Open shift platform-for-rapid-and-agile-deve...
 
Volunteering atyouseeforit services
Volunteering atyouseeforit servicesVolunteering atyouseeforit services
Volunteering atyouseeforit services
 
Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024
 
Openshift GeoSpatial Capabilities
Openshift GeoSpatial CapabilitiesOpenshift GeoSpatial Capabilities
Openshift GeoSpatial Capabilities
 
Building Social IRC Bots with Node.js and MongoDB
Building Social IRC Bots with Node.js and MongoDBBuilding Social IRC Bots with Node.js and MongoDB
Building Social IRC Bots with Node.js and MongoDB
 
Introduction to Python Programming
Introduction to Python ProgrammingIntroduction to Python Programming
Introduction to Python Programming
 
Serial Data from Arduino to Raspberry Pi to MySQL using CoAP Protocol
Serial Data from Arduino to Raspberry Pi to MySQL using CoAP ProtocolSerial Data from Arduino to Raspberry Pi to MySQL using CoAP Protocol
Serial Data from Arduino to Raspberry Pi to MySQL using CoAP Protocol
 
Mongo db bangalore
Mongo db bangaloreMongo db bangalore
Mongo db bangalore
 
Websocket 101 in Python
Websocket 101 in PythonWebsocket 101 in Python
Websocket 101 in Python
 
Beginner Workshop for Student Developers - Tratech-presentation.pdf
Beginner Workshop for Student Developers - Tratech-presentation.pdfBeginner Workshop for Student Developers - Tratech-presentation.pdf
Beginner Workshop for Student Developers - Tratech-presentation.pdf
 
Volunteering at YouSee on Technology Support
Volunteering at YouSee on Technology SupportVolunteering at YouSee on Technology Support
Volunteering at YouSee on Technology Support
 
Scrapy
ScrapyScrapy
Scrapy
 
Midwest php 2013 deploying php on paas- why & how
Midwest php 2013   deploying php on paas- why & howMidwest php 2013   deploying php on paas- why & how
Midwest php 2013 deploying php on paas- why & how
 
PyCon2022 - Building Python Extensions
PyCon2022 - Building Python ExtensionsPyCon2022 - Building Python Extensions
PyCon2022 - Building Python Extensions
 
Hands-on Lab: Red Hat Container Development & OpenShift
Hands-on Lab: Red Hat Container Development & OpenShiftHands-on Lab: Red Hat Container Development & OpenShift
Hands-on Lab: Red Hat Container Development & OpenShift
 
How bigtop leveraged docker for build automation and one click hadoop provis...
How bigtop leveraged docker for build automation and  one click hadoop provis...How bigtop leveraged docker for build automation and  one click hadoop provis...
How bigtop leveraged docker for build automation and one click hadoop provis...
 
Pharo IoT Installation Improvements and Continuous Integration
Pharo IoT Installation Improvements and Continuous IntegrationPharo IoT Installation Improvements and Continuous Integration
Pharo IoT Installation Improvements and Continuous Integration
 
PHARO IoT: Installation Improvements and Continuous Integration
PHARO IoT: Installation Improvements and Continuous IntegrationPHARO IoT: Installation Improvements and Continuous Integration
PHARO IoT: Installation Improvements and Continuous Integration
 

Mais de Steven Pousty

Spatial script for my JS.Everywhere 2012
Spatial script for my JS.Everywhere 2012Spatial script for my JS.Everywhere 2012
Spatial script for my JS.Everywhere 2012Steven Pousty
 
Spatial Mongo and Node.JS on Openshift JS.Everywhere 2012
Spatial Mongo and Node.JS on Openshift JS.Everywhere 2012Spatial Mongo and Node.JS on Openshift JS.Everywhere 2012
Spatial Mongo and Node.JS on Openshift JS.Everywhere 2012Steven Pousty
 
Spatial script for Spatial mongo for PHP and Zend
Spatial script for Spatial mongo for PHP and ZendSpatial script for Spatial mongo for PHP and Zend
Spatial script for Spatial mongo for PHP and ZendSteven Pousty
 
Spatial mongo for PHP and Zend
Spatial mongo for PHP and ZendSpatial mongo for PHP and Zend
Spatial mongo for PHP and ZendSteven Pousty
 
Dropping Science on Your Developer Ecosystem - lessons from Ecosystem Management
Dropping Science on Your Developer Ecosystem - lessons from Ecosystem ManagementDropping Science on Your Developer Ecosystem - lessons from Ecosystem Management
Dropping Science on Your Developer Ecosystem - lessons from Ecosystem ManagementSteven Pousty
 
Script for the geomeetup presentation
Script for the geomeetup presentationScript for the geomeetup presentation
Script for the geomeetup presentationSteven Pousty
 
MongoSF - Spatial MongoDB in OpenShift - script file
MongoSF - Spatial MongoDB in OpenShift - script fileMongoSF - Spatial MongoDB in OpenShift - script file
MongoSF - Spatial MongoDB in OpenShift - script fileSteven Pousty
 
Mongo sf spatialmongo
Mongo sf spatialmongoMongo sf spatialmongo
Mongo sf spatialmongoSteven Pousty
 
Script for Spatial Mongo
Script for Spatial MongoScript for Spatial Mongo
Script for Spatial MongoSteven Pousty
 
LinuxFest NW - Using Postgis To Add Some Spatial Flavor To Your App
LinuxFest NW - Using Postgis To Add Some Spatial Flavor To Your AppLinuxFest NW - Using Postgis To Add Some Spatial Flavor To Your App
LinuxFest NW - Using Postgis To Add Some Spatial Flavor To Your AppSteven Pousty
 
Using PostGIS To Add Some Spatial Flavor To Your Application
Using PostGIS To Add Some Spatial Flavor To Your ApplicationUsing PostGIS To Add Some Spatial Flavor To Your Application
Using PostGIS To Add Some Spatial Flavor To Your ApplicationSteven Pousty
 

Mais de Steven Pousty (12)

Spatial script for my JS.Everywhere 2012
Spatial script for my JS.Everywhere 2012Spatial script for my JS.Everywhere 2012
Spatial script for my JS.Everywhere 2012
 
Spatial Mongo and Node.JS on Openshift JS.Everywhere 2012
Spatial Mongo and Node.JS on Openshift JS.Everywhere 2012Spatial Mongo and Node.JS on Openshift JS.Everywhere 2012
Spatial Mongo and Node.JS on Openshift JS.Everywhere 2012
 
Spatial script for Spatial mongo for PHP and Zend
Spatial script for Spatial mongo for PHP and ZendSpatial script for Spatial mongo for PHP and Zend
Spatial script for Spatial mongo for PHP and Zend
 
Spatial mongo for PHP and Zend
Spatial mongo for PHP and ZendSpatial mongo for PHP and Zend
Spatial mongo for PHP and Zend
 
Dropping Science on Your Developer Ecosystem - lessons from Ecosystem Management
Dropping Science on Your Developer Ecosystem - lessons from Ecosystem ManagementDropping Science on Your Developer Ecosystem - lessons from Ecosystem Management
Dropping Science on Your Developer Ecosystem - lessons from Ecosystem Management
 
Script for the geomeetup presentation
Script for the geomeetup presentationScript for the geomeetup presentation
Script for the geomeetup presentation
 
MongoSF - Spatial MongoDB in OpenShift - script file
MongoSF - Spatial MongoDB in OpenShift - script fileMongoSF - Spatial MongoDB in OpenShift - script file
MongoSF - Spatial MongoDB in OpenShift - script file
 
Mongo sf spatialmongo
Mongo sf spatialmongoMongo sf spatialmongo
Mongo sf spatialmongo
 
Script for Spatial Mongo
Script for Spatial MongoScript for Spatial Mongo
Script for Spatial Mongo
 
deCarta at BAPI
deCarta at BAPI deCarta at BAPI
deCarta at BAPI
 
LinuxFest NW - Using Postgis To Add Some Spatial Flavor To Your App
LinuxFest NW - Using Postgis To Add Some Spatial Flavor To Your AppLinuxFest NW - Using Postgis To Add Some Spatial Flavor To Your App
LinuxFest NW - Using Postgis To Add Some Spatial Flavor To Your App
 
Using PostGIS To Add Some Spatial Flavor To Your Application
Using PostGIS To Add Some Spatial Flavor To Your ApplicationUsing PostGIS To Add Some Spatial Flavor To Your Application
Using PostGIS To Add Some Spatial Flavor To Your Application
 

Python for the impatient OpenShift Workshop

  • 1. OpenShift Workshop – Python for the impatient Sign up code: PyConWorkshop Steven Citron-Pousty @TheSteve0 (TheSteve0 IRC) PaaS Dust Spreader, Red Hat 1
  • 2. Agenda • Start with PaaS intro • Show you OpenShift • What does development look like • Do some development – from here on hands on • Signup code: PyconWorkshop 2
  • 3. Assumptions 1) You know some Mongo 2) You know or can read some Python 3) You prefer to write code and apps over managing servers or you prefer managing servers rather than dealing with annoying developer requests 3
  • 4. What is OpenShift? Red Hat's free, auto-scaling Platform as a Service (PaaS) for applications in the cloud. 4
  • 5. Kind of like Amazon, right? Nope. 5
  • 7. What else do I get and what is the catch? • The Catch is we are in developer preview right now • OpenShift is free-as-in-beer & free-as-in-freedom • Three gears – each one is half a gig of RAM, and 1 gig of disk (always free) • Need more resources, just ask! 7
  • 9. Demo 1. Create an application using the command line tools with a DB (python) 2. Create a Wordpress app from the web console 3. Before I start everyone should start installing the command line tools if they haven’t already 9
  • 10. Some terminology for today 1. Application – your web code and any data store. Has to be on 1 or more gears 2. Gear – is like a server. It can have only 1 language for the web programming. 3. Cartridge – it adds a language, a data store, or other functionality 4. Git – used for version control and managing code between server and your development machine 5. Ssh – command line tool to connect to your gear 10
  • 11. GIT Distributed Version control A local repository – on your laptop A remote repository – on some other machine, usually a server Good place to start - http://sixrevisions.com/resources/git-tutorials- beginners/ 11
  • 12. OK Now it’s your turn 1. Create a python application at the command line 1. Modify the source and push it back up 2. Add mongo to your application 12
  • 13. Mongo Next steps 1. We look at the National Park data together 2. We use the code from this github repo : https://github.com/openshift/openshift-mongo-flask- example 3. We import the national park data into our MongoDB database 4. Look at the code together. 5. Write a few of the functions and maybe one of your own 13
  • 14. Flask - a microframework for Python A quick way to add code to handle specific URLs – typical in REST web services – it also does A LOT more http://flask.pocoo.org/ from flask import Flask app = Flask(__name__) @app.route("/") #this is an annotation def hello(): return "Hello World!" if __name__ == "__main__": app.run() 14
  • 15. Conclusion 1. Openshift makes life great for you 2. Lot’s of Python choices 3. The tools are easy to use 4. You should be ready to write services 5. Almost anything you need on a server 6. Did I mention – Free 15
  • 16. What usually happens on local Borrowed from: http://git-scm.com/book/en/Git-Basics-Recording-Changes-to-the-Repository 16
  • 17. What you do with Remote repositories Clone – take a remote repository and bring it local Push – push your local changes back up to a remote 17
  • 18. You need to understand at least 3 commands in Git 1. Git add . (means add all news files as being tracked in the local repository) 2. Git commit –am “your message” (means commit all my changes to the local repository with this message) 3. Git push (means push from your local repository to the repository on your OpenShift gear) 18
  • 19. Github Publically hosted git repositores (can be private if you pay for it) http://www.github.com You care about it because: 1)We have quickstarts there 2)You can put your projects there for backup 19